Error -1074396005 When Using the IMAQ AVI Functions

Updated Apr 6, 2023

Reported In

Software

  • Vision Development Module

Driver

  • NI-IMAQ

Issue Details

My application is using the IMAQ AVI functions to write a AVI file to disc. Currently, when I try to run my application I receive error -1074396005 and the file is not properly created or is empty. How can I resolve this problem to ensure my AVI file is properly created?
 

This error is also appearing when I try to read an AVI file using the IMAQ AVI2 Open.vi function.

Solution

This error occurs when the AVI Refnum representing your AVI file session is either incorrect or not a refnum. There are a number of causes for this, but in general the following steps will help you narrow down the issue.
  • Make sure that the reference is not being closed elsewhere while you are still trying to use it.
  • Use probes and breakpoints to check the value of the refnum as your application is being used. The refnum may be getting replaced or modified somewhere.
  • Ensure that any structures using your refnum pass the refnum through in all cases. Make sure no output tunnels are using default values, which would overwrite the refnum with an invalid value.
In the case of reading an AVI file, this issue is caused by an incompatible codec.
  • Ensure that the AVI you're trying to read is in the correct codec.
  • If the AVI is the product of a conversion from a different format ensure you select a compatible codec when converting the file to AVI.