[gst-devel] Changing play rate in a GnlFileSource element

Andoni Morales ylatuya at gmail.com
Tue May 26 20:12:33 CEST 2009


2009/5/26 Edward Hervey <bilboed at gmail.com>:
> On Tue, 2009-05-26 at 19:18 +0200, Andoni Morales wrote:
>> I want to extract a video segment of a stream and encode it into a new
>> file at a different play rate.
>>
>> I am wondering if it's possible to change the play rate of the stream
>> obtained from the GnlComposition element by setting the "duration"
>> property of the GnlFileSource element X time longer than the
>> "media-duration" property, for example:
>>
>> start=0;
>> duration=10,
>> media-start=10;
>> media-duration=15;
>
>  That will make the output playback at (15/10=) 1.5 times the normal
> playback speed.
>
>  The 'media_duration' is how much will be taken from the contained
> stream,
>  The 'duration' is for how long it will be played back.
>
>  If you want the file to playback at half speed, you'll need to make
> the duration twice as long as the media-duration (thereby playing back X
> seconds in 2*X seconds).

You are right, I made a mistake calculating the output rate... ;)
>
>>
>> Does this paramaters sets the "rate" property of the GnlFileSource to
>> 1/2 or do I rather have to use a GnlOperation element with the
>> videorate element?
>
>  It will set the rate of the outgoing segment but will not modify the
> timestamps/frequency of the buffers.
>  You will need to add the following on the output of your gnlfilesource
> in order for the timestamps/newsegment to be transformed accordingly:
>
>  gnlfilesource ! identity single-segment=True ! videorate !
> yourencoder ...

If for example, I need to use a GnlComposition to extract several
segments of the same file, but with different play rates (for example
to get in the output file the same segment 3 times, but at 1x, 1/2x
and 1/4x), can I use the previous pipeline but replacing
'gnlfilesource' with 'gnlcomposition'?

Thanks,
Andoni

>
>
>    Edward
>
>>
>> Andoni
>>
>> ------------------------------------------------------------------------------
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>> is a gathering of tech-side developers & brand creativity professionals. Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>




More information about the gstreamer-devel mailing list