This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Synchronising an unsynchronised camera with dm365

Expert 2315 points

One of the features I would like to build into our application that is running on a dm365evm board is to sync the video frames of a standard unsync'd PAL video camera to the time reference of others cameras that ultimately gets their sync from an IRIG-B time signal.  What I am currently doing is to take a sync pulse running at 1Hz that is in sync with the 1PPS and trigger an interrupt with it via gpio0.  This ISR start timer 3 running at 24MHz.  The first VD coming in after 1PPS triggers VDINT and this ISR reads timer 3 and saves the count/24 and sets up the timers 3 for 1PPS interrrupt to start it again.  If I now plot this time value in microseconds I get a linear graph with a slope relative to the difference of the unsunc'd camera relative to the "exact" 50fps reference that can be derived from the irig reference.

My problem now is that linux latencies in servicing interrupts causes offsets - which looks like I can calibrate out if I look at the values from my experiment on a sync'd camera giving a plot with slope of zero.  The value measured every second is written into each frame for the next second and when the video data is processed afterwards this would then be used to compensate and calculate the exact absolute time every one of those out-of-sync frames was captured.  The other problem is that somewhere along the line my video will be one slot in front or behind, depending if the camera is faster or slower than 50Hz, the reference data coming in and I need to compensate at that exact point (by throwing away a data packet or video frame) but running through a non-realtime OS it is difficult to do the right thing at the right time.  Any thoughts on the issue would be appreciated though but let me know if more info is required.  I am using dvsdk 2 with mvpro 2.6.18 on the evmdm365.

Thanks, Jinh T.