<div dir="ltr"><div class="gmail_quote"><div dir="ltr">вт, 21 авг. 2018 г. в 11:44, Carl Eugen Hoyos <<a href="mailto:ceffmpeg@gmail.com">ceffmpeg@gmail.com</a>>: </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Do you have a sample of a file with wrong values in container that<br>
gets misdetected by (current) FFmpeg?<br></blockquote><div><br></div><div>Carl, the problem is fundamental. With container we can't be assured that there is no misconfig there, so in robust solutions we can't rely on it. We saw such streams, but I have dump for example right now.</div><div><br></div><div>You also can observe this bug in FFmpeg. We try to use framerate from AVCodecContext::framerate, and this value depends on number of threads specified for AVCodecContext. FFmpeg uses AVStream from libavformat and there exists two framerates: AVStream::r_frame_rate and AVStream::avg_frame_rate - and their values are correct, that's why FFmpeg shows framerate correctly.</div><div>But decoder ( AVCodecContext ) in FFmpeg has incorrect framerate, too! You can check it by simly add printf avctx->framerate into decode() function in FFmpeg (ffmpeg.c:2231) after avcodec_receive_frame -- it will show you 100/1 fps (incorrect) for more that 1 thread and 50/1 fps (correct) if you add  -threads 1 for FFmpeg binary.</div><div>  </div></div></div>