<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hello,<br></div><div><br></div><div>And again, a new branch here: <a href="https://code.videolan.org/tguillem/vlc/tree/decoder-frame-delay/2">https://code.videolan.org/tguillem/vlc/tree/decoder-frame-delay/3</a><br></div><div><br></div><div>I attached the diff between this new branch and my second branch.<br></div><div><br></div><div>Changes since the second branch:<br></div><div> - Renamed decoder_UpdateVideoFrameLatency() to decoder_UpdateVideoLatency() that takes now a latency in argument (no more frame_count)<br></div><div> - Handle fps that is only known from an avcodec thread (from the ffmpeg_GetFormat() callback): In that case, the module can't handle the decoder_UpdateVideoLatency() failure and will continue anyway (after displaying a warning). This should be a corner case. To mitigate this case, packetizers should parse the frame_rate for more codecs (already the case for hxxx, not done for AV1).<br></div><div><br></div><div>On Fri, Sep 27, 2019, at 11:45, Thomas Guillem wrote:<br></div><blockquote type="cite" id="qt"><div>Here is new a branch https://code.videolan.org/tguillem/vlc/commits/decoder-frame-delay/2<br></div><div><br></div><div>I attached the diff between this new branch and my first branch (grrr, impossible to print a diff from 2 non-master branches from gitlab)<br></div><div><br></div><div>Changes since the first branch:<br></div><div> <br></div><div>- The decoder latency is not added to the overall clock dejitter delay. Only the MAX between the input_dejitter (file/network-caching) and the highest decoder latency will be used. The update of the decoder latency will always succeed if it is lower than input_dejitter. For example, using the default file-caching of 300ms, video decoders will always be able to setup 9threads at 30fps (1000*9/30 = 300). If a video decoder need more threads or a lower fps, the  decoder has to be started just after/before (80ms gap) the audio decoder. <br></div><div><br></div><div>- The avcodec module will try to setup less thread instead of fallbacking directly to 1 in case of decoder_UpdateVideoFrameLatency() failure.<br></div><div><br></div><div>Note: Videos tracks will very likely be started just after/before the audio (80ms gap). In that case, the update of the decoder latency will always succeed regardless of the fps/theead_count.<br></div><div><br></div><div>On Thu, Sep 26, 2019, at 16:38, Thomas Guillem wrote:<br></div><div>> cf. https://mailman.videolan.org/pipermail/vlc-devel/2019-September/127432.html<br></div><div>> <br></div><div>> I chose to solve this issue with:<br></div><div>>  "- Have a way to report decoder delay.. but that would mean no playback<br></div><div>> until data decodes (what if only bogus data ? mutiple decs ?..)."<br></div><div>> <br></div><div>> Yes, no playback until data decodes, that is why we have a jitter delay in the<br></div><div>> output clock (80ms minimum).<br></div><div>> <br></div><div>> The solution I propose (explained commits by commits) will work on most case<br></div><div>> but won't work if the video is started late. In that case, threaded decoding<br></div><div>> will be disabled by avcodec. I guess it's OK since it's a corner case.<br></div><div>> <br></div><div>> Thomas Guillem (6):<br></div><div>>   clock: remove unused variable<br></div><div>>   clock: store the full list of clocks on the main one<br></div><div>>   clock: add vlc_clock_SetDecoderLatency<br></div><div>>   decoder: add decoder_UpdateVideoFrameLatency<br></div><div>>   avcodec: re-indent for the next commit<br></div><div>>   avcodec: use decoder_UpdateVideoFrameLatency()<br></div><div>> <br></div><div>>  include/vlc_codec.h           | 22 +++++++++<br></div><div>>  modules/codec/avcodec/video.c | 69 ++++++++++++++++++---------<br></div><div>>  src/clock/clock.c             | 88 ++++++++++++++++++++++++++++++++++-<br></div><div>>  src/clock/clock.h             | 13 ++++++<br></div><div>>  src/input/decoder.c           | 30 ++++++++++++<br></div><div>>  5 files changed, 197 insertions(+), 25 deletions(-)<br></div><div>> <br></div><div>> -- <br></div><div>> 2.20.1<br></div><div>> <br></div><div>> _______________________________________________<br></div><div>> vlc-devel mailing list<br></div><div>> To unsubscribe or modify your subscription options:<br></div><div>> https://mailman.videolan.org/listinfo/vlc-devel<br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div>https://mailman.videolan.org/listinfo/vlc-devel<br></div><div><br></div><div><b>Attachments:</b><br></div><ul><li>decoder-frame-delay.diff<br></li></ul></blockquote><div><br></div></body></html>