Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

AVI Read Error #1074395993

I am attempting to read in an avi file, but getting an error message #1074395993.  It was an avi created by another software that I can play in media players just fine.  Are there any tricks to this or specific kinds of encoding (not really familiar with the various types of compression).
 
Originally, my images are in the form of stacked tiff's but I don't believe LabView can currently handle those.  Can someone confirm this?  I have the full LabView 8.2 with the Vision Development Module 8.
 
If I can't read in either the stacked tiffs or the avi file my other software creates, then I will have to save each frame manually from that software (not fun).
 
Thanks in advance for any help.
 
-Tim
0 Kudos
Message 1 of 9
(5,333 Views)
Hello Tim,

Thank you for using National Instruments discussion forums.  As of now Vision supports *.tiff files but it does not support stacked *.tiff files.  Vision should be able to handle any form of .avi file.  I have heard of people receiving erros if the avi was created by a DivX program but other then that Vision should be able to read it.  You might try doing a repair on your Vision Acquisition Software (IMAQ) and also on your Vision Development Module.  Are you able to create an AVI with LabVIEW and then successfully read it back in?  There is a good shipping example that does this for you called "Read Write AVI with Data".  Let me know if this helps.  Thanks and have a great day. 

Regards,
Mark T | Applications Engineer | National Instruments
Message 2 of 9
(5,322 Views)

It is a fresh install of all Labview software (including machine vision and IMAQ drivers).  I did run the "Read Write AVI with Data" example and it seems to work fine (I see the video and can subsequently review the frames with the slider bar).

Maybe it is just a formatting issue of my avi files.  The software that creates them is SPOT Windows version 4.5.3.  It is the software that came with my firewire camera.  I take image sequences which are stored as stacked tiffs.  I then have the option of converting these into avi (which itself takes a significant amount of time) or extracting all images and saving them individually.

I just tried using the "Read AVI" example to read my avi files and at least no errors appear, but the colors are completely wrong.  I think I have seen this before when the file isn't being read properly, but I don't know what causes it.  I will try to narrow down the cause of the problem and post again with more details soon if I can get them.

Thanks for the help guys,
Tim

0 Kudos
Message 3 of 9
(5,323 Views)

OK, I seem to have narrowed the problem down a bit.  The "AVI Read" example can at least open my avi files (although I still have the formatting problem with incorrect color noise on all but the first frame).  The only difference between the beginning of my program and the example is the way the file is selected.  So I guess this is not really a problem any more since I can use the method the example does.  But I can't reason out why there should be a difference between them.  I attached a vi that highlights the difference.  The first part is a copy/paste from the example.  The second part is the code I was trying to use.  If you run it, you can see that, although both file paths are identical, the second part throws an error.

But this still leaves me with the problem with how my images are presented.  I realized that for these files, Windows Media player shows them the same way (incorrectly).  I checked with the SPOT software and it says it is using Cinepak Codec by Radius version 1.10.0.11 for compression.  Are their any known issues with this?

Thanks again,
-Tim

0 Kudos
Message 4 of 9
(5,315 Views)
Hello Tim,

I have tested your code and I receive the same error.  I am going to look into this further to see if it is a BUG.  What version of IMAQ do you have installed?  I am trying to find out if this happens with different versions of drivers.  As for the compression of the AVI that your camera creates it sounds like it is a special compression that is not common.  If it exhibits the same behavior in Windows Media player then the problem lies in the creation of the AVI file.  One thing you can do is to try and find a conversion program that might convert it to another AVI format that uses a more common compression.  Let me know if you are able to do this.  Thanks and have a great day.

Regards,
Mark T | Applications Engineer | National Instruments
Message 5 of 9
(5,308 Views)

My IMAQ version is 3.7.0. 

Thanks for the quick and helpful response.  At least we have found a way to avoid the error.  I will see if I can figure out the issue with the compression.  I'll try your idea of converting the avi or possibly see if I can change which compressor my software uses.

Thanks again,
Tim

0 Kudos
Message 6 of 9
(5,304 Views)
Hello Tim,

If you are still having trouble with the compression of the AVI using the camera's software then I would strongly suggest you use our IMAQdx driver and acquire the video straight into LabVIEW.  You can then very easily write the video to an AVI file, using the IMAQ AVI pallette, all in LabVIEW.  The IMAQdx driver is installed with the Vision Acquisition Software 8.2.1 that you would have installed to get NI-IMAQ 3.7.  Unlike the NI-IMAQ driver though the IMAQdx driver is not free.  If you have just installed it then you can activate the software for 30 days and in the mean time call one of our Sales Representatives for a quote at (800) 531-5066.  Let me know if this helps.  Thanks and have a great day.

Regards,
Mark T
Applications Engineer
National Instruments
Message 7 of 9
(5,290 Views)

I finally got the compression figured out.  I noticed in my SPOT software that when I export to avi, there is a compression setting button.  Upon opening that up (which is how I found the name and version of the compressor yesterday) there are a number of different compressors available.  It turns out the one I was using was set by default for color images while I was using grayscale.  So that problem is solved.

I do have the IMAQdx driver (version 3.0.0) since I am using the software at my school which pretty much has the full academic site license.  I hope to get to full implementation with LabView eventually, but since I only have a little experience with LabView and none with video and image editing, I thought I would start with just image analysis (probably the harder of the two).  Once I've got that done, I may try to tackle the acquisition.  I was just looking at some of the examples and it looks like I could just about replicate our SPOT softaware if I can figure out the details.

Just as extra info, I'm basically trying to do a particle tracking program and analyzy the motion of the particles I view in a microscope.  Luckily, I found the tracking vi in the code-sharing section of the forums, written by the Milne research group (tracker1.0).  So now I just have to work on the analysis and the acquisition.  I'm trying to see how high a framerate I can get out of my firewire camera while maintaining high resolution.  Currently, I'm getting about 6-7 fps obtaining 1024x1024 8-bit grayscale images using the firewire connection.  The camera has a 2048x2048 native res, but auto bins grayscale 2x2.

Thanks for all you help.
Tim

0 Kudos
Message 8 of 9
(5,284 Views)
Hello Tim,

I am glad to hear that you have the compression figured out.  The object tracking sounds like a very interesting application.  As for the frames per second you are receiving you should perform some tests in our Measurement and Automation Explorer (MAX) application where you can perform grabs and set the attributes for the camera.  You will be able to see the frame rate when you do a grab and can test changing some of the attributes such as shutter speed, and packet size to try and increase performance.  There is a good tutorial of setting this up in MAX HERE.  I hope this helps.  Thanks and have a great day.

Regards,
Mark T
Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(5,266 Views)