GNOME Bugzilla – Bug 704734
video decoding via tsdemux returns error with gst-vaapi 1.0
Last modified: 2013-08-29 17:38:58 UTC
Decoding mpeg ts clips fail with gstreamer-vaapi 0.5.4 (with gstreamer 1.0.7) with following error returned: [root@localhost ~]# gst-launch-1.0 --gst-debug-level=2 -v filesrc location= /home/btay1/Videos/ MPEG2_MP@HL_1920x1080_14.7Mbps_29.97fps_4-3_Progressive_Sound_Strategic.ts ! tsdemux ! queue ! vaapidecode ! vaapisink libva info: VA-API version 0.34.0 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib/dri/i965_drv_video.so libva info: Found init function __vaDriverInit_0_34 libva info: va_openDriver() returns 0 Setting pipeline to PAUSED ... Pipeline is PREROLLING ... 0:00:00.069412551 4555 0x87c9690 WARN tsdemux tsdemux.c:933:create_pad_for_stream: AC3 stream type found but no corresponding descriptor to differentiate between AC3 and EAC3. Assuming plain AC3. 0:00:00.070047879 4555 0x87c9690 WARN mpegtsbase mpegtsbase.c:548:mpegts_base_program_add_stream: Stream already present ! 0:00:00.072547098 4555 0x87c9690 WARN mpegtsbase mpegtsbase.c:1646:mpegts_base_loop:<tsdemux0> error: Internal data stream error. 0:00:00.072818802 4555 0x87c9690 WARN mpegtsbase mpegtsbase.c:1646:mpegts_base_loop:<tsdemux0> error: stream stopped, reason not-negotiated ERROR: from element /GstPipeline:pipeline0/GstTSDemux:tsdemux0: Internal data stream error. ** (gst-launch-1.0:4555): CRITICAL **: gst_vaapi_decoder_flush: assertion `decoder != NULL' failed 0:00:00.073745467 4555 0x87c96f0 ERROR vaapidecode gstvaapidecode.c:429:gst_vaapidecode_finish: failed to flush decoder (status 11) Additional debug info: mpegtsbase.c(1646): mpegts_base_loop (): /GstPipeline:pipeline0/GstTSDemux:tsdemux0: stream stopped, reason not-negotiated ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... Freeing pipeline ...
It seems that the following patch will fix the error, however I do not have enough knowledge at this moment if this patch is proper. I am hoping this will rather trigger a discussion on the reported error. diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index e91bbdd..890ce1b 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -773,12 +773,6 @@ gst_vaapidecode_ensure_allowed_caps(GstVaapiDecode *decode) if (!structure) continue; gst_structure_remove_field(structure, "profile"); - gst_structure_set( - structure, - "width", GST_TYPE_INT_RANGE, 1, G_MAXINT, - "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, - NULL - ); decode->allowed_caps = gst_caps_merge_structure(decode->allowed_caps, structure); }
(In reply to comment #0) > Decoding mpeg ts clips fail with gstreamer-vaapi 0.5.4 (with gstreamer 1.0.7) > with following error returned: > > [root@localhost ~]# gst-launch-1.0 --gst-debug-level=2 -v filesrc location= > /home/btay1/Videos/ > MPEG2_MP@HL_1920x1080_14.7Mbps_29.97fps_4-3_Progressive_Sound_Strategic.ts ! > tsdemux ! queue ! vaapidecode ! vaapisink Nowadays (GStreamer >= 1.0.x), decoders should require a video parser element first before the decoder in the pipeline. Besides, this will also enable future optimizations. i.e. tsdemux ! mpegvideoparse ! vaapidecode ! vaapisink will normally work, and this is what playbin/decodebin generates.
Having said that, vaapidecode is probably missing a parsed=true in the GstCaps for mpeg2.
(In reply to comment #2) > (In reply to comment #0) > > Decoding mpeg ts clips fail with gstreamer-vaapi 0.5.4 (with gstreamer 1.0.7) > > with following error returned: > > > > [root@localhost ~]# gst-launch-1.0 --gst-debug-level=2 -v filesrc location= > > /home/btay1/Videos/ > > MPEG2_MP@HL_1920x1080_14.7Mbps_29.97fps_4-3_Progressive_Sound_Strategic.ts ! > > tsdemux ! queue ! vaapidecode ! vaapisink > > Nowadays (GStreamer >= 1.0.x), decoders should require a video parser element > first before the decoder in the pipeline. Besides, this will also enable future > optimizations. i.e. tsdemux ! mpegvideoparse ! vaapidecode ! vaapisink will > normally work, and this is what playbin/decodebin generates. Adding mpegvideoparse, as suggested, resolved the issue without having to patch anything. Thanks.
Fixed in git master branch. The optimization I talked about will stick to GStreamer >= 1.2. So, properly handling that case for earlier versions is preferable. Thanks.
vaapidecode: remove extraneous size information from allowed caps. Fix _getcaps() implementation to not report codecs with size information filled in the returned caps. That's totally useless nowadays. Ideally, this is a hint to insert a video parser element, thus allowing future optimizations, but this is not a strict requirement for gstreamer-vaapi, which is able to parse the elementary bitstreams itself. https://bugzilla.gnome.org/show_bug.cgi?id=704734