vaapih264enc+hlssink output not playable in browsers

Uwe Müller uwe at namez.de
Mon Dec 26 21:12:18 UTC 2016


Hello,

I'm trying to encode a videostream to h.264, mux it with mpegtsmux and
use hlssink to generate a hls stream. The resulting files should be
playable by all common used browsers (some using hlsjs). While this
works flawless with x264enc, the vaapi264enc output is not playable at
all as soon as a browser is involved. When using hlsjs to play, then the
library produces "mediaError" events with no futher information about
it. A hls capable browser like safari just displays a black picture (but
plays sound if there is any soundtrack).
I was able to narrow the problem down to the vaapih264enc-element by
creating gst-launch lines looking like this:

    gst-launch-1.0 videotestsrc ! [ENCODER] ! h264parse ! mpegtsmux !
hlssink

by placing "x264enc" as encoder, everything works as expected. Placing
"vaapih264enc" produces the described mediaError / black picture
problem. I tried a bunch of different properties of vaapih264enc, but no
combination changes anything.

Then I created yet another gst-launch line that uses ffmpeg's
"h264_vaapi" as encoder:

    gst-launch-1.0 -q videotestsrc ! 'video/x-raw' ! matroskamux !
filesink location=/dev/stdout \
        | ffmpeg -vaapi_device /dev/dri/renderD128 -i - -vf
'format=nv12,hwupload' -c:v h264_vaapi -f mpegts - \
        | gst-launch-1.0 filesrc location=/dev/stdin ! tsdemux !
mpegtsmux ! hlssink

When running this i can see a +60% usage in intel_gpu_top, so it does in
fact use the gpu and not cpu. The files created by this are playable on
all my tested devices.
I created a few seconds with the 3 commands and uploaded it to a
webserver, including a flowplayer and video-tag version for safari:
http://88.99.27.80/gstreamer-hls/

Tested on two different systems with the same results:
gstreamer 1.10.2 (pkg from debian sid), libva 1.7.1 on ubuntu 16.10
(i7-6700 Skylake with HD Graphics 530)
gstreamer 1.11.0 (GIT), libva 1.7.3 on archlinux (i7-3615QM IvyBridge
with HD Graphics 4000)

Is there anything wrong with my command or is there a problem in the
vaapi plugin?

 -Uwe



More information about the gstreamer-devel mailing list