LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read string saved in avi through IMAQ AVI Write Frame

Dear all, 

 

I have saved video along with time stamp into avi videos via the IMAQ AVI Write Frame. I have tested the read-out by IMAQ AVI read Frame. Now I need to read the saved time stamp, basically the string out by matlab. I have tired different methods but I cannot figure out the how IMAQ AVI Write Frame saved the string into the frame. Can anyone help me to find out the format of the saved strings? Thank you in advance. 

 

0 Kudos
Message 1 of 8
(2,923 Views)

Check AVI Read Write With Data example where you can write and read data to AVI. Once you read data you can simply overlay if you require.
-Other way is use IMAQ merge overlay to merge the timestamp info to images but this will modify the original image.

 

Edit​: example link and explanation 

http://www.ni.com/example/30572/en/

Thanks
uday
0 Kudos
Message 2 of 8
(2,894 Views)

Dear Uday,

 

Thanks very much for reply. Sorry for bothering. If I want to read out the embedded string just by using the frame data, how can I do it? I understand it is the string saved on each frame, what is the format? 

0 Kudos
Message 3 of 8
(2,882 Views)
Imaq AVI read frame has data out which gives the data in the frame as string.
http://zone.ni.com/reference/en-XX/help/370281AC-01/imaqvision/imaq_avi_read_frame/
- Reading context help of inbuilt functions will give more detail.
Thanks
uday
0 Kudos
Message 4 of 8
(2,879 Views)

I'm not sure which version of LabVIEW changed the AVI functions to AVI2 functions (LabVIEW 2014 and higher only have the AVI2 functions in the Vision Palettes).  AVI2 does not support the Text overlays that were present in the older "Legacy" AVI functions.  The Example code cited in the previous response specifically mentions that this is Legacy code.

 

Some cameras have the ability to write information in part of the video frame -- you could use Image Processing techniques to recover this information ...

 

Bob Schor

0 Kudos
Message 5 of 8
(2,864 Views)

NI changed the AVI functions to AVI2 with the release of LabVIEW 2012 SP1, and the February 2013 Device Driver release.  Reasons for the changes were to accomodate Microsoft's Video Compression Manager, making these functions 64-bit Windows compatible, and to support additional Codecs.

 

Bob Schor

0 Kudos
Message 6 of 8
(2,861 Views)

Thanks for the reply. I am writing frame number into the frame. Currently, I am using camera's inbuilt frame counter. I am interested in how AVI WRITE FRAME embedded the string, but it seems no one knows or at least the NI supporter doesn't want to tell us. So it is impossible to read the string out by a third party language. 

0 Kudos
Message 7 of 8
(2,857 Views)

My colleague used the (old) AVI functions in LabVIEW 2011 to embed text (I'm not sure what, but possibly a TimeStamp and/or Frame Count) in the file, and was able to read it back out.  When AVI2 came out with LabVIEW 2012 SP1, he was no longer able to do this.  However, he is still embedding TimeStamp on the Videos (I'm not sure what he plans to do with it).  As I noted, there are Image Processing functions in IMAQ, and I suppose it is possible that you could do character recognition to decode the embedded text.  But you could also simply write a parallel Text file that you kept with the AVI file which contained whatever text records you would have embedded inside the old AVI codec, but cannot embed using the new AVI2 codecs.

 

You say you are embedding the Frame Number into the Frame.  Why?  Can't you read individual frames with an AVI2 Read Frame?  I can see that you might want to view the AVI images with the Frame Number superimposed on it, but this is simply image manipulation to add the text corresponding to the known Frame Number to the (text-less) Video Image stored in that Frame using IMAQ Overlay Text.

 

Bob Schor

0 Kudos
Message 8 of 8
(2,846 Views)