Incompatible IMAQ Image Type Error When Writing AVI File

Updated Mar 27, 2023

Reported In

Software

  • Vision Development Module
  • LabVIEW Base
  • LabVIEW Full
  • LabVIEW Professional

Driver

  • NI-IMAQ
  • Vision Acquisition Software

Issue Details

I am trying to use the IMAQ AVI Write Frame VI to create a basic AVI file in my image acquisition program. Whenever I run the application, I receive Error -1074395966, -1074396077 or -1074396080 corresponding to invalid or incompatible image type. If I can successfully snap, grab, and view images without any problems in the same VI, what is causing this error to occur?

Solution

As the short error description suggests, this problem is caused by using an incompatible image type with the IMAQ AVI Write Frame or IMAQ AVI2 Write Frame VIs. The image type refers to the bit depth of the image and how it is represented, such as an 8-bit grayscale image or RGB image. The IMAQ AVI Write Frame VI requires that the image you pass to it be either an 8-bit grayscale or 32-bit RGB image. The IMAQ AVI2 Write Frame VI can also be used with 32-bit HSL (hue, saturation, and luminance) images. Consequently, you will be unable to write the AVI file without first converting the image to an accepted file type.

If you do need to convert the image to an appropriate image type, there are multiple options for doing so:
  • Set the image type when using the IMAQ Create VI if reading images from file.
  • Change the image representation through the camera settings in Measurement & Automation Explorer (MAX).
  • Use the IMAQ Cast Image VI.
  • See Convert Image to 8-bits for a few other methods of converting the image type with NI Vision.
For examples of reading and writing an AVI file with the Vision Development Module, refer to the NI Example Finder at Toolkits and Modules>>Vision>>Files.