PDA

View Full Version : h264 in AVI or MP4 (is using AVI really bad?)


alexVS
19th December 2008, 21:50
I read some articles, but I can't understand something.
I encode some sport clips.

I'm using TMPGEnc 4.0 XPress. I like this program because it's simple, comfortable and capable of making excellent deinterlace 25i -> 50p. Everything is fine but:

It can encode into mpeg4 AVC (mp4 container) using mainconcept only, which doesn't allow to encode in more than 30FPS. So I encode in AVI with h264 VFW, but I heard so much that h264 AVC in AVI is a bad thing.

So the question is why it's bad (encoding in AVI)? What do I lose when I demultiplex AVI with YAMB and then mux it to MP4 with AAC sound?

Dark Shikari
19th December 2008, 22:01
h264 AVC in AVI is a bad thing.The main reason it's bad is because:

1. H.264 in AVI requires some hacks.
2. Not all players support these hacks.
3. All players which do support these hacks will support better containers, like MKV and MP4. Thus, the subset of players which support H.264 in a proper container is a strict superset of those which support it in AVI.
4. No known hardware player supports H.264 in AVI (AFAIK).

LoRd_MuldeR
19th December 2008, 22:14
4. No known hardware player supports H.264 in AVI (AFAIK).

It seems to exist though:
http://forum.doom9.org/showpost.php?p=1214823&postcount=45

BetaBoy
19th December 2008, 22:18
That's a first for sure....

roozhou
19th December 2008, 22:21
5. AVI usually requires larger overhead than MKV, especially with VBR audio tracks(vbr mp3, aac).

However, H.264 in AVI plays fine through directshow w/ Windows's built-in AVI splitter + ffdshow/CoreAVC.

LoRd_MuldeR
19th December 2008, 22:26
IMO discussion about the "correct" container is kind of pointless, because one can remux at any time, if the current container isn't working for a certain purpose.

Remuxing usually is easy, fast and lossless. Even from AVI you can remux your H.264 streams to MKV flawlessly, thanks to MKVToolnix...

roozhou
19th December 2008, 22:32
IMO discussion about the "correct" container is kind of pointless, because one can remux at any time, if the current container isn't working for a certain purpose.

Remuxing usually is easy, fast and lossless. Even from AVI you can remux your H.264 streams to MKV flawlessly, thanks to MKVToolnix...

But it is not that easy remuxing from mkv to avi. You need mkvextract, avc2avi, tc2cfr and AVIMUX_GUI.

LoRd_MuldeR
19th December 2008, 22:39
But it is not that easy vice versa. You need mkvextract, avc2avi, tc2cfr and AVIMUX_GUI.

So in the extremely rare case that one needs to go from MKV to AVI, it takes a bit more work than 2 clicks. But it still is possible. Doesn't change the point.

froggy1
19th December 2008, 22:44
but... but... but MPEG4 ASP in AVI requires the exactly same hacks for b-frames (even more evil ones if they are packed) and still no body actually cares :p

PS: this was meant to sound a bit sarcastic, not ignite discussion why h264 in avi is bad ;)

nurbs
19th December 2008, 22:51
Yeah, but why bother? Everything that plays AVC in avi will also play it in more suitable containers.

MasterNobody
19th December 2008, 22:53
froggy1
<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 requries 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

BetaBoy
20th December 2008, 09:06
<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

@ Dark_Shikari.... DivX ;-)

@ pengvado.... Shhh, it's a secret!

Comatose
21st December 2008, 18:48
Some (most) people see MKV or MP4 and run off to install every codec pack known to man and end up breaking their filter chain... if they see AVI, they don't, and they usually already have what they need to play H.264+whatever in AVI.

Ranguvar
22nd December 2008, 04:32
Then fix the root of the problem - general human frustration, etc. when it comes to computers. I know I've had that. Good luck ;-)

Esurnir
24th December 2008, 00:41
Actually by some irony mpc-hc dxva decoding dont work well with avi so I needed to remux everything in mkv

qyot27
26th December 2008, 18:40
<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
The sad thing is that I've seen some that do...and just couldn't care less about it. Thankfully it's only one or two of them.


The thing about applying the same hacks as was used in ASP is that ASP is bad enough to do that to, but H.264's featureset is much more expansive in regard to B-frames, the B-pyramid, etc. Using said hacks to put H.264 in AVI often isn't sufficient enough to ensure that the audio remains synced, in the case of numerous B-frames and especially the B-pyramid. The only way around it is to disable those features, but that results in benefit being lost. It'll still perform well, but not as well as it could have.

I've never found an in-depth answer concerning how YAMB/MP4Box corrects H.264 VFW streams before putting them in MP4, although I can only assume that it does perform some sort of fix, since afterward they seem to be fine. I switched my encoding to MeGUI and then ultimately CLI a couple years ago, so having to work around H.264-in-AVI is a very rare occurrence for me.

Kurtnoise
26th December 2008, 19:14
I've never found an in-depth answer concerning how YAMB/MP4Box corrects H.264 VFW streams before putting them in MP4, although I can only assume that it does perform some sort of fix, since afterward they seem to be fine.
1/ avc stream extraction from the AVI file.
2/ avc stream remux into an MP4 file.

RunningSkittle
26th December 2008, 19:46
<pengvado> <Dark_Shikari> if a fansubber or DVD rip group uploaded an H.264-in-AVI file they'd get laughed off the internet

A very prominent fansubber group, dattebayo:

Complete name : E:\TV\Naruto\Naruto Shippuuden\[DB]_Naruto_Shippuuden_089_[46484705].avi
Format : AVI
...
Writing application : Windows Movie Maker 2.1

Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Codec ID : H264
Duration : 23mn 4s
Bit rate : 899 Kbps
Width : 848 pixels
Height : 480 pixels
Display aspect ratio : 16/9
Frame rate : 23.976 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.092
Stream size : 148 MiB (87%)
Writing library : x264 core 60 r889bm 2c59717
cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=5 / brdo=0 / mixed_ref=0 / me_range=16 /
chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=3 / nr=0 / decimate=1 /
mbaff=0 / bframes=2 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / bime=1 / keyint=250 / keyint_min=25 /
scenecut=40(pre) / rc=2pass / bitrate=899 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=1.00 / qpmin=10 / qpmax=51
/ qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=2:1.00
....

It makes me very sad. This is a group that prides themselves on their "high quality" releases

Dark Shikari
26th December 2008, 20:33
A very prominent fansubber group, dattebayo:
...
It makes me very sad. This is a group that prides themselves on their "high quality" releasesIf by "prominent", you mean "prominent troll", yes. :p

qyot27
26th December 2008, 20:42
1/ avc stream extraction from the AVI file.
2/ avc stream remux into an MP4 file.
I meant more along the lines of the way fixes for ASP are described - removal of N-VOPs and whatnot, and whether the structure is realigned to compensate for the hacking necessary to put the streams into AVI in the first place. Unless of course it's even worse than that (in terms of 'adjusting' so that AVI can deal with those features) and there are no structure misalignments and the streams just get shoehorned in.


As for the whole dattebayo thing, I just don't know where to start on that. Encoding is not the only thing I take issue on there. But they were one of the ones I had in mind when I said I'd seen H.264-AVI releases.

Comatose
26th December 2008, 21:03
RunningSkittle, I've always believed that DB uses AVI to deal with stupidity.

They switched from ASP to AVC without changing the file extension, so none of the stupid leechers went "?????!!!!!!!!". See my previous post in this thread :P
If you post an AVI and a MKV or MP4, the AVI almost always gets tons more downloads. (even if the contents of the file (AVC, ASP or whatever) aren't specified in the file name)

RunningSkittle
26th December 2008, 21:09
Troll? Yes... but unless i go and learn japenese (I should)... im stuck with it as I need my weekly fix of naruto. No manga this week :(

We will also not release it in MP4, MKV, OGM, or any other retarded format you might think is "superior", "more supported" (lol), etc.

The manga is better anyway

Guest
26th December 2008, 21:11
Closing thread as it has degenerated into a discussion of fansubs and release groups, which is not allowed per rule 6.