Closed elhananby closed 2 years ago
It has been a while since I tried it, but https://github.com/strawlab/strand-braid/blob/main/strand-braid-user/scripts/record-mkv-video.py should still work. If not, maybe you can fiddle it until it does? Nothing fundamental has changed. In general, it is possible to script anything that can be done with the web UI by directly connecting to Strand Cam from e.g. a Python script.
Hi Andrew, thanks for the answer and sorry for the late reply. As you said, I got it working by just passing all the required arguments to the camera whenever I want to start recording, i.e.
strand_cam.send_to_camera({"SetPostTriggerBufferSize": 500})
MKVRecordingConfig = {'codec': {'H264': {'bitrate': 5000, 'cuda_device': 0}},
'max_framerate': 'Fps100',
'writing_application': 'braid-strand-cam-0.11.1',
'save_creation_time': True,
'do_trim_size': True}
strand_cam.send_to_camera({"PostTrigger": MKVRecordingConfig})
Thanks Elhanan
Hi Andrew, I had a question regarding starting to record an MKV post-trigger using a Python script. I saw that you can set the
SetPostTriggerBufferSize
andPostTrigger
configuration, https://github.com/strawlab/strand-braid/blob/58485b64dff08b49a80e5dd2af77ede2d1ca101c/ci2-remote-control/src/lib.rs#L272-L273 however, it requires sending aMkvRecordingConfig
, which by itself requires sending aMkvCodec
config, which needsH264Options
, and so on. https://github.com/strawlab/strand-braid/blob/58485b64dff08b49a80e5dd2af77ede2d1ca101c/ci2-remote-control/src/lib.rs#L146-L150 Is there any simple way to activate the post-trigger recording from Python, similar to just settingSetIsRecordingMkv(True)
?Thanks Elhanan