Log in

View Full Version : H.264 in AVI files - a question


ipanema
7th October 2011, 14:19
I believe that MPEG-4 Part 2 video such as DIVX and XVID is commonly stored in AVI files.

On the other hand, it seems that storing AVC/H.264 in an AVI file is frowned upon - something to do with the presence of backward-referencing B frames I think.

But MPEG-4 Part 2 does also contain B frames.

So why is it OK to store MPEG-4 Part 2 video in an AVI file, but it is not-so-OK to store H.264 video in AVI files ?

LoRd_MuldeR
7th October 2011, 14:30
First of all: H.264 (MPEG-4 AVC) is more complex than MPEG-4 Part-2 (ASP). Multiple references, I-Frames and IDR-Frames, etc.

Also most of the problems with "AVI and H.264" do not originate from the AVI container itself, but form the way how AVI files commonly are created:
Through the antiquated VFW (Video for Windows) interface, as used by the still pretty popular VirtualDub(Mod).

For example, the x264 encoder uses a very long "lookahead", i.e. it reads like ~80 source frames, before the first (compressed) output frame is returned.
This hardly complies with the VFW concept of "one frame in, one frame out". Though hacks to workaround that problem have been invented...

(I think most MPEG-4 Part 2 simply didn't use a big "lookahead", so the problem was less striking)

Last but not least: I think putting MPEG-4 Part-2 into AVI never was the best idea, but it simply became the defacto-standard, back in the DivX ;-) era.
Putting H.264 into AVI is not a problem by itself either (if done properly!), but nowadays we have much better alternatives, such as MKV and MP4.

nm
7th October 2011, 14:38
From http://mirror05.x264.nl/Dark/loren.html
<pengvado> <Dark_Shikari> if a fansubber or DVD rip group uploaded an H.264-in-AVI file they'd get laughed off the internet
<Dark_Shikari> Probably
<pengvado> but asp-in-avi wouldn't be laughed at
<Dark_Shikari> of course not, ASP in AVI is normal unless you want softsubs
<pengvado> and asp-in-avi requires exactly the same ugly hacks
<Dark_Shikari> Probably because its been that way so long that everyone is accustomed to it
<pengvado> which just goes to show that our campaign to use a new codec as an excuse to tell people to upgrade their container is working
;)


Last but not least: I think putting MPEG-4 Part-2 into AVI never was the best idea, but it simply became the defacto-standard in the DivX ;-) era.

Agreed.

ipanema
7th October 2011, 15:14
Thanks for clarifying that.