[PATCH] Add optional "mp4_exact_start" nginx config off/on to show video between keyframes

Maxim Dounin mdounin at mdounin.ru
Thu Oct 21 03:32:38 UTC 2021


On Mon, Oct 04, 2021 at 03:41:47PM -0700, Tracey Jaquith wrote:

> Hi Roman,
> OK, thanks!
> I’ve tested this on macosx & linux, so far with: chrome, safari, Firefox and iOS.
> However, I’m seeing Firefox is having alternate behavior where it plays video from the prior keyframe, 
> without audio, until it hits the desired start time in at least one video, though it’s not consistently doing this.
> I suspect it’s the edit list — a nice solve for this.  
> I’ve had minor issues with edit lists in the past, for what that’s worth.

Thanks for testing.  Just for the record:


Hopefully this will be eventually fixed.


> And deep apologies…
> > Another problem is track delay
> I  *should have* mentioned when I initially wrote in, that I was aware of the a/v sync slight slip 
> — and that in practice and running for over 3 months now, it hasn’t seemed to be any kind of issue.
> Assuming:
> * the average (US TV) video might be 29.97 fps
> * and thus timescale / duration of 30000 / 1001
> * and that a typical max distance between keyframe GOPs w/ ffmpeg encoders and similar is 300 frames or about 10s
> Then:
> * with a max of 10s between keyframes
> * and 300 frames max would get “sped up” from 1001 => 1
> Then we’re looking at a maximum additional video frames duration of 1/100th of a second.
> (300 * 1001 / 30000) == 10.01
> (300 * 1 / 30000) == 0.01
> So the most the A/V sync could “drift” from those early added frames is 1/100th of a second, 
> where average might be 2-3x smaller than that.
> In practice, it didn’t seem noticeable — 
> but I am quite impressed by your desire to minimize/eliminate that.
> (In practice, from the broadcasters at least in the US, 1/100th of a second A/V slip is not uncommon).

While it looks quite well with timescale 30000, it is not uncommon 
for video tracks to have timescale 25 or so.  For example, the 
test video in the ticket linked above uses timescale 24.  With 
such a timescale, resulting desync will be much more noticeable.

Maxim Dounin

More information about the nginx-devel mailing list