Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#4225 closed defect (fixed)

Image frozen when riff index > 256 is reached (AVI_MASTER_INDEX_SIZE). Using Avisynth+

Reported by: miguelapg Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: avi
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no


Summary of the bug:

NOTE: I try to see what is the best solution. If this issue should be done from ffmpeg team or Avisynth+

Let me explain the issue.

Maximum riff index added by ffmpeg in the avi video container is 256 (AVI_MASTER_INDEX_SIZE), after that point a warning is shown as: "Invalid riff index 257 > 256", later ... "Invalid riff index 258 > 256" and so on ...

This is done at this part of your code ...

if (avi->riff_id > AVI_MASTER_INDEX_SIZE) {

av_log(s, AV_LOG_ERROR, "Invalid riff index %d > %d\n", avi->riff_id, AVI_MASTER_INDEX_SIZE);


Well, when I encode using Avisynth+ 64-bit and AVISource command, when encoder (i.e: x264) reaches riff index 257, the image stays frozen from there to the end of video, namely just one image is shown.

Therefore if you are encoding an uncompressed AVI video which is bigger than 256~260 GB (approximately), and the input format is a AVS script (using Avisynth+ and JUST the command: AVISource), at some point of time (when riff index 256 is exceed), the video is damaged certainly.

This problem doesn't happen if I use DirectShowSource? instead of AVISource in the Avisynth+ script.

I think that there are two options:

1) Avisynth+ team adds some fix to AVISource to avoid this issue.
2) ffmpeg team allows adding riff indexes bigger than 256 to AVIs.

My questions to ffmpeg team are ...

1) Why are you adding this limit to AVI files?
2) Is it totally necessary?
3) Can you raise or delete this limit?

Kindest regards,

How to reproduce:

% ffmpeg -i input ... output
ffmpeg version: any
built on ...

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (3)

comment:1 Changed 5 years ago by miguelapg

  • Type changed from enhancement to defect

comment:2 Changed 5 years ago by michael

  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from new to closed

comment:3 Changed 4 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords avi added; image frozen Avisynth removed
  • Version changed from unspecified to git-master
Note: See TracTickets for help on using tickets.