Scripting a Capture from an external source
I understand that this category is reserved for Apple users using AppleScript but I'm not really sure which category would be more relevant for this question; maybe someone can point me in the right direction.
My goal is to trigger a camera capture from an external source. Ideally this would be a TCP or OSC message but there are a variety of other protocols that would work for my application. Is there any way to do this? From what I understand, the only way to capture is directly from the physical camera buttons, the button in the interface, or a user-defined keyboard shortcut (ctrl-k by default).
My current solution is to use the Python keyboard module () to simulate a keypress. This works but it requires the program to be selected and it's a bit of a hack. Of course another solution would be to use the physical remote trigger on the camera and use some type of micro-controller like an Arduino to close the switch but I thought someone might have a better solution here.
Is there a way to do this that I'm just missing or would it be possible to write a plugin using the SDK that has this type of functionality?
Thanks!
My goal is to trigger a camera capture from an external source. Ideally this would be a TCP or OSC message but there are a variety of other protocols that would work for my application. Is there any way to do this? From what I understand, the only way to capture is directly from the physical camera buttons, the button in the interface, or a user-defined keyboard shortcut (ctrl-k by default).
My current solution is to use the Python keyboard module () to simulate a keypress. This works but it requires the program to be selected and it's a bit of a hack. Of course another solution would be to use the physical remote trigger on the camera and use some type of micro-controller like an Arduino to close the switch but I thought someone might have a better solution here.
Is there a way to do this that I'm just missing or would it be possible to write a plugin using the SDK that has this type of functionality?
Thanks!
0
-
Just wanted to share the Python keyboard module solution here. import keyboard
keyboard.press_and_release('ctrl+k')
Pretty simple but still not ideal. Anyone have any suggestions?0 -
Hello,
This problem/solution assumes the camera is always on and tethered to a Mac?0 -
Yes, this would assume the camera is on and tethered but not specifically to a Mac. I understand that the Scripting category is for Apple users but it seems like this functionality should be os agnostic. The python code I posted would definitely work across platforms. 0 -
You can simulate a keypress in Applescript like this More references on this
tell application "TextEdit" to activate
tell application "System Events"
keystroke "abc 123"
end tell
However Applescript doesn't have a direct interface to the Mac's Network Interfaces.
From another Mac you could trigger the Keypress Applescript to run, like this
There seem to be few OSC applications for OSX, and I don't see one that can trigger ascript of anykind.
You could log into the Mac using SSH, and the remotely run a keypress script. A bit too low level for this solution I think.
Otherwise you need something with a network interface that can- Call an Applescript Script when it receives a TCP message (receiver side)
- Send a TCP message in response to a mouse click or keypress (controller side)
There is a page here with some comments on writing a UNIX script which reacts to a TCP message and could call an Applescript0 -
There are a lot of 'you could' answers but without knowing a little more about what you are hoping to achieve it not necessarily what you should do.
for instance AS has a direct connection to capturing with CO.
tell application "Capture One 12"
capture
delay 1 -- wait for capture to finish
end tell
But running AS remotely is a PITA in 10.14 because of the security changes of recent.
Have you had a look at PiCameraControl there are a couple Pi camera control projects that might be worth looking at.0
Post ist für Kommentare geschlossen.
Kommentare
5 Kommentare