query_duration

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

query_duration

Florian Ludwig
Hi,

I'm trying to get the length of some music file's using gstreamer and
python. I'm using playbin2 and to get started I just copied the example
code from:

http://pygstdocs.berlios.de/pygst-tutorial/playbin.html

and added
 print 'duration', self.player.query_duration()

but that results in an exception:

Traceback (most recent call last):
  File "play_length.py", line 39, in start_stop
    print 'duration', self.player.query_duration()
gst.QueryError: query failed

How do I correctly get the play length of files?

Full code attached.

Thanks,
Florian

--
Florian Ludwig <[hidden email]>

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

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

Re: query_duration

Florian Ludwig
For the record:

Found a working example:

http://www.google.com/codesearch#cc98aI19-Hc/trunk/Main/GStreamer/Source/gst-python/examples/play.py&ct=rc&cd=3&q=query_duration%20lang:python

I am not yet sure what the difference is that makes this example work
though.

Florian

On Sat, 2011-07-09 at 22:08 +0200, Florian Ludwig wrote:

> Hi,
>
> I'm trying to get the length of some music file's using gstreamer and
> python. I'm using playbin2 and to get started I just copied the example
> code from:
>
> http://pygstdocs.berlios.de/pygst-tutorial/playbin.html
>
> and added
>  print 'duration', self.player.query_duration()
>
> but that results in an exception:
>
> Traceback (most recent call last):
>   File "play_length.py", line 39, in start_stop
>     print 'duration', self.player.query_duration()
> gst.QueryError: query failed
>
> How do I correctly get the play length of files?
>
> Full code attached.
>
> Thanks,
> Florian
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


--
Florian Ludwig <[hidden email]>

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