You are not logged in.

#1 2010-03-07 21:03:10

Dethredic
Member
Registered: 2009-01-24
Posts: 361
Website

Python + Gstreamer

I have been having trouble understanding / finding pygst docs, and I have run into some problems I can't figure out.

I use the following three lines to play a shout cast stream from a GUI:

self.player = gst.element_factory_make("playbin2", "player")
self.player.set_property("uri", "http://radioreddit.com:8000")
self.player.set_state(gst.STATE_PLAYING)

I then want to do 3 things:
1) Convert this stream to a .mp3. I can do this via bash like this (there could be a better way to do it):
gst-launch-0.10 uridecodebin uri=http://radioreddit.com:8000  ! audioconvert ! vorbisenc ! oggmux ! filesink location=stream.mp3

the problem is I don't know how to convert this to python. I want to be able to toggle record on and off, so if it didn't have to re-buffer every time that would be great.

2) I also want to be able to get the name of the mp3 file bing streamed. Again I can do this via bash like this:
gst-launch-0.10 souphttpsrc location=http://radioreddit.com:8000 iradio-mode=true ! icydemux ! fakesink -t | grep title:

again I can't figure out how to convert this to python and it would be nice not to have to rebuffer or have mutiple streams going at once to get this data.

3) Return the buffer %

Last edited by Dethredic (2010-03-07 21:16:35)

Offline

#2 2010-03-14 15:55:59

Dethredic
Member
Registered: 2009-01-24
Posts: 361
Website

Re: Python + Gstreamer

anyone??

Offline

Board footer

Powered by FluxBB