[FFmpeg-devel] strange seek problem matroska andavcodec_flush_buffers

Don Moir donmoir at comcast.net
Sun Feb 19 20:35:22 CET 2012


----- Original Message ----- 
From: "Reimar Döffinger" <Reimar.Doeffinger at gmx.de>
To: "FFmpeg development discussions and patches" <ffmpeg-devel at ffmpeg.org>
Sent: Sunday, February 19, 2012 1:53 PM
Subject: Re: [FFmpeg-devel] strange seek problem matroska 
andavcodec_flush_buffers


> On Sun, Feb 19, 2012 at 01:47:27PM -0500, Don Moir wrote:
>> >>>The thing is, the "bad_seek_matroska_strange" file is a worst case
>> >>>of this of the files I have. Some other files I have, have a very
>> >>>slight indication of this. Maybe something like 1/8 to 1/4 of a
>> >>>second. In these cases, settting CODEC_FLAG2_SHOW_ALL is worse
>> >>>because you will see distortion where previously it was clean. While
>> >>>seeing the distortion is helpful in some cases, I have more files
>> >>>that are effected negatively by it.
>> >>
>> >>I may be missing something, but this should be a bug, the demuxer
>> >>should be seeking exactly to a keyframe and CODEC_FLAG2_SHOW_ALL
>> >>should not make the slightest difference at all.
>> >
>> >That's what I was thinking but wasn't sure how error concealment
>> >came into play there.
>>
>> If this is a bug, I think it will be effecting libavcodec/h264.c and
>> possibly libavcodec/mpeg12.c. I have an mpegts file with the same
>> problem but this file as well as the "strange" file are both
>> CODEC_ID_H264. I don't know what relationship mpeg12.c has if any,
>> but just so you know.
>
> No, the bug if would be in the demuxer if anything.
> However the thing I missed is that with rawvideo (-ES, also -TS and -PS)
> we currently don't even try to seek to keyframes, so for those
> that would indeed be normal behaviour (even if it potentially should
> be improved).
> For ogg, mkv, nut, avi, ... it _should_ be a bug though if you have
> some of these behaving like that.

I can only find a couple mkv and mpegts files with the problem. No ogg etc 
but will let you know if I do find some.

This mkv we already know:

http://sms.pangolin.com/temp/bad_seek_matroska_strange.mkv  (2.5 mb)

This one you looked at the other day and was the one I was having a problem 
with seeking not working at all and going to EOF on seek. I ended up having 
to set AVSEEK_FLAG_ANY for matroska files but this doesn't effect the 
condition of bad_seek_matroska_strange.mkv because either way it exhibits 
the problem. If I DONT set CODEC_FLAG2_SHOW_ALL on this file and if I DO set 
AVSEEK_FLAG_ANY on this file it works fine. The delay is very slight on this 
file.

http://sms.pangolin.com/temp/bad_seek_matroska_eof.mkv  (103 mb)

I have maybe 3 or 4 mpegts files that have a problem. One has a bad problem 
and the others have a slight problem. Not using CODEC_FLAG2_SHOW_ALL takes 
care of the slight problem files fine. On this really bad file you get a lot 
of gray when using CODEC_FLAG2_SHOW_ALL or a long delay when not using 
CODEC_FLAG2_SHOW_ALL. Also gray or delay on startup without seek.

http://sms.pangolin.com/temp/bad_seek_lots_of_gray.ts  (6 mb) 



More information about the ffmpeg-devel mailing list