How to get the last frame of a video file ?

Ian Davidson id012c3076 at blueyonder.co.uk
Fri Jan 24 05:22:22 PST 2014


It seems to me .... If you have a video file which is exactly 1 second 
(say 30 frames) long and you try to seek to a position of 1 second, you 
will be trying to seek to the 31st frame, so an EOS would be in order.

If the file consists of Key Frames each followed by a number of Delta 
frames, a Seek will often look for the next Key Frame, rather than 
stopping on a Delta.

So, I think I would start by aiming for beginning, Middle and 'Just 
before the end'.

Ian

On 24/01/2014 11:24, adrien_sch wrote:
> Hello guys,
>
> My goal here is to get few snapshots of a video file. My plan is to use the
> pngenc element like this :
>
> filesrc ! matroskademux ! h264parse ! avdec_h264 ! videoconvert ! pngenc !
> appsink.
>
> My first step is to navigate inside the stream using the seek query, and my
> goal is to get 3 snapshot, the first frame of the video file, middle ( =>
> duration / 2), and the last. I observed that when I seek to the last frame
> (position = duration) the demux element throw a EOS event and I didn't get
> the last frame. My question is, how can I achieve this ?
>



More information about the gstreamer-devel mailing list