How can I get the current position from a pipeline?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I get the current position from a pipeline?

Michel Albert
Hi,

I am very new to gstreamer, and I would like to implement a very basic
audio player without UI in python. It's supposed to be used as a
component in a web-application, streaming audio to an icecast server.

I have got the basics to work using a simple pipeline. The pipeline
looks like this:

     filesrc name="infile" location="{filename}" !  decodebin !
audioconvert !  vorbisenc !  oggmux !  shout2send mount="{mount}"
port={port} username={user} password={passwd}

As said, this works. But now I would need to get the current position
in the input file. I was trying to run
"pipeline.get_by_name('infile').query_position(gst.FORMAT_TIME)"  but
that gives me a "Query failed" error, without more details. I dug
through all the docs of the pipeline elements, but did not find
anything that looks promising.

For reference, I will attach my current experimental script to this mail.




Best regards,

Mich.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

gstplay.py (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How can I get the current position from a pipeline?

Stefan Sauer
On 06/23/2012 01:22 PM, Michel Albert wrote:
Hi,

I am very new to gstreamer, and I would like to implement a very basic
audio player without UI in python. It's supposed to be used as a
component in a web-application, streaming audio to an icecast server.

I have got the basics to work using a simple pipeline. The pipeline
looks like this:

     filesrc name="infile" location="{filename}" !  decodebin !
audioconvert !  vorbisenc !  oggmux !  shout2send mount="{mount}"
port={port} username={user} password={passwd}

As said, this works. But now I would need to get the current position
in the input file. I was trying to run
"pipeline.get_by_name('infile').query_position(gst.FORMAT_TIME)"  but
that gives me a "Query failed" error, without more details. I dug
through all the docs of the pipeline elements, but did not find
anything that looks promising.
Just send the query to the pipeline, it will dispatch it to the right element.
"pipeline.query_position(gst.FORMAT_TIME)"

Stefan

For reference, I will attach my current experimental script to this mail.




Best regards,

Mich.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel