Failed to seek some frames in a matroska video file
Submitted by Adrien SCH.
Created attachment 267277
Issue : Some frame aren't seekable in a matroska video file
Real case :
- Reverse playback multiple video file.
- Snapshot of a video file
How to reproduce :
Create a video sample :
gst-launch-1.0 videotestsrc num-buffers=3000 ! timeoverlay ! x264enc ! matroskamux ! filesink location=~/test.mkv
This previous command will create a mkv file, with a duration of 100s and with a last frame at 99.967. These information can be validate with the mkvinfo tool (don't forget to activate Show all elements in the UI).
Gstreamer test case :
Goal, try to seek the last frame of the video file.
Pipeline : filesrc ! matroskademux ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink
Code : http://pastebin.com/yf47niDL
When we try to seek to the last frame, the last full gop is sent to the decoder, including the last frame. The decoder doesn't output the last frame, and the demux forward an EOS event (in my case, dropped). The result is that the last frame, isn't seekable, and will not be displayed.
Note : This behavior can be validated with other frames in the video file (a bit before the last frame), but I can't say how many frames aren't seekable.
Could be a segment problem ?
External : Mailing list discussion : http://gstreamer-devel.966125.n4.nabble.com/How-to-get-the-last-frame-of-a-video-file-td4664849.html
Attachment 267277, "Test case":