03-24-2017 10:05 AM
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.
03-24-2017 01:26 PM - edited 03-24-2017 01:27 PM
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/
03-24-2017 01:39 PM
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?
03-24-2017 01:45 PM
03-25-2017 10:20 PM
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
03-25-2017 10:34 PM
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
03-26-2017 04:08 AM
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.
03-26-2017 10:54 PM
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