Getting size size with playbin2

Nikos Chantziaras realnc at gmail.com
Tue Jun 11 15:01:20 PDT 2013


On 11/06/13 13:05, Tim-Philipp Müller wrote:
> On Tue, 2013-06-11 at 09:20 +0200, Sebastian Dröge wrote:
>
>> On Di, 2013-06-11 at 10:11 +0300, Nikos Chantziaras wrote:
>>> There doesn't seem to be a direct way to get the video size (its
>>> resolution, not byte size) in GStreamer.  I'm not sure how to do this.
>>> It seems I have to watch for some signal from the pipeline (I'm using
>>> playbin2) which is emitted when that information becomes available.  But
>>> which signal?  And once it's emitted, how do I extract that information?
>>>
>>> It all seems awfully round-about for such a simple operation, and it's
>>> not clear at all how to proceed with this.  Any hints?
>>>
>>> I'm on GStreamer 0.10.36.
>>
>> You could connect to the "notify::caps" signal of the sinkpad of the
>> video sink, then get the caps (gst_pad_get_negotiated_caps()) and then
>> use the GstCaps and GstStructure API to extract width, height and
>> pixel-aspect-ratio.
>
> You can also use the get-video-pad action signal on playbin(2) after it
> has reached paused state (ASYNC_DONE message), and then get the
> negotiated/current caps from that pad.

Thanks to both of you.  I went with get-video-pad because I'm using 
playbin2 and can call that signal directly.  However, why am I receiving 
a paused state message over a dozen times when starting playback? 
Shouldn't the state change to paused just once when the pipeline is 
ready to play?


More information about the gstreamer-devel mailing list