[PATCH] Add optional "&exact=1" CGI arg to show video between keyframes

Maxim Dounin mdounin at mdounin.ru
Fri Jun 4 17:38:09 UTC 2021


Hello!

On Thu, Jun 03, 2021 at 07:54:49PM +0000, Tracey Jaquith wrote:

> # HG changeset patch
> # User Tracey Jaquith <tracey at archive.org>
> # Date 1622678642 0
> #      Thu Jun 03 00:04:02 2021 +0000
> # Node ID 5da9c62fa61016600f2c59982ae184e2811be427
> # Parent  5f765427c17ac8cf753967387562201cf4f78dc4
> Add optional "&exact=1" CGI arg to show video between keyframes.
> 
> archive.org has been using mod_h264_streaming with an "&exact=1" patch from me since 2013.
> We just moved to nginx mp4 module and are using this patch.
> The technique is to find the keyframe just before the desired "start" time, and send
> that down the wire so video playback can start immediately.
> Next calculate how many video samples are between the keyframe and desired "start" time
> and update the STTS atom where those samples move the duration from (typically) 1001 to 1.
> This way, initial unwanted video frames play at ~1/30,000s -- so visually the
> video & audio start playing immediately.

So, effectively, this makes invalid streaming requests (not 
starting at a keyframe) to return the same data as valid ones 
(starting at a keyframe).  A properly written player should be 
able to achieve the same result by making correct streaming 
requests.

Any specific reasons to do this within nginx instead of fixing the 
player?  Or, given the fact that Flash is effectively dead, by 
simply using HTML5 video with appropriate seeking?

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list