<div dir="ltr">Sorry,<div>It was my fault I didn't pay a little attention to file path </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-19 16:47 GMT+01:00 Thibault Saunier <span dir="ltr"><<a href="mailto:tsaunier@gnome.org" target="_blank">tsaunier@gnome.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
Could you explain how it is failling?<br>
<br>
Regards,<br>
<br>
Thibault Saunier<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Nov 19, 2015 at 4:37 PM, vassilux . <<a href="mailto:v.gontcharov@gmail.com">v.gontcharov@gmail.com</a>> wrote:<br>
> Yes ...<br>
><br>
> 2015-11-19 16:32 GMT+01:00 Raushan Kumar Choudhary<br>
> <<a href="mailto:raushankumar@tataelxsi.co.in">raushankumar@tataelxsi.co.in</a>>:<br>
>><br>
>> did u switch on your internet connection<br>
>><br>
>> Sent from my iPhone<br>
>><br>
>> > On 19-Nov-2015, at 8:24 pm, vassilux . <<a href="mailto:v.gontcharov@gmail.com">v.gontcharov@gmail.com</a>> wrote:<br>
>> ><br>
>> > Hi alls,<br>
>> > I try to port my old java-gstreamer application to pygi and make a<br>
>> > little test with follow<br>
>> > This commande works<br>
>> > gst-launch-1.0 filesrc location=c:\\audiotest\\0000ad39.wav ! decodebin<br>
>> > ! audioconvert ! audioresample ! lamemp3enc ! filesink<br>
>> > location=c:\\audiotest\\0000ad39.mp3<br>
>> ><br>
>> ><br>
>> > I want to run something like this from python(pygi)<br>
>> ><br>
>> > import logging<br>
>> > from logging.handlers import RotatingFileHandler<br>
>> ><br>
>> > logging.basicConfig(level=logging.INFO)<br>
>> ><br>
>> > logger = logging.getLogger('myapp')<br>
>> ><br>
>> > import gi<br>
>> > gi.require_version('Gst', '1.0')<br>
>> > from gi.repository import GObject, Gst<br>
>> ><br>
>> > GObject.threads_init()<br>
>> > Gst.init(None)<br>
>> ><br>
>> > def transcode_process(pathin, pathout):<br>
>> ><br>
>> > log_message = "Transcoding %s to %s" % (pathin, pathout)<br>
>> ><br>
>> > cmd = 'filesrc location=c:\\\\audiotest\\0000ad39.wav name=source<br>
>> > ! decodebin ! audioconvert ! audioresample ! lamemp3enc name=encoder !<br>
>> > filesink location=c:\\\\audiotest\\0000ad39.mp3 name=output'<br>
>> ><br>
>> > pipeline = Gst.parse_launch(cmd)<br>
>> ><br>
>> > if pipeline == None:<br>
>> > logger.error("Failed get pipeline")<br>
>> > return<br>
>> ><br>
>> > source = pipeline.get_by_name('source')<br>
>> ><br>
>> > if source == None:<br>
>> > logger.error("Failed get source")<br>
>> > return<br>
>> ><br>
>> > try:<br>
>> ><br>
>> > pipeline.set_state(Gst.State.PLAYING)<br>
>> ><br>
>> > bus = pipeline.get_bus()<br>
>> ><br>
>> > msg = bus.timed_pop_filtered(Gst.CLOCK_TIME_NONE,<br>
>> > Gst.MessageType.ERROR | Gst.MessageType.EOS)<br>
>> ><br>
>> ><br>
>> > pipeline.set_state(Gst.State.NULL)<br>
>> ><br>
>> > except Exception as e:<br>
>> > logger.error(str(e))<br>
>> > logger.error("Could not open the file for transcoding.<br>
>> > This is probably happening because there are non-ASCII characters in the<br>
>> > filename.")<br>
>> > finally:<br>
>> > try:<br>
>> > # I think this is supposed to free the memory used<br>
>> > by the pipeline<br>
>> > pipeline.set_state(Gst.State.NULL)<br>
>> > except:<br>
>> > pass<br>
>> ><br>
>> ><br>
>> > def main():<br>
>> > print sys.getdefaultencoding()<br>
>> > transcode_process("c:\\\\audiotest\\0000ad39.wav",<br>
>> > "c:\\\\audiotest\\0000ad39.mp3")<br>
>> ><br>
>> ><br>
>> > if __name__ == "__main__":<br>
>> > main()<br>
>> ><br>
>> ><br>
>> > Something missing .. :-)<br>
>> ><br>
>> > Thank for help<br>
>> ><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > gstreamer-devel mailing list<br>
>> > <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
>> > <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
>> _______________________________________________<br>
>> gstreamer-devel mailing list<br>
>> <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
>> <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Vassili Gontcharov<br>
><br>
> _______________________________________________<br>
> gstreamer-devel mailing list<br>
> <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Vassili Gontcharov</div>
</div>