07-06-2020 03:31 AM - edited 07-06-2020 03:34 AM
Since the AVI functionality overhaul in VDM 2012 SP1 (archived) maximum AVI file size has been limited to 2 GB. In VDM 2019 this issue was reported to be fixed (archived) under CAR #428570.
There is also a KB article about AVI size limit in VDM (archived), which says:
Starting with Vision Development Module 2019, writing AVI files bigger than 2 GB is supported by LabVIEW. However, limitations to AVI file size exist in individual codecs. If you are seeing this error while using VDM 2019, try using a different codec. See "Additional Information" for a list of codecs that support writing file sizes of at least 2 GB.
However, this statement is totally incorrect and incompetent! It interchanges the concepts of compression format (e.g. H.264, VP9) and container format (e.g. AVI, MP4).
Codecs provide an implementation of compression formats, they take one or several uncompressed images and produce an image compressed in a particular format. They are independent of container formats and do not create any container structures; they can only have limitations to image dimensions or size, not file size, as they only process a bunch of images at once.
Next, if you take a closer look at the "list of codecs that have been tested by NI", you may notice that under "codecs that support files over 2 GB" listed only built-in vision codecs. What a coincidence!
Consider an x264vfw codec. If you configure it for direct file output (a debug feature, not its main functionality), it's able to create files over 2 GB. However, if you configure it for VFW output, LabVIEW still returns an error for this codec.
So, there's still no support for AVI files over 2 GB for any system codecs and VDM still uses a limited Microsoft's AVIFile API for them!
If NI has made its own implementation of AVI writer for built-in codecs or uses some third-party one, I don't understand why it can't be used for system codecs as well...
Environment:
Windows 8.1
LabVIEW 2018 SP1 f4 - 2020
Vision Development Module 2019 SP1 - 2020
Steps to Reproduce:
Expected Result:
LabVIEW was able to create an AVI file of 5 GB with this codec.
Actual Result:
"Error -1074395965 occurred at IMAQ AVI2 Write Frame
The AVI file has reached its maximum size of 2 Gigabytes."
Reported to NI with SR #7811362.
07-07-2020 11:53 PM
System codecs use a VFW path that is still limited to 2GB, while the set of codecs supported internally in VDM go through an FFMPEG-based path. This is the discrepancy you see in your testing (and it sure looks like the documentation is unclear).
07-08-2020 02:23 AM
@BlueCheese wrote:
System codecs use a VFW path that is still limited to 2GB
Yes, but only AVIFile API is limited to 2 GB.
Compression takes place through the Video Compression Manager API. It still accepts a frame number during compression (which is I32), but it's only used for fast temporal compression mode (so, it's optional) and even then, considering OpenDML basically stores a sequence of limited AVI files inside a single file, it shouldn't be an issue.
07-08-2020 08:28 AM
Yes, I agree that there are technical solutions now available to generate AVI files using system codecs via VFW past 2GB, but VDM does not currently use those. The APIs it uses are still limited to 2GB.