[Spice-devel] playbin can't detect vaapi decoder correctly when playing a video stream.

Victor Toso victortoso at redhat.com
Fri Aug 3 09:03:00 UTC 2018


Hi,

On Fri, Aug 03, 2018 at 11:20:52AM +0800, Qiu Wenbo wrote:
> I'm trying to turn on streaming video with H.264 codec
> manually. I have noticed spice-gtk will use playbin to decode
> the video stream with recent gstreamer.

Yes

> However,  playbin tends to use software decoder (avdec_h264) on
> my box (latest Archlinux running on an Intel i5-6500 PC with
> gstreamer-vaapi). When I remove gstreamer-libav, gstreamer
> complains like this and refuse to setup pipeline:

What is the output of
$ gst-inspect-1.0 | grep -i vaapi

Note that with --spice-debug enabled you should be seeing
something like

 | Spice-DEBUG: 10:52:22.453: channel-display-gst.c:696:
 | gstvideo_debug_available_decoders: From  15 video decoder elements,
 | 1 can handle caps image/jpeg: jpegdec

 | Spice-DEBUG: 10:52:22.453: channel-display-gst.c:696:
 | gstvideo_debug_available_decoders: From  15 video decoder elements,
 | 2 can handle caps video/x-vp8: vaapidecodebin, vp8dec

 | Spice-DEBUG: 10:52:22.453: channel-display-gst.c:696:
 | gstvideo_debug_available_decoders: From  15 video decoder elements,
 | 1 can handle caps video/x-h264: vaapidecodebin

 | Spice-DEBUG: 10:52:22.453: channel-display-gst.c:696:
 | gstvideo_debug_available_decoders: From  15 video decoder elements,
 | 2 can handle caps video/x-vp9: vaapidecodebin, vp9dec

This debug info is similar to running gst-inspect-1.0 and finding
the decoder elements per codec supported in spice-protocol

> 0:00:00.221423602 4816 0x7f24e40454a0 ERROR h264parse
> gsth264parse.c:2588:gst_h264_parse_set_caps: video/x-h264 caps without
> codec_data or stream-format
> 0:00:00.221548091 4816 0x7f24e40454a0 ERROR h264parse
> gsth264parse.c:2588:gst_h264_parse_set_caps: video/x-h264 caps without
> codec_data or stream-format

stream-format is not needed to play the stream and we lack a
way to set this info reliably in the procotol (the host is
hardcded to stream with byte-stream but could change, etc)

See https://gitlab.freedesktop.org/spice/spice-gtk/commit/c9129ed202b00f4

> 0:00:00.517686292 4816 0x7f24e40454a0 WARN decodebin
> gstdecodebin2.c:2514:connect_pad:<decodebin0> Couldn't set vaapidecodebin0
> to PAUSED
> 0:00:00.518742010 4816 0x7f24e40454a0 WARN decodebin
> gstdecodebin2.c:2339:connect_pad:<decodebin0> Element vaapidecode_h264-0
> does not accept caps
> 0:00:00.518908940 4816 0x7f24e40454a0 WARN uridecodebin
> gsturidecodebin.c:921:unknown_type_cb:<uridecodebin0> warning: No decoder
> available for type 'video/x-h264, pixel-aspect-ratio=(fraction)1/1,
> width=(int)1920, height=(int)1080, framerate=(fraction)30/1,
> interlace-mode=(string)progressive, chroma-format=(string)4:4:4,
> bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true,
> stream-format=(string)avc, alignment=(string)au, profile=(string)high-4:4:4,
> level=(string)5, codec_data=(buffer)01f40032ffe1001e67f400329184680780227e27016a02020280000003008000001e478c195001000468ce3192'.
> 0:00:00.518933285 4816 0x7f24e40454a0 WARN decodebin
> gstdecodebin2.c:4640:gst_decode_bin_expose:<decodebin0> error: no suitable
> plugins found:
> Couldn't set vaapidecodebin0 to PAUSEDElement vaapidecode_h264-0 does not
> accept caps

"No decoder available" and "No plugins found", that's why I asked
above questions. Besides having gstreamer1-vaapi, you need
suitable drivers to make vaapi work

> 0:00:00.518951522 4816 0x7f24e40454a0 WARN uridecodebin
> gsturidecodebin.c:988:no_more_pads_full:<uridecodebin0> error: no suitable
> plugins found:
> gstdecodebin2.c(4640): gst_decode_bin_expose ():
> /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
> no suitable plugins found:
> Couldn't set vaapidecodebin0 to PAUSEDElement vaapidecode_h264-0 does not
> accept caps
> 
> However, after install gstreamer-libav, the log shows playbin is using
> avdec_h264. Also, I can confirm playbin is using vaapih264dec when I
> manually change the encoder of spice-server from x264 to vaapih264enc.

Cheers,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180803/436e87c9/attachment.sig>


More information about the Spice-devel mailing list