Slow down videos

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

Slow down videos

Maximilan Hoegner
Hi,
is there some simple gst-launch-pipeline to slow down a video file?
Something like

gst-launch-0.10 filesrc location=in.wav ! slowdown ! filesink=out.wav

I know that I can play a video slower if I send a seek event with rate
!= 1.0. But seeking doesn't seem to work with filesink, and I don't know
how to seek when using gst-launch, if this is possible. So is there a
simple pipeline I can use with gst-launch?

In case there is not:

Is there another way of seeking that does work with filesink? I also
tried sync=TRUE for the filesink, which had no effect.
Perhaps I made some mistake in my program structure. I first set the
state of the pipeline to playing. Then I do a get_state to wait for the
state change to complete (otherwise seeking has no effect at all, even
when not using filesink). Then I call

gst_element_seek(pipeline, 0.5, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);

which should set the playback rate to 0.5. After that I run the
gmainloop. This does indeed work if I do not use filesink, but when I
use it, the file is not slowed down at all (seeking to another position
doesn't work either). Anything wrong about that?
I suspect that the work is already done when the program reaches the
seek line, because state is set to playing before. Doing it the other
way round does not work however, the seek event does not get handled then.

Thank you for your help,
Maxi


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

signature.asc (292 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Slow down videos

Stefan Sauer
Maximilan Hoegner schrieb:

> Hi,
> is there some simple gst-launch-pipeline to slow down a video file?
> Something like
>
> gst-launch-0.10 filesrc location=in.wav ! slowdown ! filesink=out.wav
>
> I know that I can play a video slower if I send a seek event with rate
> != 1.0. But seeking doesn't seem to work with filesink, and I don't know
> how to seek when using gst-launch, if this is possible. So is there a
> simple pipeline I can use with gst-launch?

The above missed demuxers and decoders. You need to fully transcode it.

gst-launch-0.10 filesrc location=in.wav ! decodebin2 ! waveenc ! filesink=out.wav

but even then I am not sure if it will work as imho its the audiosinks that
resample.

Regarding seeking and gst-launch - no way. gst-launch is not meant for this. You
need to write a small app.

Stefan

>
> In case there is not:
>
> Is there another way of seeking that does work with filesink? I also
> tried sync=TRUE for the filesink, which had no effect.
> Perhaps I made some mistake in my program structure. I first set the
> state of the pipeline to playing. Then I do a get_state to wait for the
> state change to complete (otherwise seeking has no effect at all, even
> when not using filesink). Then I call
>
> gst_element_seek(pipeline, 0.5, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
> GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
>
> which should set the playback rate to 0.5. After that I run the
> gmainloop. This does indeed work if I do not use filesink, but when I
> use it, the file is not slowed down at all (seeking to another position
> doesn't work either). Anything wrong about that?
> I suspect that the work is already done when the program reaches the
> seek line, because state is set to playing before. Doing it the other
> way round does not work however, the seek event does not get handled then.
>
> Thank you for your help,
> Maxi
>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Slow down videos

Andoni Morales
In reply to this post by Maximilan Hoegner


2009/6/15 Maximilan Hoegner <[hidden email]>
Hi,
is there some simple gst-launch-pipeline to slow down a video file?
Something like

gst-launch-0.10 filesrc location=in.wav ! slowdown ! filesink=out.wav

I know that I can play a video slower if I send a seek event with rate
!= 1.0. But seeking doesn't seem to work with filesink, and I don't know
how to seek when using gst-launch, if this is possible. So is there a
simple pipeline I can use with gst-launch?

In case there is not:

Is there another way of seeking that does work with filesink? I also
tried sync=TRUE for the filesink, which had no effect.
Perhaps I made some mistake in my program structure. I first set the
state of the pipeline to playing. Then I do a get_state to wait for the
state change to complete (otherwise seeking has no effect at all, even
when not using filesink). Then I call

gst_element_seek(pipeline, 0.5, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);

which should set the playback rate to 0.5. After that I run the
gmainloop. This does indeed work if I do not use filesink, but when I
use it, the file is not slowed down at all (seeking to another position
doesn't work either). Anything wrong about that?
I suspect that the work is already done when the program reaches the
seek line, because state is set to playing before. Doing it the other
way round does not work however, the seek event does not get handled then. 
 
The seek event will change the rate of the stream but you need to make it effective (rewrite timestamps according to the new rate) using the videorate element before the filesink for example.

Andoni
 
Thank you for your help,
Maxi


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Andoni Morales Alastruey

LongoMatch:The Digital Coach
http://www.longomatch.ylatuya.es

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel