question on seek

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

question on seek

Albert Costa
Hi All,
I have a simple question: I have an application where I want to display only a subset of a video. My pipeline can be resumed to 'filesrc ! decodebin ! ffmegcolorspace ! queue ! directdrawsink'. To see only a part of the video, I use following :

GstEvent* seek_event;
seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
                (GstSeekFlags) (GST_SEEK_FLAG_SEGMENT | GST_SEEK_FLAG_FLUSH),
                GST_SEEK_TYPE_SET, start_time,
                GST_SEEK_TYPE_SET, stop_time);

              gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
              gst_element_get_state(m_pipeline, NULL, NULL, GST_CLOCK_TIME_NONE);
              gst_element_send_event(m_pipeline, seek_event);

where start/stop_time are values for the start and end positions in my file.
Everything works fine, except for the fact that just before displaying the video at position start (and then playing up to stop position), I do see the first (0) frame of the video.
Is there a way to avoid this and have the pipeline really starting from the position I want? 

Regards,
Al


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: question on seek

Andoni Morales
2009/4/8 Albert Costa <[hidden email]>:

> Hi All,
> I have a simple question: I have an application where I want to display only
> a subset of a video. My pipeline can be resumed to 'filesrc ! decodebin !
> ffmegcolorspace ! queue ! directdrawsink'. To see only a part of the video,
> I use following :
> GstEvent* seek_event;
> seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
>                 (GstSeekFlags) (GST_SEEK_FLAG_SEGMENT |
> GST_SEEK_FLAG_FLUSH),
>                 GST_SEEK_TYPE_SET, start_time,
>                 GST_SEEK_TYPE_SET, stop_time);
>               gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
>               gst_element_get_state(m_pipeline, NULL, NULL,
> GST_CLOCK_TIME_NONE);
>               gst_element_send_event(m_pipeline, seek_event);
> where start/stop_time are values for the start and end positions in my file.
> Everything works fine, except for the fact that just before displaying the
> video at position start (and then playing up to stop position), I do see the
> first (0) frame of the video.
> Is there a way to avoid this and have the pipeline really starting from the
> position I want?

Maybe using this method is simpler:

gst_element_seek (m_pipeline, 1.0,
      GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE,
      GST_SEEK_TYPE_SET, start_time,
      GST_SEEK_TYPE_SET, stop_time);

If you want accuracy in the seek, you should use the flag
GST_SEEK_FLAG_ACCURATE. The seek  is slower but much more accurate.

Andoni

> Regards,
> Al
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re : question on seek

Albert Costa
Hi Andoni,
thanks for the tip. In fact, the seek itself is running fine, once it is active. My issue is that the pipeline starts playing from 0 before the seek really occurs, thus displaying a few frames before it moves to expected position. I've tried to seek before setting the pipeline to GST_STATE_PLAYING (put the pipe in GST_STATE_PAUSED, then seek, then set to GST_STATE_PLAYING) but it doesn't work. Is there a way to position the stream to a given seek pos before it actually starts to play?
Al


De : Andoni Morales <[hidden email]>
À : Discussion of the development of GStreamer <[hidden email]>
Envoyé le : Mercredi, 8 Avril 2009, 12h27mn 41s
Objet : Re: [gst-devel] question on seek

2009/4/8 Albert Costa <[hidden email]>:

> Hi All,
> I have a simple question: I have an application where I want to display only
> a subset of a video. My pipeline can be resumed to 'filesrc ! decodebin !
> ffmegcolorspace ! queue ! directdrawsink'. To see only a part of the video,
> I use following :
> GstEvent* seek_event;
> seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
>                 (GstSeekFlags) (GST_SEEK_FLAG_SEGMENT |
> GST_SEEK_FLAG_FLUSH),
>                 GST_SEEK_TYPE_SET, start_time,
>                 GST_SEEK_TYPE_SET, stop_time);
>               gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
>               gst_element_get_state(m_pipeline, NULL, NULL,
> GST_CLOCK_TIME_NONE);
>               gst_element_send_event(m_pipeline, seek_event);
> where start/stop_time are values for the start and end positions in my file.
> Everything works fine, except for the fact that just before displaying the
> video at position start (and then playing up to stop position), I do see the
> first (0) frame of the video.
> Is there a way to avoid this and have the pipeline really starting from the
> position I want?

Maybe using this method is simpler:

gst_element_seek (m_pipeline, 1.0,
          GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE,
          GST_SEEK_TYPE_SET, start_time,
          GST_SEEK_TYPE_SET, stop_time);

If you want accuracy in the seek, you should use the flag
GST_SEEK_FLAG_ACCURATE. The seek  is slower but much more accurate.

Andoni

> Regards,
> Al
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: question on seek

lrn-2
In reply to this post by Albert Costa
Albert Costa wrote:

> Hi All,
> I have a simple question: I have an application where I want to display only a subset of a video. My pipeline can be resumed to 'filesrc ! decodebin ! ffmegcolorspace ! queue ! directdrawsink'. To see only a part of the video, I use following :
>
> GstEvent* seek_event;
> seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
>                 (GstSeekFlags) (GST_SEEK_FLAG_SEGMENT | GST_SEEK_FLAG_FLUSH),
>                 GST_SEEK_TYPE_SET, start_time,
>                 GST_SEEK_TYPE_SET, stop_time);
>
>               gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
>               gst_element_get_state(m_pipeline, NULL, NULL, GST_CLOCK_TIME_NONE);
>               gst_element_send_event(m_pipeline, seek_event);
>
> where start/stop_time are values for the start and end positions in my file.
> Everything works fine, except for the fact that just before displaying the video at position start (and then playing up to stop position), I do see the first (0) frame of the video.
> Is there a way to avoid this and have the pipeline really starting from the position I want?
>
> Regards,
> Al
>  
Try to set the pipeline to GST_STATE_PAUSED first, then seek, then set
it to GST_STATE_PLAYING.
If that doesn't help, try gnonlin.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Re : question on seek

Andoni Morales
In reply to this post by Albert Costa
2009/4/8 Albert Costa <[hidden email]>:
> Hi Andoni,
> thanks for the tip. In fact, the seek itself is running fine, once it is
> active. My issue is that the pipeline starts playing from 0 before the seek
> really occurs, thus displaying a few frames before it moves to expected
> position. I've tried to seek before setting the pipeline
> to GST_STATE_PLAYING (put the pipe in GST_STATE_PAUSED, then seek, then set
> to GST_STATE_PLAYING) but it doesn't work. Is there a way to position the
> stream to a given seek pos before it actually starts to play?

So, If I understood, you want to open a file and start playing at a
given position, don't you?
I had to implement something like this, a king of playlist, but with
video segments from different video files. After the file switch, you
have to wait until the pipeline is in READY state, and then you post
the seek event;

GstState cur_state;
do{
      gst_element_get_state (bvw->priv->play, &cur_state, NULL, 0);
}while(cur_state <= GST_STATE_READY);
gst_element_seek (bvw->priv->play, 1.0,
      GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SEGMENT |
GST_SEEK_FLAG_ACCURATE,
      GST_SEEK_TYPE_SET, start * GST_MSECOND,
      GST_SEEK_TYPE_SET, stop * GST_MSECOND);
gst_element_set_state(bvw->priv->play, GST_STATE_PLAYING);

Andoni Morales

> Al
> ________________________________
> De : Andoni Morales <[hidden email]>
> À : Discussion of the development of GStreamer
> <[hidden email]>
> Envoyé le : Mercredi, 8 Avril 2009, 12h27mn 41s
> Objet : Re: [gst-devel] question on seek
>
> 2009/4/8 Albert Costa <[hidden email]>:
>> Hi All,
>> I have a simple question: I have an application where I want to display
>> only
>> a subset of a video. My pipeline can be resumed to 'filesrc ! decodebin !
>> ffmegcolorspace ! queue ! directdrawsink'. To see only a part of the
>> video,
>> I use following :
>> GstEvent* seek_event;
>> seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
>>                 (GstSeekFlags) (GST_SEEK_FLAG_SEGMENT |
>> GST_SEEK_FLAG_FLUSH),
>>                 GST_SEEK_TYPE_SET, start_time,
>>                 GST_SEEK_TYPE_SET, stop_time);
>>               gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
>>               gst_element_get_state(m_pipeline, NULL, NULL,
>> GST_CLOCK_TIME_NONE);
>>               gst_element_send_event(m_pipeline, seek_event);
>> where start/stop_time are values for the start and end positions in my
>> file.
>> Everything works fine, except for the fact that just before displaying the
>> video at position start (and then playing up to stop position), I do see
>> the
>> first (0) frame of the video.
>> Is there a way to avoid this and have the pipeline really starting from
>> the
>> position I want?
>
> Maybe using this method is simpler:
>
> gst_element_seek (m_pipeline, 1.0,
>           GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE,
>           GST_SEEK_TYPE_SET, start_time,
>           GST_SEEK_TYPE_SET, stop_time);
>
> If you want accuracy in the seek, you should use the flag
> GST_SEEK_FLAG_ACCURATE. The seek  is slower but much more accurate.
>
> Andoni
>
>> Regards,
>> Al
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> High Quality Requirements in a Collaborative Environment.
>> Download a free trial of Rational Requirements Composer Now!
>> http://p.sf.net/sfu/www-ibm-com
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Re : question on seek

Andoni Morales
2009/4/8 Andoni Morales <[hidden email]>:

> 2009/4/8 Albert Costa <[hidden email]>:
>> Hi Andoni,
>> thanks for the tip. In fact, the seek itself is running fine, once it is
>> active. My issue is that the pipeline starts playing from 0 before the seek
>> really occurs, thus displaying a few frames before it moves to expected
>> position. I've tried to seek before setting the pipeline
>> to GST_STATE_PLAYING (put the pipe in GST_STATE_PAUSED, then seek, then set
>> to GST_STATE_PLAYING) but it doesn't work. Is there a way to position the
>> stream to a given seek pos before it actually starts to play?
>
> So, If I understood, you want to open a file and start playing at a
> given position, don't you?
> I had to implement something like this, a king of playlist, but with
> video segments from different video files. After the file switch, you
> have to wait until the pipeline is in READY state, and then you post
"have to wait until the pipeline is in PAUSE state". Sorry
Andoni

> the seek event;
>
> GstState cur_state;
> do{
>      gst_element_get_state (bvw->priv->play, &cur_state, NULL, 0);
> }while(cur_state <= GST_STATE_READY);
> gst_element_seek (bvw->priv->play, 1.0,
>        GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SEGMENT |
> GST_SEEK_FLAG_ACCURATE,
>        GST_SEEK_TYPE_SET, start * GST_MSECOND,
>        GST_SEEK_TYPE_SET, stop * GST_MSECOND);
> gst_element_set_state(bvw->priv->play, GST_STATE_PLAYING);
>
> Andoni Morales
>
>> Al
>> ________________________________
>> De : Andoni Morales <[hidden email]>
>> À : Discussion of the development of GStreamer
>> <[hidden email]>
>> Envoyé le : Mercredi, 8 Avril 2009, 12h27mn 41s
>> Objet : Re: [gst-devel] question on seek
>>
>> 2009/4/8 Albert Costa <[hidden email]>:
>>> Hi All,
>>> I have a simple question: I have an application where I want to display
>>> only
>>> a subset of a video. My pipeline can be resumed to 'filesrc ! decodebin !
>>> ffmegcolorspace ! queue ! directdrawsink'. To see only a part of the
>>> video,
>>> I use following :
>>> GstEvent* seek_event;
>>> seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
>>>                 (GstSeekFlags) (GST_SEEK_FLAG_SEGMENT |
>>> GST_SEEK_FLAG_FLUSH),
>>>                 GST_SEEK_TYPE_SET, start_time,
>>>                 GST_SEEK_TYPE_SET, stop_time);
>>>               gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
>>>               gst_element_get_state(m_pipeline, NULL, NULL,
>>> GST_CLOCK_TIME_NONE);
>>>               gst_element_send_event(m_pipeline, seek_event);
>>> where start/stop_time are values for the start and end positions in my
>>> file.
>>> Everything works fine, except for the fact that just before displaying the
>>> video at position start (and then playing up to stop position), I do see
>>> the
>>> first (0) frame of the video.
>>> Is there a way to avoid this and have the pipeline really starting from
>>> the
>>> position I want?
>>
>> Maybe using this method is simpler:
>>
>> gst_element_seek (m_pipeline, 1.0,
>>           GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE,
>>           GST_SEEK_TYPE_SET, start_time,
>>           GST_SEEK_TYPE_SET, stop_time);
>>
>> If you want accuracy in the seek, you should use the flag
>> GST_SEEK_FLAG_ACCURATE. The seek  is slower but much more accurate.
>>
>> Andoni
>>
>>> Regards,
>>> Al
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by:
>>> High Quality Requirements in a Collaborative Environment.
>>> Download a free trial of Rational Requirements Composer Now!
>>> http://p.sf.net/sfu/www-ibm-com
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> High Quality Requirements in a Collaborative Environment.
>> Download a free trial of Rational Requirements Composer Now!
>> http://p.sf.net/sfu/www-ibm-com
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> High Quality Requirements in a Collaborative Environment.
>> Download a free trial of Rational Requirements Composer Now!
>> http://p.sf.net/sfu/www-ibm-com
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>>
>

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: question on seek

Tim-Philipp Müller-2
In reply to this post by Albert Costa
On Wed, 2009-04-08 at 09:21 +0000, Albert Costa wrote:

> I have a simple question: I have an application where I want to
> display only a subset of a video. My pipeline can be resumed to
> 'filesrc ! decodebin ! ffmegcolorspace ! queue ! directdrawsink'. To
> see only a part of the video, I use following :
>
>               (snip flushing segment seek)
>               gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
>               gst_element_get_state(m_pipeline, NULL, NULL, -1);
>               gst_element_send_event(m_pipeline, seek_event);
>
> where start/stop_time are values for the start and end positions in my
> file.
> Everything works fine, except for the fact that just before displaying
> the video at position start (and then playing up to stop position), I
> do see the first (0) frame of the video.

The problem is that the video sink will render the first frame already
on preroll, so just as it goes into PAUSED state. You are waiting for
the pipeline to finish prerolling though (and reach playing state on top
of that) before you issue the flushing seek, so at that point it's too
late and the first frame has already been shown.

So if you want to avoid that you either have to prevent the videosink
from drawing preroll buffers, or do the seek before it reaches the sink
(but after you know the demuxer is read for seeking, which is tricky).
You could probably do something involving pad blocks here. Or use
gnonlin, as has already been suggested.

Cheers
 -Tim




------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re : question on seek

Albert Costa
Thanks to all for the answers.
So it looks like I can't avoid simply the prerolled frames, at least without significant code change. So I'll just let it be for the moment.
Al


De : Tim-Philipp Müller <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi, 8 Avril 2009, 14h26mn 41s
Objet : Re: [gst-devel] question on seek

On Wed, 2009-04-08 at 09:21 +0000, Albert Costa wrote:

> I have a simple question: I have an application where I want to
> display only a subset of a video. My pipeline can be resumed to
> 'filesrc ! decodebin ! ffmegcolorspace ! queue ! directdrawsink'. To
> see only a part of the video, I use following :
>
>              (snip flushing segment seek)
>              gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
>              gst_element_get_state(m_pipeline, NULL, NULL, -1);
>              gst_element_send_event(m_pipeline, seek_event);
>
> where start/stop_time are values for the start and end positions in my
> file.
> Everything works fine, except for the fact that just before displaying
> the video at position start (and then playing up to stop position), I
> do see the first (0) frame of the video.

The problem is that the video sink will render the first frame already
on preroll, so just as it goes into PAUSED state. You are waiting for
the pipeline to finish prerolling though (and reach playing state on top
of that) before you issue the flushing seek, so at that point it's too
late and the first frame has already been shown.

So if you want to avoid that you either have to prevent the videosink
from drawing preroll buffers, or do the seek before it reaches the sink
(but after you know the demuxer is read for seeking, which is tricky).
You could probably do something involving pad blocks here. Or use
gnonlin, as has already been suggested.

Cheers
-Tim




------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Re : question on seek

Wim Taymans
On Fri, 2009-04-10 at 08:51 +0000, Albert Costa wrote:
> Thanks to all for the answers.
> So it looks like I can't avoid simply the prerolled frames, at least
> without significant code change. So I'll just let it be for the
> moment.
> Al

We could add a simple property to the video sinks to not show the
preroll image for this purpose.

Wim

>
>
> ______________________________________________________________________
> De : Tim-Philipp Müller <[hidden email]>
> À : [hidden email]
> Envoyé le : Mercredi, 8 Avril 2009, 14h26mn 41s
> Objet : Re: [gst-devel] question on seek
>
> On Wed, 2009-04-08 at 09:21 +0000, Albert Costa wrote:
>
> > I have a simple question: I have an application where I want to
> > display only a subset of a video. My pipeline can be resumed to
> > 'filesrc ! decodebin ! ffmegcolorspace ! queue ! directdrawsink'. To
> > see only a part of the video, I use following :
> >
> >              (snip flushing segment seek)
> >              gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
> >              gst_element_get_state(m_pipeline, NULL, NULL, -1);
> >              gst_element_send_event(m_pipeline, seek_event);
> >
> > where start/stop_time are values for the start and end positions in
> my
> > file.
> > Everything works fine, except for the fact that just before
> displaying
> > the video at position start (and then playing up to stop position),
> I
> > do see the first (0) frame of the video.
>
> The problem is that the video sink will render the first frame already
> on preroll, so just as it goes into PAUSED state. You are waiting for
> the pipeline to finish prerolling though (and reach playing state on
> top
> of that) before you issue the flushing seek, so at that point it's too
> late and the first frame has already been shown.
>
> So if you want to avoid that you either have to prevent the videosink
> from drawing preroll buffers, or do the seek before it reaches the
> sink
> (but after you know the demuxer is read for seeking, which is tricky).
> You could probably do something involving pad blocks here. Or use
> gnonlin, as has already been suggested.
>
> Cheers
> -Tim
>
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel