<div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr">śr., 13 lut 2019, 16:28: Carl Eugen Hoyos <<a href="mailto:ceffmpeg@gmail.com">ceffmpeg@gmail.com</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2019-02-13 16:15 GMT+01:00, Michal Rybinski <<a href="mailto:michal.rybinski%2Bffmpeg@gmail.com" target="_blank" rel="noreferrer">michal.rybinski+ffmpeg@gmail.com</a>>:<br>
<br>
> Is FFMPEG taking into account SEI picture timing message<br>
> contents when establishing timestamp (pts or best effort<br>
> timestamp) when my app reads decoded AVFrame (basically<br>
> looking into pts and best_effort_timestamp fields)?<br>
<br>
I don't know the answer but I can confirm that there are known<br>
(and apparently difficult to fix) issues with timestamps in raw<br>
h.264 streams.<br>
<br>
Carl Eugen<br></blockquote></div><div dir="auto"><br></div><div dir="auto">Hi Carl,</div><div dir="auto"><br></div><div dir="auto">Thanks for prompt reply.</div><div dir="auto"><br></div><div dir="auto">If it does any difference, I might check things also with GPL version of ffmpeg that includes x264 decoder.</div><div dir="auto"><br></div><div dir="auto">I get timestamping in raw  h264 is troublesome. If it wasn't, ffmpeg wouldn't be employed in the proces :-) Synchronization is a case I'm looking at currently.</div><div dir="auto"><br></div><div dir="auto">Nevertheless (sorry, being persistent because I want to understand) I noticed various kinds of SEI are parsed in ffmpeg:</div><div dir="auto"><br></div><div dir="auto"><a href="https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/h264_sei.c">https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/h264_sei.c</a><br></div><div dir="auto"><br></div><div dir="auto">So given raw h264 elementary stream, it seems that info should be sitting (processed or not) and maybe used somewhere in ffmpeg structures (or my understanding what happens where in ffmpeg is totally wrong). Would you care to show me the right direction in ffmpeg sources to do my own digging? I am getting a little trouble trying to understand how this sei may (or may not) impact timestamps in frames and the flow of getting best_effort_timestamp.</div><div dir="auto"><br></div><div dir="auto">Basically, if my understanding is correct, sei picture timing message was defined to aid synchronization/sequencing frames on timeline (Im simplifying the whole subject a lot, I know). I might as well tap into ffmpeg if it's worth adding contribution candidate and some piece of handling such topic.</div><div dir="auto"><br></div><div dir="auto"> The other option might be doing own calculations for sync. Can I access this sei data (or user unregistered sei, type 5, which is also an option for me) directly from avframe? Or maybe earlier, from avpacket? If yes - how?</div><div dir="auto"><br></div><div dir="auto">And while at it - is there or how I can find out which key I should use in AVDictionary to set via av_dict_set an fps value for the h264 es stream while decoding and playing it back? Or it is very bad idea, because...? Or shall this question be a separate thread?</div><div dir="auto"><br></div><div dir="auto">It seems I need some help on identifying which parts of ffmpeg are employed in the demuxing and decoding of h264 es frame and when and which source code files could help me understand it better and look for answers.</div><div dir="auto"><br></div><div dir="auto">Hope it helps to clarify my questions.</div><div dir="auto"><br></div><div dir="auto">Best Regards </div><div dir="auto">Michał</div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>