[gst-devel] Finding out resolution of video of input file using decodebin2?

Alberto Vigata alberto at nelalabs.com
Thu Jun 17 00:48:22 CEST 2010


Dear gstreamer experts,

I need to find out the resolution of the video in my input file, and
in general characteristics of my input streams for later use, like
audio sampling frequency, audio channels and the like. I need this
information to setup some stuff before I can continue building my
pipeline.

My original though was to wait for the 'new-decoded-pad' signal coming
out of decodebin2 but from what I'm seeing, while decodebin2 generates
a pad for every stream it finds the caps of the pad only have the main
decoded format and not other stuff like resolutions or framerates.
Usually decoded video pads come out with caps="video/x-raw-rgb;
video/x-raw-yuv" and decoded audio pads with caps ="audio/x-raw-int,
channels=(int)[ 1, 2 ] ...".  they are not fixed caps.

It does seem though, that precise information about the streams is
available using the 'autoplug-select' signal as this is generating the
actual encoded stream pads for decoding. Inspecting the caps coming
out of 'autoplug-select' one can retrieve precise info of the streams
in the input. Sadly, the pads exposed with 'autoplug-select' are not
the final decoded pads from before so I don't see an easy way to
relate the caps information all the way down to when the decoded pads
are emitted. One could assume certain order in which the pads are
being generated but that route sounds funky.

I'm sure there is an easier way to get this sorted out and thus I'm
looking for your enlightenment,

Thanks in advance,
Alberto




More information about the gstreamer-devel mailing list