LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog Data and Video Acquisition Timestamps Not Lining Up

I'm trying to capture analog data, and video simultaneously in LabVIEW.  I'm using a VI I wrote by combining a pre-written video capture example called "IMAQdx Low-Level Grab Async with AVI Recording LV2012 NIVerified" (I found it on the NI site, but I'm having trouble relocating it), and a VI I wrote for data acquisition using the ULx library for Measurement Computing data acquisition devices(https://www.mccdaq.com/Software-Downloads).  Everything seems to be working but the videos are coming out to be about as half as long as the data files.  It seems like the data files are accurate as far as the time stamps go.  It might be an issue with the framerate of the capture versus the framerate of the AVI output.  I'm capturing at ~62 fps, but the VI is outputting a 30 fps AVI file.  I tried changing this within the VI, but it doesn't seems to resolve the issue.  I've attached the VI I'm working with as well as examples of the video and data files.

Download All
0 Kudos
Message 1 of 4
(2,379 Views)

The IMAQ AVI2 Create function has an input for Frames Per Second which should change the frame rate which the AVI is played, have you tried that?

 

If this doesn't seem to work for you I would make sure you are choosing a codec that is labeled (NI Vision). Those are ones NI has tested so I would suspect that they will work fine.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 4
(2,315 Views)

I've tried setting the frame rate in the IMAQ AVI2 Create function, but that doesn't seem to resolve the issue.  I also tried different codecs and it doesn't seem to make a difference.  

 

Changing the samples per channel for the clock and analog input seems to bring the times closer together.  I'm not entirely sure why this works as I'm not really certain what those settings do.

0 Kudos
Message 3 of 4
(2,312 Views)

First, I would try separating your ULx tasks from your camera acquisition to make sure they both work by themselves. Start with the example Grab and Save to AVI to make sure that you can save an AVI for playback at different rates and that the video plays as expected. Once we know that both tasks work separately we can work on combining them.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 4
(2,279 Views)