Using GPU to decode video on Android

Matthew Waters ystreet00 at gmail.com
Fri Jan 20 12:27:09 UTC 2017


On 20/01/17 03:12, ivan-perez wrote:
> Hello
>
> I'm receiving on my Android mobile phone a video via RTP/UDP, but I've seen
> that CPU usage is very high, nearly 100% of one core is being used to decode
> the video. On high-end devices the video is played smoothly, but on middle
> and low-end devices I barely get 1 frame per second.
>
> This is my pipeline:
>
> udpsrc port=5004
> caps=application/x-rtp,payload=96,clock-rate=90000,encoding-name=H264 \
>     ! rtpjitterbuffer drop-on-latency=true max-dropout-time=500 \
>     ! rtph264depay \
>     !
> video/x-h264,width=480,height=360,framerate=30/1,profile=baseline,stream-format=avc,alignment=au \

This caps filter shouldn't be needed and may be causing the h264
bitstream to be converted from byte-stream to avc and back to byte-stream.

>     ! h264parse \
>     ! decodebin \
>     ! videoconvert \
>     ! autovideosink
> And this one is the pipeline on the server side (in this case I'm using a
> Raspberry):
>
> gst-launch-1.0 -e -v fdsrc \
>   !
> video/x-h264,width=480,height=360,framerate=30/1,profile=baseline,stream-format=avc,alignment=au
> \

These h264/avc caps are missing the codec_data field.

>   ! h264parse \
>   ! rtph264pay \
>       config-interval=1 \
>       pt=96 \
>   ! udpsink \
>       sync=false \
>       host=192.168.1.5 \
>       port=5004 \
>       bind-address=192.168.1.2 \
>       bind-port=5004
>
> I think that this can be fixed if I could use GPU decoding instead of
> software decoding, but I haven't found any information about it on the docs.
>
> So my question is: How can I decode a H264 video (or whatever other format,
> I don't mind to use another one if I get better results) using hardware
> acceleration on Android?

Using decodebin will automatically use the available hardware decoders
if they are available.

Perhaps you mean though, zerocopy through to display which requires
extra code in the decodebin ! glimagesink case that playbin contains. 
Specifically, the autoplug-query signal needs to implemented for the
caps and context queries between decodebin and glimagesink.

Cheers
-Matt

> Thanks!
>
> Kind regards.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 516 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170120/6c0ae1d2/attachment.sig>


More information about the gstreamer-devel mailing list