<br><br><div class="gmail_quote">On Mon, Jul 23, 2012 at 7:12 PM, Carl Eugen Hoyos <span dir="ltr"><<a href="mailto:cehoyos@ag.or.at" target="_blank">cehoyos@ag.or.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Michael Bradshaw <mbradshaw@...> writes:<br>
<br>
> Anyone have any answers on these two things? If the answer to the<br>
> above would be "yes" can anyone else verify that "ffmpeg -dump<br>
> -loglevel debug -ss 38 -i 704x480-m2v-ac3.mpg -vframes 1 out.jpg" does<br>
> not seek to a keyframe?<br>
<br>
</div>As said, afaict it does seek to a keyframe.<br>
(But I may of course be wrong.)<br><br></blockquote><div><br></div><div>I am quite sure neither MPEG-PS nor MPEG-TS has the ability to seek to a keyframe. Its been a problem for me for a while and i've been over this code many times.</div>
<div>All they do is a binary search for the timestamp, and when they arrive close enough, they are done.</div><div><br></div><div>To compensate for this, decoders like MPEG-2 will simply discard frames until they see a keyframe to start decoding from, so visual corruption is avoided.</div>
<div>If you run those codecs with AVCodeContext.flags2 set to CODEC_FLAG2_SHOW_ALL, you'll probably get plenty of corrupted frames before a real frame is shown, however i do not know how to do that via ffmpeg commandline to demonstrate.</div>
</div>