How to get the last frame of a video file ?

adrien_sch adrien.schwartzentruber at gmail.com
Sat Jan 25 05:59:20 PST 2014


I'm sorry, but I think that there is something wrong. 

This is an example : 

Create a MKV file using the following command

GST_DEBUG=matroskamux:5 gst-launch-1.0 videotestsrc ! timeoverlay ! x264enc
! matroskamux ! filesink location=test.mkv -e

This is the output : 
http://pastebin.com/j74Nrgh4

So reading this output the last frame of the video file must be the
0:00:56.500000000 and the total duration is 0:00:56.533333333 with a stable
frame duration at 33333333. This frame is actually before the last simple
block in the cluster. The resulting mkv file can be verified with
mkvinfo-gui (don't forget to show all elements in the UI menu). 

At this point, we are sure that this frame exist in the video file, at
position 56500000000.

Now, let seek in this file using the matroskademux. 
gst_element_seek_simple(data->sink,GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
56500000000);

I put a buffer probe on on the demux src probe, this is the output : 
Buffer 0  GST_BUFFER_FLAG_DELTA_UNIT Duration 33333333PTS : 56433000000
Target : 56500000000 DTS : -1 Offset : 18446744073709551615
Buffer 0  GST_BUFFER_FLAG_DELTA_UNIT Duration 33333333PTS : 56367000000
Target : 56500000000 DTS : -1 Offset : 18446744073709551615
Buffer 0  GST_BUFFER_FLAG_DELTA_UNIT Duration 33333333PTS : 56333000000
Target : 56500000000 DTS : -1 Offset : 18446744073709551615
Buffer 0  GST_BUFFER_FLAG_DELTA_UNIT Duration 33333333PTS : 56400000000
Target : 56500000000 DTS : -1 Offset : 18446744073709551615
*Buffer 0  GST_BUFFER_FLAG_DELTA_UNIT Duration 33333333PTS : 56500000000
Target : 56500000000 DTS : -1 Offset : 18446744073709551615*
Buffer 0  GST_BUFFER_FLAG_DELTA_UNIT Duration 33333333PTS : 56467000000
Target : 56500000000 DTS : -1 Offset : 18446744073709551615
Receive EOS on the probe

With my understanding, the demux element find the frame but this frame isn't
correctly recognized or forwarded to the downstream. Am I right ? 


The full GST trace is available here :
http://www.fileswap.com/dl/WZm9tbpf3/out.tar.gz.html











--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-get-the-last-frame-of-a-video-file-tp4664849p4664872.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list