Log in

View Full Version : [Problem] High 10 profile H.264: how to stop unsupporting decoders from opening it?


mandarinka
11th May 2011, 15:27
Support for decoding x264 encodes with 9/10 bitdepth has finally been merged into both libav and ffmpeg, which means the format is ready for practical use.

There's one problem with it however: older/other decoders that don't support high bitdpeth will happily accept these streams and produce an output with higher or lower degree of picture corruption. As far as I know, this is the case with CoreAVC 2.0 (both cuda and software mode) and libavcodec, with other decoders unlikely to behaving differently. While we can probably count on Corecodec adding support to the software decoder sometimes in the future (and hopefuly to patch the present decoders with profile checks that would prevent them from loading), I think it is more than reasonable to not expect every decoder vendor to make the necessary countermeassures.

(Take for example the many people that prefer to use gpu-based decoders. This unlucky bunch would need to disable their accelerated decoders every time they wanted to watch a high-bitdepth video, which would make the gpu decoder practicaly unusable if such content was encountered less than rarely.)

For that reason, I would like to request a discussion about possible ways to sort out this mess and make sure that only supporting AVC decoders will be used for playback in directshow players, VLC, MPlayer and others (with non-directshow players, libavcodec is almost universaly used, but the problem appears when there is vdpau/dxva decoding available). Ideally, it should be possible for supporting and unsupporting decoders to coexist on a system, with the supporting decoder being used for high bitdepth video even when the unsupporting decoder is the one with priority.

I’m not sure if there are other ways to do this, but for directshow environment, this could probably be realised by using a different mediatype for h264 streams above high profile (4:4:4 / 4:2:2 sampling comes to mind in addition to higher bitdepths). Demuxers would need to be changed to signal the new mediatype, similarly to how Haali splitter uses a custom mediatype to bypass MS’s MF decoders.
Downside of this hack is that it won't affect older installations. A solution that would work with current software present in the wild would be preferable, of course.

Please comment, or suggest alternatives.
If you are an author/vendor of a demuxer (matroska probably being the most important here with mp4 second), I’d like to humbly ask you to consider some scheme to this goal...

kieranrk
11th May 2011, 16:29
Patching mpc-hc to use software decoding for 10-bit files is trivial.

nevcairiel
11th May 2011, 16:34
My demuxer (LAV Splitter) will set the profile and level fields in the MPEG2VIDEOINFO struct in the media type appropriately, and a decoder could easily check on that to determine if its a High 10 profile and deny the connection if it is.

I do not know if other demuxers implement this profile field properly. Decoders will most likely not pay attention to it either.

The second possibility is decoding the SPS/PPS thats typically being send in the Media Type, and which does contain this information - and deny the connection based on that.

From my demuxer point of view, i think my deed is done.

PS:
My NVIDIA hardware decoder will also reject connections to files with an unsupported profile, but only if its set in the MPEG2VIDEOINFO. Parsing for the SPS/PPS will probably be added later to support demuxers that don't set the media type properly.

me7
21st May 2011, 14:40
Support for decoding x264 encodes with 9/10 bitdepth has finally been merged into both libav and ffmpeg, which means the format is ready for practical use.

How do I enable it? Do I need a special build of ffdshow?

Chikuzen
21st May 2011, 15:59
AFAIK, it is only lachs0r's mplayer2 builds that is supportting high-bit-depth avc decode.
http://forum.doom9.org/showpost.php?p=1501658&postcount=9

aegisofrime
21st May 2011, 16:28
AFAIK, it is only lachs0r's mplayer2 builds that is supportting high-bit-depth avc decode.
http://forum.doom9.org/showpost.php?p=1501658&postcount=9

That's great, I was looking for a High 10 player. However, is there a Windows GUI player available? Unless I'm missing something, mplayer2 seems CLI only, and I can't even seek with it...

Edit: Just found out for myself that one can just replace Mplayer.exe in Mulder's directory....

Dark Shikari
21st May 2011, 17:55
This is doubly important because 10-bit decoding asm is already ~half done -- 10-bit will be rolled out within the next month or two.