LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show timestamp on AVI

Attached is my current LabView program that gets a video from a camera and records it for a set time (Max Time). I need to be able to display the time that has passed at any given moment of recording on my avi file such that I can see it in Windows Media Player. I want to be able to see the amount of milliseconds that have passed on my video. Is there a way to take the time that has passed and place it in my avi file?

 

For example, if I run the recording for 15 seconds and I pause the video at 13.45 seconds, I want to be able to see somewhere on the video the number 13.45.

0 Kudos
Message 1 of 3
(4,852 Views)

Hi Blackknight0819,

 

The IMAQ AVI VIs have the ability to associate metadata with each frame of the AVI file. In your program you could potentially save the timestamp with each frame, and then overlay that data on the frame. You can take a look at this example that shows how to add data to AVI frames. 

 

This method will simply associate the timestamp data with the specific frame of the AVI file, which would be useful for future VIs that need to access this data, but if you want to actually see this information on each frame in Windows Media Player, you would have to use one of the IMAQ Overlay functions to put the text on the image. You would then have to merge the overlay into the image so that the overlaid text actually becomes part of the image. This is discussed in a forum post. Once the overlay has been merged into the actual image, you can then save the frames as you would normally do with an AVI file. I hope this helps!

David S.
0 Kudos
Message 2 of 3
(4,818 Views)

In LabVIEW 2012 SP1, NI replaced AVI functions with a new set, called AVI2.  The AVI2 functions do NOT have the ability to associate metadata with each AVI frame.

 

There are two ways to get around this problem.  One way is to simply open a second file and write the data, on a frame-by-frame basis, to this second file.  You could choose a file format that is appropriate for the data you are writing (e.g. you would not need to use a Text file).

 

When it came time to view the data, you could read the two files back a frame at a time, automatically synchronizing the two displays.  If you want to overlay the text (or other) information on the AVI image, you could use the Image-processing tools to create such an overlay.

 

The second method is to combine the above two steps into a single step.  As each image is acquired, create an appropriate overlay, add it to the image, and save in the AVI file.

 

Finally, the original AVI functions are still present (as of LabVIEW 2013), but no longer appear on the Function Palette.  They can be found in vi.lib\vision as AVI1 LLBs.  No telling how long they will stay there ...

Message 3 of 3
(4,702 Views)