KonradIT / gopro-ble-py

Python Bluetooth controller for GoPro cameras with BLE connection
97 stars 17 forks source link

Multi-Camera Control #16

Open geande opened 2 years ago

geande commented 2 years ago

Hi Konrad,

First of all, thank you so much for all your hard work in developing such extensive GoPro support! I'm interested in connecting to multiple cameras and starting to record from them simultaneously. Is this possible? I have played around with the command line interface and I can successfully connect to multiple cameras, but I'm not sure how to execute a command issued to both GoPros simultaneously. For reference, I am using two GoPro Hero10s and Windows 10 with Python 3.8.

Thanks!

KonradIT commented 2 years ago

You'd do:

python .\main.py --verbose --address "XX:XX:XX:XX:XX:XX" "XX:XX:XX:XX:XX:XX" --command "record start"

geande commented 2 years ago

Thats amazing, thank you. If I am interested in recording for a set amount of time, say 60 seconds, would that also be possible?

KonradIT commented 2 years ago

You could do a script to fire the "record start", wait 60 seconds and then fire "record stop"

geande commented 2 years ago

gotchya! that was my intuition. I am thinking of using os.system() for making such sequential commands, is this advisable? I notice that there also seems to be the option to make commands from a file, would this be preferred? I'm assuming that a txt file would be the input for such a task.

KonradIT commented 2 years ago

Hm I would use a cmd script.

Using os.system() is counterintuitive since you're launch python code from python. Maybe it would suit you to hard code the commands in the actual main.py file.

hellolwt commented 2 years ago

Hello! How many Hero10s can I control simultaneously at most?

KonradIT commented 2 years ago

I was able to control 3x Hero10. The limit is your Bluetooth chip firmware.

hellolwt commented 2 years ago

I see. Thanks for your help!

hellolwt commented 2 years ago

Hello. I try to test it on Windows10 with Anaconda3( Python 3.8 ), using Hero10s. It successfully works with only one cam connected but gets error below when I trying to connect multi cams. Could you help me with this?

捕获

hellolwt commented 2 years ago

Hello. I try to test it on Windows10 with Anaconda3( Python 3.8 ), using Hero10s. It successfully works with only one cam connected but gets error below when I trying to connect multi cams. Could you help me with this?

捕获

Seems my problem solved, although I don't know the reason. Now that I can control multi cams, but not quite simultaneously,about one or half a second lag. Any idea how to control them exactly at the same time?

KonradIT commented 2 years ago

Not really, timing over BLE is complicated. If you need accurate time sync look at GoPro Labs, there's a few tools there to get framerate-level sync across cameras.

hellolwt commented 2 years ago

Alright, I will check it out. Appreciate that!