Re: slowdown video

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: slowdown video

sreerenj


On Fri, Jun 19, 2009 at 10:17 PM, <[hidden email]> wrote:
Send gstreamer-devel mailing list submissions to
       [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
       https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
or, via email, send a message with subject or body 'help' to
       [hidden email]

You can reach the person managing the list at
       [hidden email]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gstreamer-devel digest..."


Today's Topics:

  1. Re: Slow down videos (Stefan Kost)
  2. Re: Slow down videos (Andoni Morales)
  3. How to perform frame-by-frame video playing (Albert Costa)
  4. Re: [theora] Mozilla & gstreamer (Tim-Philipp M?ller)
  5. Re: How to perform frame-by-frame video playing (Wim Taymans)
  6. Re: How to perform frame-by-frame video playing (Andoni Morales)


----------------------------------------------------------------------

Message: 1
Date: Fri, 19 Jun 2009 15:50:59 +0300
From: Stefan Kost <[hidden email]>
Subject: Re: [gst-devel] Slow down videos
To: Discussion of the development of GStreamer
       <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=ISO-8859-15

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.

Hi,

I think this will work,


gst_element_seek(pipeline, 0.5, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
> GST_SEEK_TYPE_NONE, 0, GST_SEEK_TYPE_NONE, -1);


 

> 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




------------------------------

Message: 2
Date: Fri, 19 Jun 2009 15:32:42 +0200
From: Andoni Morales <[hidden email]>
Subject: Re: [gst-devel] Slow down videos
To: Discussion of the development of GStreamer
       <[hidden email]>
Message-ID:
       <[hidden email]>
Content-Type: text/plain; charset="iso-8859-1"

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
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 3
Date: Fri, 19 Jun 2009 16:02:29 +0000 (GMT)
From: Albert Costa <[hidden email]>
Subject: [gst-devel] How to perform frame-by-frame video playing
To: gstreamer <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"

Hi,
I'm trying to do the following:
I have an application that constructs and controls a pipeline. Merely, my pipe would be "filesink ! decodebin ! identity sync=true ! myfilter ! ffmpegcolorspace ! directdrawsink sync=false".
The element myfilter is currently just a pass-through element (it does not process anything). My goal is, from the application, to play the file only by moving a frame ahead when the user hits a key (in fact later that would be a signal sent by another process). My idea was to block the chain() function inside myfilter each time it is called, untill a release notification is sent. What I did so far is :
in the chain() :
{
...
   g_mutex_lock(myfilter->lock);
 do
 {
   g_cond_wait(myfilter->process_next, myfilter->lock);
 }
 g_mutex_unlock(myfilter ->lock);
...
}

In my application, I have a specific function that gets the sink pad of my filter element, and send a specific event on it.
In myfilter's sink_event function, I have a case of event type where I call g_cond_signal(myfilter->process_next) (which I thought would release the lock in the chain).
My problem is that when I launch the pipeline, the cond_wait does lock the chain function; but then in my application specific function, calling gst_pad_send_event never returns, and my event is thus not received by my element. Eveything hangs...
Is there any way to have it working somehow? (another option was to set the pipe in pause mode and send seek events to go to next frame, but i'm using mpeg2 ts files that do not support seek anyway, and I have other constraints for which I need an element that can be controled).
Any help would be appreciated,
Regards,
Al



-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 4
Date: Thu, 18 Jun 2009 13:28:21 +0100
From: Tim-Philipp M?ller <[hidden email]>
Subject: Re: [gst-devel] [theora] Mozilla & gstreamer
To: Michael Dale <[hidden email]>
Cc: Christopher Blizzard <[hidden email]>,
       [hidden email],  David Ascher
       <[hidden email]>, theora <[hidden email]>
Message-ID: <1245328101.5109.35.camel@zingle>
Content-Type: text/plain

On Wed, 2009-06-17 at 13:05 -0700, Michael Dale wrote:

> Mozilla is looking to include audio/video capture for Firefox and the
> Mozilla platform in the future.

Apologies if this is obvious to everyone else, but may I ask what kind
of audio/video capturing features you are looking to include exactly? Is
there a wiki page or mailing list discussion with more details
somewhere?

 Cheers
 -Tim





------------------------------

Message: 5
Date: Fri, 19 Jun 2009 18:11:09 +0200
From: Wim Taymans <[hidden email]>
Subject: Re: [gst-devel] How to perform frame-by-frame video playing
To: Discussion of the development of GStreamer
       <[hidden email]>
Message-ID: <1245427869.5194.19.camel@metal>
Content-Type: text/plain

On Fri, 2009-06-19 at 16:02 +0000, Albert Costa wrote:

Your approach will probably work.

Current GIT /and the eventual 0.10.24) has framestepping through the
STEP events, which should solve things in a more general way (when you
need to keep audio synchronized too).

Wim

> Hi,
> I'm trying to do the following:
> I have an application that constructs and controls a pipeline. Merely,
> my pipe would be "filesink ! decodebin ! identity sync=true !
> myfilter ! ffmpegcolorspace ! directdrawsink sync=false".
> The element myfilter is currently just a pass-through element (it does
> not process anything). My goal is, from the application, to play the
> file only by moving a frame ahead when the user hits a key (in fact
> later that would be a signal sent by another process). My idea was to
> block the chain() function inside myfilter each time it is called,
> untill a release notification is sent. What I did so far is :
> in the chain() :
> {
> ...
>     g_mutex_lock(myfilter->lock);
>   do
>   {
>     g_cond_wait(myfilter->process_next, myfilter->lock);
>   }
>   g_mutex_unlock(myfilter ->lock);
> ...
> }
>
>
> In my application, I have a specific function that gets the sink pad
> of my filter element, and send a specific event on it.
> In myfilter's sink_event function, I have a case of event type where I
> call g_cond_signal(myfilter->process_next) (which I thought would
> release the lock in the chain).
> My problem is that when I launch the pipeline, the cond_wait does lock
> the chain function; but then in my application specific function,
> calling gst_pad_send_event never returns, and my event is thus not
> received by my element. Eveything hangs...
> Is there any way to have it working somehow? (another option was to
> set the pipe in pause mode and send seek events to go to next frame,
> but i'm using mpeg2 ts files that do not support seek anyway, and I
> have other constraints for which I need an element that can be
> controled).
> Any help would be appreciated,
> Regards,
> Al
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> 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




------------------------------

Message: 6
Date: Fri, 19 Jun 2009 18:47:12 +0200
From: Andoni Morales <[hidden email]>
Subject: Re: [gst-devel] How to perform frame-by-frame video playing
To: Discussion of the development of GStreamer
       <[hidden email]>
Message-ID:
       <[hidden email]>
Content-Type: text/plain; charset="iso-8859-1"

2009/6/19 Wim Taymans <[hidden email]>

> On Fri, 2009-06-19 at 16:02 +0000, Albert Costa wrote:
>
> Your approach will probably work.
>
> Current GIT /and the eventual 0.10.24) has framestepping through the
> STEP events, which should solve things in a more general way (when you
> need to keep audio synchronized too).


Does that means that the framestep draft [1]  will be finally implemented in
0.10.24? Good news, though.

Cheers

[1]
http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/draft-framestep.txt


>
> Wim
>
> > Hi,
> > I'm trying to do the following:
> > I have an application that constructs and controls a pipeline. Merely,
> > my pipe would be "filesink ! decodebin ! identity sync=true !
> > myfilter ! ffmpegcolorspace ! directdrawsink sync=false".
> > The element myfilter is currently just a pass-through element (it does
> > not process anything). My goal is, from the application, to play the
> > file only by moving a frame ahead when the user hits a key (in fact
> > later that would be a signal sent by another process). My idea was to
> > block the chain() function inside myfilter each time it is called,
> > untill a release notification is sent. What I did so far is :
> > in the chain() :
> > {
> > ...
> >     g_mutex_lock(myfilter->lock);
> >   do
> >   {
> >     g_cond_wait(myfilter->process_next, myfilter->lock);
> >   }
> >   g_mutex_unlock(myfilter ->lock);
> > ...
> > }
> >
> >
> > In my application, I have a specific function that gets the sink pad
> > of my filter element, and send a specific event on it.
> > In myfilter's sink_event function, I have a case of event type where I
> > call g_cond_signal(myfilter->process_next) (which I thought would
> > release the lock in the chain).
> > My problem is that when I launch the pipeline, the cond_wait does lock
> > the chain function; but then in my application specific function,
> > calling gst_pad_send_event never returns, and my event is thus not
> > received by my element. Eveything hangs...
> > Is there any way to have it working somehow? (another option was to
> > set the pipe in pause mode and send seek events to go to next frame,
> > but i'm using mpeg2 ts files that do not support seek anyway, and I
> > have other constraints for which I need an element that can be
> > controled).
> > Any help would be appreciated,
> > Regards,
> > Al
> >
> >
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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
>



--
Andoni Morales Alastruey

LongoMatch:The Digital Coach
http://www.longomatch.ylatuya.es
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------
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


End of gstreamer-devel Digest, Vol 37, Issue 56
***********************************************



--
Sreerenj B
http://sreerenj.livejournal.com
[hidden email]
mob: +91 9995377714


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel