Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

AVI file size is still limited to 2 GB for all system codecs

Highlighted

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:

  1. Download and install x264vfw codec (as part of K-Lite Mega Codec Pack or standalone);
  2. Create a new VI (or see attached);
  3. Create a video using this codec:
    1. Drop IMAQ AVI2 Create VI on a BD;
    2. Create a constant for Codec terminal with the value x264vfw - H.264/MPEG-4 AVC codec;
  4. Continuously write frames into this video using IMAQ AVI2 Write Frame VI;
  5. Close the video using IMAQ AVI2 Close VI;
  6. Configure the codec for direct file output (a debug feature, see the image below) and run the VI;
    1. The codec was able to create an AVI file of 5 GB:
      x264vfw_direct.png
  7. Configure the codec for VFW output (see the image below);
  8. Run the VI.

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."

x264vfw_VDM.png

 

Reported to NI with SR #7811362.

Message 1 of 4
(292 Views)
Highlighted

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).

0 Kudos
Message 2 of 4
(237 Views)
Highlighted

@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.

0 Kudos
Message 3 of 4
(230 Views)
Highlighted

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.

0 Kudos
Message 4 of 4
(223 Views)