Log in

View Full Version : Misadventures of H264


weaver4
7th March 2010, 21:14
About a year ago I decided that it was time to stop using ASP and start using AVC. It did not take me long to decide to use X264 as the encoder.

My trip has not been smooth. I found that content that was encoded to play on my pc would not play on the mac. I found it was difficult to encode content that would play on the XBMC, PC and my Popcorn Hour A-100. I found that the MKV container is not supported out-of-the box for the PC. I found that mp4 has audio sync problems on various hardware including my WD-TV-live box. I found that many of my videos that play just fine on my netbook using ASP do not play without very serious suttering on my netbook because by netbook does not have the horsepower needed to decode H264.

Just yesterday I found that several of my mp4 that I made a year ago using Ripbot264 do not play on my popcorn hour A-100 without serious pixelation. These videos use to work just fine; I would guess it was some update to my PCH A-100 firmware.

I don't remember having these issues using ASP. I would give credit to DivX for standardizing hardware which in-turn drove the software tools. I would rate portability of AVC as very poor compared to ASP.

I generally encode x264 with a crf=21/22; and I have found that xvid with a drf=3 is about equal quality but the filesizes are 30% larger. I can live with 30% larger for better portability.

I am thinking that I may go back to ASP in a avi container for my content. But I wanted to find out if others were having the same difficulty or if others found the perfect way to encode so that it will play on anything.

Thoughts would be appreciated.

Dark Shikari
7th March 2010, 21:19
I don't remember having these issues using ASP. I would give credit to DivX for standardizing hardware which in-turn drove the software tools. I would rate portable of AVC as very poor compared to ASP.Most hardware still only supports a very tiny grab-bag of ASP features, a grab-bag which isn't listed in any MPEG standard. Go encode a video file with Xvid and odds are, it won't work, because you have to turn off Qpel, turn off more than 1 B-frame, turn off GMC, and so forth. Of course this is completely ignoring the mess of packed bitstream, VBR audio in AVI, etc, etc. It's such a mess that Virtualdub requires Xvid-specific hacks to avoid losing frames at the end of the file when encoding.

By comparison, any High Profile Level 4.1 video will work on practically any device that claims to support it.I found that the MKV container is not supported out-of-the box for the PC. Neither is MPEG-4 ASP.I found that mp4 has audio sync problems on various hardware including my WD-TV-live box.Certainly no less than AVI. AVI is a sync disaster; it doesn't even have timestamps at all, make sync completely impossible with any sort of variable framerate content. Like, say, a large portion of all DVDs.I found that many of my videos that play just fine on my netbook using ASP do not play without very serious suttering on my netbook because by netbook does not have the horsepower needed to decode H264.If your netbook is worth anything, it comes with a graphics card that does the decoding for you. Turn it on.

The primary reason people have problems with H.264 isn't because it has compatibility issues or because it's "messier", but simply because they're used to the utter disaster that ASP was, and it takes getting used to something that's different, even if it has far fewer issues--because they're new, different issues from before.

By the way, if you want help with your problems, phrase them in the form of a question, not a whine.

nurbs
7th March 2010, 21:29
I also have a WD TV and my MKV files with H.264, AAC and SUB work fine. Support is probably going to get better in the future considering that all recent mobiles and graphics cards have some sort of hardware assisted decoding and with DivX using MKV now support for that container should become more common.

I guess most problems people have with H.264 are either the file exceeding HP@L4.1 (too many refs), file being labeled with a level > 4.1 and the decoder not actually checking the content (common with older x264 revisions) and more recently, but not very common, faulty decoder hardware that doesn't play nice with --weightp 2.

weaver4
7th March 2010, 22:59
Actually my windows 7 pc plays every *.avi properly right "out of the box", MKV files it does not.

Most netbooks run the Intel Navy Pier chipsets. I don't believe that this chipset supports hardware decoding for H264.

No whining, simply a statement, thought it might be useful for those thinking of making the change from asp to avc. Particularly if they are going to play mp4's on various hardware.

Dark Shikari
7th March 2010, 23:04
Actually my windows 7 pc plays every *.avi properly right "out of the box", MKV files it does not.

No whining, simply a statement, thought it might be useful for those thinking of making the change from asp to avc. Particularly if they are going to play mp4's on various hardware.What are you complaining about, MKV, MP4, or H.264? Windows 7 plays H.264 MP4 files out of the box. Equally, it doesn't play ASP in MKV. This seems utterly unrelated to H.264 and at most a reason to complain to Microsoft about not supporting open media formats.

nurbs
7th March 2010, 23:21
Most netbooks run the Intel Navy Pier chipsets. I don't believe that this chipset supports hardware decoding for H264.
No. It uses an Intel GMA 950. That's a five year old budget graphics chip. H.264 hardware decoding wasn't very common back then.

The current graphics chips of the three major manufacturers all support H.264 decoding. For netbooks you could use an nVidia ION chipset which can decode 1080p. The ARM chipsets used in mobile phones and such are also moving into that area.

Blue_MiSfit
8th March 2010, 03:29
There isn't really a clear problem or answer in this thread IMO :)

If you're switching from ASP to H.264, FANTASTIC! H.264 is so much better when it comes to compression efficiency!

However, if your netbook can't smoothly decode (for example) high profile @ level 3.1 H.264, then you can try a few things to smooth the process along:

1) If you don't have a DXVA capable GPU, use an optimized software decoder like CoreAVC, DiAVC, ffdshow's ffmpeg-mt, DivX H.264, or whatever.
2) Limit other post-processing, and play with various renderers to see what combination nets you the best performance
3) When doing encode, use VBV to conform to L3.1 specs
4) Disable CABAC. This hurts, because CABAC is such a huge compression advantage, but often this makes all the difference when decoding on slow systems

Does it REALLY matter what splitters / decoders come with a given operating system? Who cares... :) 3rd party alternatives are almost always better!

When I transcode video for my iPhone (2G), I simply use --crf 20 and level 3.1 vbv specs, with --preset ultrafast. I can do transcodes at ~400fps in cases like these, and the resulting files look fine on the iPhone. Obviously that's not how most folks encode video, but it's a fast, simple way to get smooth playback on a somewhat limited platform.

The bottom line is that in 95% of cases, x264 will destroy Xvid, even when gimped to give adequate decode performance on slow CPUs.

Oh, and next time you buy a system with a CPU equivalent to a slow Pentium 4 (or worse), and want to play H.264 on it, make sure it has a DXVA compatible GPU, so all this mess goes away.

~MiSfit

TEB
8th March 2010, 09:01
As the people over said, this is a combination of lack of mkv support and the fact that h.264 plain an simple needs more cpu cycles to fully decode. To get the benefits of the aforementioned Helper/offloader ideas (dxva, gpu decode and so on) u need a graphics card that supports it and drives that support the functions.
So my suggestion is:
1. Install the newest w7 drivers from intel.com for the gma 950
2. Install a easy and good player eg. Splash from mirillis or Media player classic home cinema

http://mirillis.com/splash.html.
http://forum.doom9.org/showthread.php?t=123537&page=611

PS! Im sitting here and watching 4.1 profile h.264 / mkv 1080p24 30mbit content on my gma950 as we speak (lenovo x61)

my 2 cents,,
te

audyovydeo
8th March 2010, 09:46
To quote a medieval proverb :

"The great thing about standards is that there are so many to choose from"


I tend to agree with the threat starter : while H.264 (as implemented in x264) is attractive insofar as it represents the top-of-the-line in video compression technology, it is still far from ubiquitous. And of course, as of today, portability is still MPEG2/DVD > ASP > AVC/Bluray.
And it's going to stay that way for another while.

This is why it has always seemed senseless to me to re-encode a DVD to any other format.
My own videos for distrib ? H.264 -- to whatever profile/level my target users need.


my 2 (€) cents ...
audyovydeo

poisondeathray
8th March 2010, 18:12
I tend to agree with the threat starter : while H.264 (as implemented in x264) is attractive insofar as it represents the top-of-the-line in video compression technology, it is still far from ubiquitous. And of course, as of today, portability is still MPEG2/DVD > ASP > AVC/Bluray.
And it's going to stay that way for another while.


maybe the choice of words were not quite precise

for portability, don't you think carrying an ipod / iphone or psp, etc.. is better than carrying a dvd player (even a portable one) ?

Manao
8th March 2010, 18:52
And of course, as of today, portability is still MPEG2/DVD > ASP > AVC/Bluray.I disagree. Mpeg2 > AVC > ASP. ASP was and always will be a codec for hackers, and was completely shunted by content providers. Meanwhile, everybody in the industry is switching from Mpeg2 to AVC, and so are users.

Astrophizz
8th March 2010, 22:19
maybe the choice of words were not quite precise

for portability, don't you think carrying an ipod / iphone or psp, etc.. is better than carrying a dvd player (even a portable one) ?

He was speaking of portability of the codec, not portability of the device.

cogman
9th March 2010, 02:52
You know what I hate? People who use the terms MKV, H.264, and x264 interchangeably.

MKV != H.264 != x264, they are different things. Just because your Win7 computer can't read an MKV doesn't mean it can't decode H.264 video out of the box (it can in fact). As well, MKVs support numerous (pretty much all that I can think of) video formats.

the other irritation is people that say "This is an x.264 decoder". No, it is not, there is no such thing as an x.264 decoder.

Wait, this isn't a whining thread, I digress then. The H.264 standard is pretty amazing, x264 just goes to show what amazing things can be accomplished from it.

weaver4
9th March 2010, 17:26
What are you complaining about, MKV, MP4, or H.264? Windows 7 plays H.264 MP4 files out of the box. Equally, it doesn't play ASP in MKV. This seems utterly unrelated to H.264 and at most a reason to complain to Microsoft about not supporting open media formats.

MKV is a common container for H.264 it is not a common container for ASP. So, IMO, the fact the MKV does not play on Win7 "out-of-the-box" adds to the frustration of H.264.

evilr00t
9th March 2010, 18:17
MKV is a common container for H.264 it is not a common container for ASP. So, IMO, the fact the MKV does not play on Win7 "out-of-the-box" adds to the frustration of H.264.

Hmm I now mux MPEG-4 part 2 in MKVs, because MPEG-4 part 2 with B frames is an ugly hack in AVI containers.

Not supporting MKV out of the box is a Windows problem, not a H.264 problem.

In any case, either of the two codecs can be muxed into a MP4 container, solving the w7 doesn't support mkv problem.

roozhou
9th March 2010, 18:25
Hmm I now mux MPEG-4 part 2 in MKVs, because MPEG-4 part 2 with B frames is an ugly hack in AVI containers.

Ugly for what?

evilr00t
9th March 2010, 18:50
Ugly for what?

B frames in AVI gives you packed bitstream hell (and produces noncompliant streams), or problems with decoder lag, caused by the incorrect assumption that one frame in = one frame out, in AVI. B frames need I/P frames that must be decoded first before the B frame can be decoded.

In particular, shoehorning AVC into AVI (using x264-vfw) results in out of order playback (like Bob() with the wrong Assume?FF()); when using MPC-HC's hardware acceleration. Since there aren't any hardware decoders for MPEG-4 part 2, I don't know if the same could be said for that, but possible.

sneaker_ger
9th March 2010, 22:48
Since there aren't any hardware decoders for MPEG-4 part 2

Newer Nvidia cards have a decoder for it. Though I haven't seen any software that makes use of it.
Sadly MPC-HC's internal ASP decoder is broken for ASP-in-MKV.

LoRd_MuldeR
9th March 2010, 23:16
Newer Nvidia cards have a decoder for it. Though I haven't seen any software that makes use of it.

Probably because only VP4 supports MPEG-4 ASP decoding. And VP4 is only available via GT215, GT216 and GT218 so far.

This excludes the famous GeForce GTX/GTS 2xx series as well as all the many GeForce 9xxx models...

weaver4
9th March 2010, 23:48
Not supporting MKV out of the box is a Windows problem, not a H.264 problem.


True, but it still adds to the customer frustration problem of using H.264; and that was the premise of my initial post.

cogman
10th March 2010, 01:40
True, but it still adds to the customer frustration problem of using H.264; and that was the premise of my initial post.

What customer? AFAIK nobody/almost nobody distributes video media in the MKV container. MP4 is a more popular consumer media container, and it is supported by Win7. If you've used an MKV to mux your media, they you will know that you need a splitter (or at very least how to mux your media into a MP4 container).

H.264 is not MKV and MKV is not H.264. Trying to claim that ASP is more portable is ridiculous. As dark has already pointed out, the support for ASP across the board was spotty at best. At least with the H.264 most devices that say they are Baseline compliant are baseline compliant.

audyovydeo
10th March 2010, 10:19
the support for ASP across the board was spotty at best.


I contest that. When 100% of desktop players support have been playing back DivX + xvid media for almost 10 years, you simply cannot say that ASP support is spotty.

Try calculating the % of players on the market supporting Blu-Ray and AVCHD (forget MKV for simplicity).

Of course a computer will play back just about anything, but that's not what I mean by portability.

Hence my claim MPEG2/DVD > ASP > AVC/BluRay

cheers
a/v

smok3
10th March 2010, 11:39
a $100 standalone device (http://www.walmart.com/ip/Western-Digital-WDTV-HD-1080P-High-Def-Media-Player/10779069)can playback dvxa compatible 720p mkv file with embedded unicode subtitles just fine, i don't recall such devices from ASP days, so whats the question/deal/claim here?

audyovydeo
10th March 2010, 11:57
so whats the question/deal/claim here?


the claim is that, as of today, if I walk into a crowded street and want to hand out my video to The People, I gotta give out DVD (with MPEG2 or ASP), not anything else, if I want to maximise my audience.

Of course, alternatively, I'd put it on YouTube, but that's another story.

cheers
a/v

Gusar
10th March 2010, 11:59
Newer Nvidia cards have a decoder for it. Though I haven't seen any software that makes use of it.
Wow, Linux is actually ahead of Windows in this area. MPlayer on Linux (and probably other players too) has full support for hardware ASP decoding via VDPAU.

AnonCrow
10th March 2010, 13:39
I contest that. When 100% of desktop players support have been playing back DivX + xvid media for almost 10 years, you simply cannot say that ASP support is spotty.

The point was that out-of-the-box, you need to install codecs or 3rd party players to accomplish that. Only WMP 12 (/w Windows 7) plays H.264 , DivX and Xvid without needing to install anything extra.

If you include trial versions of eg. PowerDVD shipped with many systems - it integrated DivX mpeg4 ASP in Jan 2003, while support for H.264 was added in 2006.

weaver4
10th March 2010, 17:22
What customer? AFAIK nobody/almost nobody distributes video media in the MKV container. MP4 is a more popular consumer media container, and it is supported by Win7. If you've used an MKV to mux your media, they you will know that you need a splitter (or at very least how to mux your media into a MP4 container).

H.264 is not MKV and MKV is not H.264. Trying to claim that ASP is more portable is ridiculous. As dark has already pointed out, the support for ASP across the board was spotty at best. At least with the H.264 most devices that say they are Baseline compliant are baseline compliant.

MP4 is more popular, but there is a lot of MKVs on the bit torrents...I am told. DivX Plus uses MKVs. I know that MKV is a container...but it's most popular use is to to contain H.264.

ASP is much more portable (IMO). 100's of devices that are DivX Theater Profile compatible. But on the other hand:

iPhones, iPods -- MP@L3
Apple TV -- MP@L3
PlayStation -- MP@L3?
XBOX -- HP@L4.0
PopCornHour -- HP@L4.1
WD TV Live -- HP@L4.1

What do you encode to? MP@L3 will play on most everything but looks bad (compared to HP@L4.1).

weaver4
10th March 2010, 17:27
a $100 standalone device (http://www.walmart.com/ip/Western-Digital-WDTV-HD-1080P-High-Def-Media-Player/10779069)can playback dvxa compatible 720p mkv file with embedded unicode subtitles just fine, i don't recall such devices from ASP days, so whats the question/deal/claim here?

There were/are many DVD/DivX players on the market. Some of them had USB ports so a USB drive could be plugged in and used to play DivX movies. Pricing started at $38 (for a Philips unit; model number I forget).

All of these H-264 media players also play ASP/AVI/DivX/XviD content as well.

nurbs
10th March 2010, 17:33
Main profile isn't that much worse than high profile, but of course the limited resolution with L3.0 is a problem. When you can use L3.1 with a 720p resolution you don't actually lose too much detail compared to the blu-ray source since a lot of them are lowpassed anyway.

Some of the devices you listed (iPhone 3GS, iPod touch, Apple TV) can play high profile and higher resolution content as well if you can be bothered to circumvent iTunes to get the files on them. Personally I wouldn't bother though.

Currently the devices seem to be going either baseline or high. I recently read announcements about PMPs (like Archos 5, but smaller) and even cell phones with HDMI out that can decode high profile content. I can't remember the level, but it was at least 3.1, if not 4.0 or even 4.1.

fields_g
10th March 2010, 19:59
the claim is that, as of today, if I walk into a crowded street and want to hand out my video to The People, I gotta give out DVD (with MPEG2 or ASP), not anything else, if I want to maximise my audience.

Of course, alternatively, I'd put it on YouTube, but that's another story.

cheers
a/v
If I were going to walk down the street an throw media at someone and expect them to play it I would encode in H.264, baseline l3.0, in an mp4 container.

Flash does have an almost 98% install base, therefore a safe bet that it is installed. You can just create an autorun html file that will use flash 9.0115.0 or later and jwplayer to play the file.

Don't like autorun.... add step to click on the html file.
Don't like flash... click on the mp4 file directly and open using any codec and/or player you choose to use that you installed.
Not targeted for a computer system... copy the mp4 file to your device. Most devices should be able to read that file.
Don't like the quality of baseline l3.0.... add a second version to the media with whatever settings you choose knowing that that file will be less compatible.

Oh yea...instead of a cd/dvd/flash drive, you can do this all on a webserver also.

Universal. Cross-platform/Cross-device/Cross-media

Dark Shikari
10th March 2010, 20:05
iPhones, iPods -- MP@L3
Apple TV -- MP@L3
PlayStation -- MP@L3?
XBOX -- HP@L4.0
PopCornHour -- HP@L4.1
WD TV Live -- HP@L4.1

What do you encode to? MP@L3 will play on most everything but looks bad (compared to HP@L4.1).Xbox, Playstation 3, Popcorn Hour, and WDTV can all play HP@L4.1.

AppleTV is a joke and nobody uses it (it also cannot play Main Profile streams, it's broken with weighted prediction). Furthermore, it can play High Profile features just fine; its limitations are software ones, not hardware. It's not a dedicated device, but rather just a mini computer with a crappy CPU.

iPods/iPhones are mobile devices. Do you really expect them to play the same 1080p video streams as an Xbox? You are really trying hard to contrive incompatibilities here: if I encode a 1080p MPEG-4 ASP stream, it won't play on an iPod either.

weaver4
10th March 2010, 22:58
Xbox, Playstation 3, Popcorn Hour, and WDTV can all play HP@L4.1.

AppleTV is a joke and nobody uses it (it also cannot play Main Profile streams, it's broken with weighted prediction). Furthermore, it can play High Profile features just fine; its limitations are software ones, not hardware. It's not a dedicated device, but rather just a mini computer with a crappy CPU.

iPods/iPhones are mobile devices. Do you really expect them to play the same 1080p video streams as an Xbox? You are really trying hard to contrive incompatibilities here: if I encode a 1080p MPEG-4 ASP stream, it won't play on an iPod either.


Either the author of RipBot264 or Staxrip (don't remember which one) said they changed their encoding to L4.0 instead of L4.1 because of problems on the XBOX.

I think you are right...If you ignore Apple all together then it clears the situation up considerably. HP@L4.1 (or HP@L4.0) meets the needs of most set-top boxes, gaming consoles, and computers.

RNiK
12th March 2010, 16:43
I found that the MKV container is not supported out-of-the box for the PC.
Well, you know: PDF files are "not supported out-of-the-box"; DOC/XLS/PPS files are "not supported out-of-the-box"; RAR/7z files are "not supported out-of-the-box".So, it's not really an H264/MKV problem and, to be honest, it's not really a problem at all. :o

weaver4
12th March 2010, 20:01
My point was that AVI's are supported and that is what I was comparing it to. I would not say that needing to download Adobe Reader to open PDFs very convenient either.