Setting GnlFileSource "duration" dynamically

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

Setting GnlFileSource "duration" dynamically

vaisaari
Hi all,

I'm trying to learn GNonLin and I'm facing a following problem. First, I
build a pipeline which consists (at first) of only one video within a GnlFileSource. Thereafter, I would like to playback my pipeline from the beginning to the end. I know that I have to set the "duration" property to correct value in order to do that. Unfortunately, I only know how to use fixed values for duration.  If the "duration" is smaller than the original video length the playback will stop too early, if the value is larger I'm able to play the entire video. However, I would also like to display how much time is left while playing the video. If I now query the duration of my pipeline I will get the same arbitrary large number that I set as the "duration" previously, which is not the actual duration of the video. So the question is: How do I set the "duration" property dynamically to the duration of my video? Or how should I handle situation like this?

Thank you for your help!
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Setting GnlFileSource "duration" dynamically

Edward Hervey
Administrator
Hi,

  You need to get the duration of your media beforehand.

  The new GstDiscover in gst-plugins-base will help you do that very
easily.

    Edward

On Mon, 2011-03-14 at 08:21 +0200, Vaisaari wrote:

> Hi all,
>
> I'm trying to learn GNonLin and I'm facing a following problem. First,
> I
> build a pipeline which consists (at first) of only one video within a
> GnlFileSource. Thereafter, I would like to playback my pipeline from
> the beginning to the end. I know that I have to set the "duration"
> property to correct value in order to do that. Unfortunately, I only
> know how to use fixed values for duration.  If the "duration" is
> smaller than the original video length the playback will stop too
> early, if the value is larger I'm able to play the entire video.
> However, I would also like to display how much time is left while
> playing the video. If I now query the duration of my pipeline I will
> get the same arbitrary large number that I set as the "duration"
> previously, which is not the actual duration of the video. So the
> question is: How do I set the "duration" property dynamically to the
> duration of my video? Or how should I handle situation like this?
>
> Thank you for your help!
> _______________________________________________
> 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