PbUtils with GStreamer 1.0 in Python
sebastien.fenet at yahoo.fr
Thu Jun 11 01:45:30 PDT 2015
Great! I can now create the Profiles.
Thanks also for pointing the documentation, it'll be more than helpful.
I however still have a problem with *encodebin*. I would like to use it to encode audio files. So, let's say I want to create a WAV file. As far I understood, I have to create an AudioProfile and then a ContainerProfile to which I add the audio profile. I finally assign this container profile to the *encodebin*. Below is some example code.
For some reason, it does not work (it creates an empty file). Funny thing is, it works if I remove the ContainerProfile and assign directly the AudioProfile to *encodebin*. But, of course, the resulting file has no header... So, am I doing something wrong with the container?
While I'm here, is there a way to increase Gstreamer verbose level when using it in Python (I'm using Windows)? Sorry for the beginner's questions... could not find that many tutos about Gstreamer in Python...
import gigi.require_version('Gst', '1.0')from gi.repository import Gstfrom gi.repository import GstPbutilsimport timeGst.init(None)
pipeline = Gst.parse_launch(''' audiotestsrc is-live=1 ! decodebin ! encodebin name=encodebin ! filesink location=./output/test0611.wav ''')
encodebin = pipeline.get_by_name("encodebin")
audioprofile = GstPbutils.EncodingAudioProfile(Gst.Caps("audio/x-raw"), None, None, 0)containerprofile = GstPbutils.EncodingContainerProfile(None, None , Gst.Caps("audio/x-wav"), None)containerprofile.add_profile(audioprofile)
De : Thibault Saunier <tsaunier at gnome.org>
À : Sébastien FENET <sebastien.fenet at yahoo.fr>; Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Envoyé le : Jeudi 11 juin 2015 10h20
Objet : Re: PbUtils with GStreamer 1.0 in Python
You can do:
In : from gi.repository import Gst
In : Gst.init(None)
In : from gi.repository import GstPbutils
In : GstPbutils.EncodingContainerProfile ("ogg", None ,
Out: <EncodingContainerProfile object at 0x7f576bd4cea0
(GstEncodingContainerProfile at 0x7f577d30e760)>
You should have a look at the documentation:
On Thu, Jun 11, 2015 at 9:57 AM, Sébastien FENET
<sebastien.fenet at yahoo.fr> wrote:
> I'm trying to port some Python code from Gstreamer 0.10 to Gstreamer 1.0.
> In this code, I was using an "encodebin" element. To this end, I had to
> create some EncodingProfiles. They were created with something like that:
> import gst.pbutils
> profile = gst.pbutils.EncodingContainerProfile ("ogg", None ,
> gst.Caps("application/ogg"), None)
> I can't find a way to reconduct this with Gstreamer 1.0. In fact, I didn't
> find Pbutils... Could anyone help with that?
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gstreamer-devel