VideoDecoder h.264 acceleration

97 views
Skip to first unread message

andrewja...@gmail.com

unread,
May 11, 2016, 12:16:42 PM5/11/16
to Native-Client-Discuss
Hi all,

I have been working on this issue now for some time, and hope that someone can help.  I am trying to use the pp::VideoDecoder API in hardware accelerated mode (PP_HARDWAREACCELERATION_ONLY) in a pnacl application - I already have it working well with PP_HARDWAREACCELERATION_WITHFALLBACK, however it always seems to fall back to SW mode on.

On Windows, with PP_HARDWAREACCELERATION_ONLY set everything works as expected - I have hardware accelerated h.264 decode working perfectly on every machine I have tried.  I am supplying the Decode() call with complete start-code prefixed (AnnexB) NALs.

On Linux, OS X and ChromeOS, the Decode call returns PP_ERROR_RESOURCE_FAILED after ingest of anywhere between 5 and 15 NALs, and no decoded frames are ever returned.  I have read in other posts that OS X in particular has some requirements for supplying the SPS/PPS NALs together with the first I-Frame/IDR.  I have tried this approach and it doesn't seem to make any difference - Windows again is fine with these NALs delivered in a single Decode call.  Are there other datastream requirements to get this to work on all platforms?  And if anyone knows of any other documentation on this it would be much appreciated.


Thanks,

Andrew

Bill Budge

unread,
May 12, 2016, 2:17:47 PM5/12/16
to Native-Client-Discuss
Hi Andrew,

VideoDecoder is a fairly low level API, requiring the plugin to demux the video stream. There are plenty of things that can go wrong if the data isn't demuxed properly.

In theory, any video that plays in Chrome should be playable by a plugin, so the first thing to try is to play a video normally in Chrome. I think H264 should be hardware accelerated on all platforms. Note that chromium can't play H264.

If you can set up a website with your app, plugin and video, I can try to help you debug this.

andrewja...@gmail.com

unread,
May 16, 2016, 9:05:41 AM5/16/16
to Native-Client-Discuss
Hi Bill,

Thanks for the reply - I have tried the same h.264 content in an mp4 container and this plays back accelerated in Chrome on OS X and Chromebook.

Now I know this should work I'll look at my h.264 demux again - I'm sure this must be where the problem lies.  If I don't get anywhere with that I'll make the pnacl app and a clip of input video available on a website - I'll need to break out the video decode to a separate app before I can make this public.


Thanks again,

Andrew
Reply all
Reply to author
Forward
0 new messages