LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Video Playback in synchronization to data display

I've read a bunch of topics about recording live video, but my question has to do with playback synchronized to a data display.  I've got a simple black and white camera (RS170) already.  I'm going to get some sort of capture board.  I want to record video from this camera to the hard drive.  The reason is that this video file needs to be analyzed later so I need to store it on disk instead of memory as it could be days later.  While I'm recording video, another signal needs to be recorded.  It could be anything really, let us say temperature for discussion.  Assume everything is in place for this temp. acquisition. 
 
Recording video to disk doesn't seem to be any problem.  My question relates to playing this video back such that when you play it, you can also look at a data display of the recorded temperatures that happened at the same time as the video was recorded.  If you were to drag the video slider manually (instead of just pressing play), the data display would also update accordingly.  This essentially syncs the data display of temperature with the video picture you are seeing.  Pressing play and just watching the video, the temp data would update itself with the correct historical values.  Pressing pause on the video, would of course freeze the temp display to the value at that time.  Wherever the video is, the temp data would have to display the correct historical value.
 
I would need to record possibly a few hours of video a day so disk space could be an issue if using uncompressed AVI format.  I wouldn't have to save every days video file so I could eventually delete a bunch of the files.  I'd just save the days video that produces interesting results to examine later.  A number of video files might build up (a months worth?) before the directory is examined for possible deletes.  I'd like some feedback on this too from someone who has tried uncompressed AVI versus something else that is compressed.  Is performance OK if using compression? 
 
The computer I'd be running this on is the latest workstation class machine from HP so it is a fairly powerful computer.
 
Is there any sample code of doing this video playback indexing to data signal display?  I'm thinking there would have to be some function to know where the video is playing at all times and then historically retrieve the temperature data.  Is there performance issues with this?  I'd want it fairly accurate such that the smallest increment of a video frame (say 30 times a second) produced a proper data display for temperature.  In reality, my signal will change faster than a typical temperature value would.
0 Kudos
Message 1 of 5
(3,483 Views)
I doubt this will satisfy 100% of what you're looking for, but it should at least get the conversation started on developing some techniques we can use to syncronize acquired data playback (again, let's say temperature) with some external source. I don't know much about video playback, so I won't be able to help you much there, but I do know a lot about leveraging LabVIEW technology to play back data in real-time as best possible, while allowing the user (or the video playback itself) to dictate a specific position at any time, pause, etc... My first recommendation would be to save your acquired temperature data as a Waveform. Waveform is more or less like a cluster with three elements: a 1D array of Y-values, an intial time (t0), and the time between samples (dt). You can use these three pieces of information to reconstitute when each sample was acquired and what the timing should be configured for to play these samples back in real time. Search the web for information on writing Waveforms to file and reading them. You should find plenty there (or post somewhere else 😉 ).

After that, we can use a Timed Loop for playback. Timed Loops allow you to set a desired Loop period. They also have a lot of other capabilities, such as setting priorities, handling the fact that your last loop didn't finish on time, etc. Here's a link with more info on Timed Loops. Other than that, Timed Loops can operate like regular while loops.

My next idea is to incorporate a current position that we keep track of. This could be, for instance, the index of the current element in the 1D Y-values array. If you want this to involve user interaction with the front panel (for instance, changing a Slider value to reflect the playback position), then you could use an event structure with a timeout case set to zero. Then update the temperature value and increment the current position in the timeout case.

You might take a look at the example I've written in LabVIEW 7.1 that "acquires" 5 seconds of sine wave data and plays it back in real time. The user can adjust the position or pause the playback at any time. Again, I don't know exactly how this would interface with video feedback. If you have more specifics about what method you will use to playback the video, maybe someone with more expertise in this area could help us out.


Jarrod S.
National Instruments
0 Kudos
Message 2 of 5
(3,458 Views)

I realize I'm reviving a dead thread, but I'm very interested in how this turned out, if at all.  I am essentially performing crash tests with accelerometers placed on the moving object.  The goal is to reach a certain change in rate of speed over time.  The accelerometers are enough to tell us that we're reaching the desired acceleration, and the separate video is very good information, but to sync the data with video (in future tests) would be invaluable information we could use to "debug" the mechanics of the crash.  Whereas now we have an acceleration curve and a video, we just use educated guesses to pick out the acceleration peaks and dips in the video, it'd be great to know, for sure, exactly when the peaks and dips are.

Thanks

0 Kudos
Message 3 of 5
(3,081 Views)

I can tell you the result.  I wanted to do this on the cheap side and with as little equipment as possible.  I ended up using a digital video recorder (normally used for security/surveillance) which was a GE Digia-4 (they have newer models now).  I also used an XBOB unit from Decade Engineering (http://www.decadenet.com/) to overlay the text (data) on the video.  I used the existing PLC of the process line to send out serial data to the XBOB continuously which matched the current position of the machine.  This also matched up well with the existing video cameras we had at the time which were analog video with BNC connections.  So PLC serial -> XBOB (which combines camera signal and overlays text sent by PLC) -> digital video recorder.  This was my non-Labview solution.

If you have Labview or want to use it, then NI Vision offers this same overlay function block and the ability to save images.  Be aware that NI Vision costs something significant and also the Vision runtime is around $400 I think.

Message 4 of 5
(3,075 Views)

JF3M, I am working on the same problem to synchronize tracking data to video recordings for my research. I have been hitting multiple dead ends, until I saw this. Would you kindly share the instructions on how to do this??? I will appreciate your help so much.

 

Thanks.

0 Kudos
Message 5 of 5
(2,956 Views)