Page 1 of 1

synchronised video recording on multiple RPi's

Posted: Thu Jun 05, 2014 10:18 pm
by FransK
Does anybody know how to synchronize video recording on multiple RPi systems with a RPi cam each?
I want to experiment with motion capture using 2 (or more) video camera's.
Camera's will be about 3 meter apart, connect by wired ethernet. Subject is a 40 mm white ball at 1..5 meter distance from the camera's, moving at a maximum speed close 100 km/hr.
Probably a third, more powerful, computer will store all video on disk, do 3D tracking and visualisation, be the source for synchronisation and remote control.

There are plenty of items to solve, but has somebody information about questions :

a) can the video driver (v4l / RPi-driver) handle synchronised recording at frame level from an extenal trigger? (a program that signals the driver to get the next frame)

b) does or can the video stream (or file) contain time stamps (data, not video image)


Re: synchronised video recording on multiple RPi's

Posted: Thu Jun 12, 2014 12:45 pm
by towolf
Video2Linux2 driver gives you accurate timestamps. Software which can make use of these timestamps is e.g. GStreamer.

I've dabbled with synchronizing images here: ... 65#p484165

It worked well.

Hardware synch hasn't been available so far because the respective functions of the camera sensor are not exposed on the camera board package.

Here's a video:

Re: synchronised video recording on multiple RPi's

Posted: Sat Jun 14, 2014 3:24 pm
by FransK
Thank you,
I've dabbled with synchronizing images here: viewtopic.php?p=484165#p484165
Very interesting.

a pity that the camera chip does support synchronisation, but it that is not passed on to the RPi. In deed it would be very useful for 3D or other multi-camera projects.

I will start experimenting using python. The pyPiCamera library seems very usefull. Is has a lot of example programs including multi-buffer usage en network streaming (and you can do time-critical parts in C/C++ if necessary)

Because of the remark " ... running good, but it suddenly went out of sync" reminded me about something I read earlier: the RPi seems to use the usb-channel internally also for the network interface. Thus, a (short burst of) heavy network traffic can influence network-based timing messages.

I will go for a separate synchronisation 'channel' between the RPi's : a wire (opto-isolated) or IR-link, possibly controlled by an Arduino(-like) microcontroller (a Teensy). The RPIO python library does support attaching to hardware (input pin) interrupts.
And use an Aruino-driven led clock with seconds visible in 2 decimals (100 Hz).