GNOME Bugzilla – Bug 695879
mpegvideoparse: outputs incomplete caps with different mpegversion before outputting proper caps
Last modified: 2013-05-18 11:43:57 UTC
test pipeline: GST_DEBUG="*:3,mpegvideoparse:5,uridecodebin:5,decodebin:5" gst-launch-1.0 uridecodebin uri="file:///home/pi/test_mpeg2.ts" ! fakesink sync=true test file: http://live.mdragon.org/test_mpeg2.ts problem: tsdemu push mpegversion=2 down to mpegvideoparse but mpegvideoparse provide mpegvideoparse=1 on src caps problem is in function gst_mpegv_parse_update_src_caps as gst_caps_set_simple (caps, "mpegversion", G_TYPE_INT, (mpvparse->config_flags & FLAG_MPEG2) ? 2 : 1, NULL); set mpeg version base on internal state of mpegvideoparse (mpvparse->config_flags & FLAG_MPEG2 == 0) => mpegversion=1 my fix: static gboolean gst_mpegv_parse_set_caps (GstBaseParse * parse, GstCaps * caps) if((value = gst_structure_get_value(s, "mpegversion")) != NULL){ gint mpegversion = g_value_get_int( value ); if(mpegversion == 2){ mpvparse->config_flags |= FLAG_MPEG2; mpvparse->update_caps = TRUE; } }
this problem is related to mpeg2 decoder that expect mpegversion==2 for example gst-omx mpeg2
The bug is that the decoder is not accepting mpegversion=1. See, for example, avdec_mpeg2video.
I hope that is why caps was designed. to properly set up pipeline and capabilities I don't have mpeg 1/2 all in one decoder. and mpegvideoparse have src/sink mpegversion[1, 2] And in caps unverse it mean OR (mpegversion==1 or mpegversion==2) if I understand it right
commit 9da6ee87273d5930f400e28717cb768ac18eeffa Author: Tim-Philipp Müller <tim@centricular.net> Date: Sat Mar 16 13:20:27 2013 +0000 omxmpeg2dec: mpeg-2 decoder should be able to handle mpeg-1 too https://bugzilla.gnome.org/show_bug.cgi?id=695879 IMHO it's still a bug that mpegvideoparse outputs incomplete caps though (no height/width, for one), so re-assigning to mpegvideoparse.
mpegvideoparse output only mpegversion=1 caps
Not here. But it outputs caps with mpegversion=1 first, which is what decodebin/playbin will use to select a decoder. Strangely enough there even seems to be something racy going on, since it varies from run to run: $ gst-launch-1.0 uridecodebin uri=file:///home/tpm/samples/misc/695879-test_mpeg2.ts ! fakesink -v | grep mpegvparse | grep src mpegvparse0:src: caps = video/mpeg, mpegversion=(int)1, systemstream=(boolean)false, parsed=(boolean)true mpegvparse0:src: caps = video/mpeg, mpegversion=(int)2, systemstream=(boolean)false, parsed=(boolean)true, width=(int)720, height=(int)576, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)64/45, codec_data=(buffer)000001b32d0..., profile=(string)main, level=(string)main, interlace-mode=(string)mixed $ gst-launch-1.0 uridecodebin uri=file:///home/tpm/samples/misc/695879-test_mpeg2.ts ! fakesink -v | grep mpegvparse | grep src mpegvparse0:src: caps = video/mpeg, mpegversion=(int)1, systemstream=(boolean)false, parsed=(boolean)true mpegvparse0:src: caps = video/mpeg, mpegversion=(int)2, systemstream=(boolean)false, parsed=(boolean)true, width=(int)720, height=(int)576, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)64/45, codec_data=(buffer)000001b32d0..., profile=(string)main, level=(string)main, interlace-mode=(string)mixed $ gst-launch-1.0 uridecodebin uri=file:///home/tpm/samples/misc/695879-test_mpeg2.ts ! fakesink -v | grep mpegvparse | grep src mpegvparse0:src: caps = video/mpeg, mpegversion=(int)1, systemstream=(boolean)false, parsed=(boolean)true $ gst-launch-1.0 uridecodebin uri=file:///home/tpm/samples/misc/695879-test_mpeg2.ts ! fakesink -v | grep mpegvparse | grep src mpegvparse0:src: caps = video/mpeg, mpegversion=(int)1, systemstream=(boolean)false, parsed=(boolean)true mpegvparse0:src: caps = video/mpeg, mpegversion=(int)2, systemstream=(boolean)false, parsed=(boolean)true, width=(int)720, height=(int)576, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)64/45, codec_data=(buffer)000001b32d0..., profile=(string)main, level=(string)main, interlace-mode=(string)mixed
it generate src caps base on this (from source files) gst_caps_set_simple (caps, "mpegversion", G_TYPE_INT, (mpvparse->config_flags & FLAG_MPEG2) ? 2 : 1, NULL);
commit f1a6d84a6c4595a94c5654131a74b6a979f53a04 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Wed May 1 17:36:47 2013 +0100 mpegvideoparse: don't announce incomplete source caps Don't send any source caps yet if we're still in drop-buffers-until-we-get-a-sequence-header mode. Fixes transmuxing of many MPEG-TS/PS streams into formats which require things like width, height or codec_data on the input caps. Also fixes issues when using playbin with decoder sinks that want width/height etc. https://bugzilla.gnome.org/show_bug.cgi?id=695879