<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div dir="ltr" id="yui_3_16_0_1_1434009127072_11190"><span id="yui_3_16_0_1_1434009127072_11331">Great! I can now create the Profiles. <br></span></div><div id="yui_3_16_0_1_1434009127072_11334" dir="ltr">Thanks also for pointing the documentation, it'll be more than helpful.</div><div id="yui_3_16_0_1_1434009127072_11401" dir="ltr"><br></div><div id="yui_3_16_0_1_1434009127072_11402" dir="ltr">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.</div><div id="yui_3_16_0_1_1434009127072_11913" dir="ltr"><br></div><div id="yui_3_16_0_1_1434009127072_11786" dir="ltr">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?</div><div id="yui_3_16_0_1_1434009127072_11977" dir="ltr"><br></div><div id="yui_3_16_0_1_1434009127072_12046" dir="ltr">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...<br></div><div id="yui_3_16_0_1_1434009127072_11781" dir="ltr"><br></div><div id="yui_3_16_0_1_1434009127072_11782" style="" class="" dir="ltr">import gi</div>
<div id="yui_3_16_0_1_1434009127072_11785" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">gi.require_version('Gst', '1.0')</div>
<div id="yui_3_16_0_1_1434009127072_12045" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">from gi.repository import Gst</div>
<div id="yui_3_16_0_1_1434009127072_12698" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">from gi.repository import GstPbutils</div>
<div id="yui_3_16_0_1_1434009127072_11695" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">import time</div>
<div id="yui_3_16_0_1_1434009127072_11696" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Gst.init(None)</div>
<div id="yui_3_16_0_1_1434009127072_11697" class="" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br style="" class=""></div>
<div id="yui_3_16_0_1_1434009127072_11698" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:1;">pipeline = Gst.parse_launch('''</div>
<div id="yui_3_16_0_1_1434009127072_11757" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:1;">                            audiotestsrc is-live=1 !</div>
<div id="yui_3_16_0_1_1434009127072_11758" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:1;">                            decodebin !</div>
<div id="yui_3_16_0_1_1434009127072_11759" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:1;">                            encodebin name=encodebin !</div>
<div id="yui_3_16_0_1_1434009127072_11760" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:1;">                            filesink location=./output/test0611.wav</div>
<div id="yui_3_16_0_1_1434009127072_11761" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">                            ''')</div>
<div id="yui_3_16_0_1_1434009127072_11762" class="" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br style="" class=""></div>
<div class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">encodebin = pipeline.get_by_name("encodebin")</div>
<div id="yui_3_16_0_1_1434009127072_11763" class="" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br style="" class=""></div>
<div class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">audioprofile = GstPbutils.EncodingAudioProfile(Gst.Caps("audio/x-raw"), None, None, 0)</div>
<div id="yui_3_16_0_1_1434009127072_11768" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">containerprofile = GstPbutils.EncodingContainerProfile(None, None , Gst.Caps("audio/x-wav"), None)</div>
<div id="yui_3_16_0_1_1434009127072_11764" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">containerprofile.add_profile(audioprofile)</div>
<div id="yui_3_16_0_1_1434009127072_11767" class="" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br style="" class=""></div>
<div id="yui_3_16_0_1_1434009127072_11766" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">encodebin.set_property("profile", containerprofile)</div>
<div id="yui_3_16_0_1_1434009127072_11765" class="" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br style="" class=""></div>
<div class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">pipeline.set_state(Gst.State.PLAYING)</div>
<div id="yui_3_16_0_1_1434009127072_12703" class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">time.sleep(2)</div>
<div class="" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">pipeline.set_state(Gst.State.NULL)</div>
<div id="yui_3_16_0_1_1434009127072_12704" class="" dir="ltr" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br style="" class=""></div><div dir="ltr"><br><span id="yui_3_16_0_1_1434009127072_11331"></span></div><div id="yui_3_16_0_1_1434009127072_11337" dir="ltr"><span id="yui_3_16_0_1_1434009127072_11331"><br></span></div><div id="yui_3_16_0_1_1434009127072_11267" dir="ltr"><br><span></span></div> <blockquote id="yui_3_16_0_1_1434009127072_11182" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;">  <div id="yui_3_16_0_1_1434009127072_11181" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_1_1434009127072_11180" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_1_1434009127072_11189" dir="ltr"> <hr size="1">  <font id="yui_3_16_0_1_1434009127072_12705" face="Arial" size="2"> <b><span style="font-weight:bold;">De :</span></b> Thibault Saunier <tsaunier@gnome.org><br> <b><span style="font-weight: bold;">À :</span></b> Sébastien FENET <sebastien.fenet@yahoo.fr>; Discussion of the development of and with GStreamer <gstreamer-devel@lists.freedesktop.org> <br> <b><span style="font-weight: bold;">Envoyé le :</span></b> Jeudi 11 juin 2015 10h20<br> <b><span style="font-weight: bold;">Objet :</span></b> Re: PbUtils with GStreamer 1.0 in Python<br> </font> </div> <div id="yui_3_16_0_1_1434009127072_11179" class="y_msg_container"><br>Hello seb,<br clear="none"><br clear="none">You can do:<br clear="none"><br clear="none">  In [7]: from gi.repository import Gst<br clear="none">  In [8]: Gst.init(None)<br clear="none">  In [9]: from gi.repository import GstPbutils<br clear="none">  In [10]: GstPbutils.EncodingContainerProfile ("ogg", None ,<br clear="none">Gst.Caps("application/ogg"), None)<br clear="none">  Out[10]: <EncodingContainerProfile object at 0x7f576bd4cea0<br clear="none">(GstEncodingContainerProfile at 0x7f577d30e760)><br clear="none"><br clear="none">You should have a look at the documentation:<br clear="none"><a shape="rect" href="https://lazka.github.io/pgi-docs/#Gst-1.0" target="_blank">https://lazka.github.io/pgi-docs/#Gst-1.0</a><br clear="none"><br clear="none">Regards,<br clear="none"><br clear="none">Thibault Saunier<br clear="none"><br clear="none"><br clear="none">On Thu, Jun 11, 2015 at 9:57 AM, Sébastien FENET<br clear="none"><<a shape="rect" ymailto="mailto:sebastien.fenet@yahoo.fr" href="mailto:sebastien.fenet@yahoo.fr">sebastien.fenet@yahoo.fr</a>> wrote:<br clear="none">> Hi,<br clear="none">><br clear="none">> I'm trying to port some Python code from Gstreamer 0.10 to Gstreamer 1.0.<br clear="none">><br clear="none">> In this code, I was using an "encodebin" element. To this end, I had to<br clear="none">> create some EncodingProfiles. They were created with something like that:<br clear="none">><br clear="none">> [...]<br clear="none">> import gst.pbutils<br clear="none">> [...]<br clear="none">> profile = gst.pbutils.EncodingContainerProfile ("ogg", None ,<br clear="none">> gst.Caps("application/ogg"), None)<br clear="none">><br clear="none">> I can't find a way to reconduct this with Gstreamer 1.0. In fact, I didn't<br clear="none">> find Pbutils... Could anyone help with that?<br clear="none">><br clear="none">> Thanks!<br clear="none">> Seb.<br clear="none">><br clear="none">> _______________________________________________<br clear="none">> gstreamer-devel mailing list<br clear="none">> <a shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br clear="none">> <a shape="rect" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><div class="qtdSeparateBR"><br><br></div><div class="yqt0665458224" id="yqtfd48626"><br clear="none">><br clear="none">_______________________________________________<br clear="none">gstreamer-devel mailing list<br clear="none"><a shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br clear="none"><a shape="rect" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br clear="none"></div><br><br></div> </div> </div> </blockquote>  </div></body></html>