viewtopic.php?p=902677#p902677jbeale wrote: ... I modified the lights with my own drive circuit to be strobe lights that run at the frame rate of the camera, so even fast-moving objects appear as crisp still frames instead of motion-blurred. It is not perfect because I don't have a way to synchronize the strobe to the start-of-frame, so some images show moving objects split in half by one frame exposure time. However I get far more detail on fast motion than with a normal 360 degree shutter that you typically use at night. ... Doing a short 2 msec pulse at 23 Hz on the IR LEDs allows me to run 4x more current than I could at DC.
There does now seem to be a way to do this as the raspivid code checks for the MMAL_BUFFER_HEADER_FLAG_FRAME_END flag. So by tapping into the code at the point where this flag is known to be set, a timing source for frame synchronisation can be generated.jbeale wrote:It would be perfect if I could synchronize my light to the RPi camera frame start, but I haven't figured out that part yet. It works OK as-is, there is just one region of most frames that has a double-exposure appearance where one rolling-shutter frame starts and another one is ending at the moment the IR strobe goes on.
As yet, I haven't found any example code for the particular synchronisation requirement of driving an IR strobe light. However example code which uses the flag check for other purposes does exist, and shows how the flag can be used. My intention is to use the pi's hardware pwm as a flywheel with its frequency adjusted to the arrival rate of the set frame end flags.
For those wishing to derive sync by customising the userland code, there is a detailed guide by Martin O'Hanlon in his blog at
http://www.stuffaboutcode.com/2013/09/r ... pivid.html
2. For those not wanting to disturb the installed picamera code there is a detailed guide in readthedocs for picamera. This example shows how to access to the buffer header flags and allow you to run your own code in response to every frame.
http://picamera.readthedocs.org/en/rele ... index.html