After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 704734 - video decoding via tsdemux returns error with gst-vaapi 1.0
video decoding via tsdemux returns error with gst-vaapi 1.0
Status: RESOLVED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
0.5.4
Other Linux
: Normal major
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-07-23 09:34 UTC by boon.wooi.tay
Modified: 2013-08-29 17:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description boon.wooi.tay 2013-07-23 09:34:06 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 ...
Comment 1 boon.wooi.tay 2013-07-23 09:38:23 UTC
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);
     }
Comment 2 Gwenole Beauchesne 2013-07-23 11:15:22 UTC
(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.
Comment 3 Gwenole Beauchesne 2013-07-23 11:17:18 UTC
Having said that, vaapidecode is probably missing a parsed=true in the GstCaps for mpeg2.
Comment 4 boon.wooi.tay 2013-07-26 02:57:19 UTC
(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.
Comment 5 Gwenole Beauchesne 2013-08-29 17:38:46 UTC
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.
Comment 6 Gwenole Beauchesne 2013-08-29 17:38:58 UTC
    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