Help forcing decodebin to output certain caps
gimmeamilk
gimmeamilkbttf at gmail.com
Thu Jan 10 13:14:05 PST 2013
Thanks Tim.
I was doing some experimentation using the API rather than gst-launch,
examining the pad caps in the "pad-added" signal. In the signal handler, if
I try to link the h264parse srcpad manually, it fails because at that stage
the srcpad caps is only avc, no byte-stream.
>From looking at the decodebin code, I think it checks the decodebin caps
property to see if it is a subset of the srcpad caps of the most downstream
element in the bin. If it is a subset, the autoplugging is finished, but it
does not actually set the srcpad caps to that subset. ie h264parse can
output avc or byte-stream, so the autoplug finishes because my byte-stream
requirement is indeed a subset of the srcpad caps. But decodebin does not
then instruct h264parse to actually use the subset caps. Is this a correct
understanding? Presumably it then defaults to avc because that's the first
one in the list?
I had wondered about plugging my own conversion element downstream like you
describe, but the problem is that ultimately I want to use this for several
video codecs that my sink can handle. So ideally I'd like to avoid having to
perform extra checks on the output of the decodebin, eg "if h264, add a
h264parse, if vc1 add xyz.." etc. Avoiding this kind of thing was my reason
for using decodebin in the first place.
How difficult would it be to change decodebin so that the srcpad caps of its
last element were actually those specified in the decodebin caps property?
Failing that, could the srcpad caps be left as the entire set for that
element, and the exact caps then be negotiated when I link the pad to my
sink pad. ie my decodebin has {avc,byte-stream} on its srcpad, allowing me
to link it to my byte-stream sink.
One other nasty option I'd considered is using a custom version h264parse
that only reports byte-stream, but this is obviously horrible.
Tim-Philipp Müller-2 wrote
> Ok, so:
>
> 1) uridecodebin in general outputs whatever it outputs. *Usually* you
> can't force it to output something it wouldn't output otherwise. You
> can, however, plug converters of some sort after it, followed by a
> capsfilter, which should force the converter to output to whatever
> format you need.
>
> 2) You can 'short-circuit' autoplugging inside uridecodebin/decodebin2
> via various signals, see gst-inspect uridecodebin . Using e.g. the
> autoplug-continue signal you can make it pass through video/x-h264 caps
> directly instead of trying to decode it.
>
> 3) ... ! h264parse ! video/x-h264,stream-format=byte-stream ! ... should
> do what you want (might also want to add alignment=au if you need one
> buffer per frame).
>
> Cheers
> -Tim
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at .freedesktop
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Help-forcing-decodebin-to-output-certain-caps-tp4657855p4657863.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list