Getting sample rate / sample format/ channels cound of playbin in python

Tim Müller tim at centricular.com
Fri Dec 8 09:47:36 UTC 2017


On Fri, 2017-12-08 at 08:01 +0100, Pavel Hofman wrote:

Hi,

> Thanks a lot. Actually I was able to find examples of getting the
> rate  from the pad -> caps, but I cannot find/do not know how to get
> the  correct pad from the gst 1.0 playbin (playbin2 ). May I ask you
> for help  with this?

Ah, I think something like this should work (untested).

  pad = playbin.emit('get-audio-pad', 0)

where 0 is the audio stream number (you can get the number of
audio/video/subtitle streams via the 'n-audio' etc. properties.

> I will take a look at playbin3, my project needs no backward 
> compatibility. Is playbin3 stable enough?

Depends what you're doing exactly, but should be, yes. Please file any
issues you're encountering in bugzilla.

Cheers
-Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com


More information about the gstreamer-devel mailing list