]> git.sesse.net Git - nageru/commit
Set duration for all video frames.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 19 Apr 2016 21:46:26 +0000 (23:46 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 19 Apr 2016 21:46:26 +0000 (23:46 +0200)
commitd4ffc0e71f0908d3ecc2e88b8675cfe4e93febe4
treeb36b4d2e166fb1b31bb9f842b5249bb6ad8ea039
parent3173d8e9b8c66be0a6cb08d7a102297456f4e7a3
Set duration for all video frames.

Generally the muxer will ignore these, but there's one specific case
where it cannot: Since we flush before keyframes, the mov (MP4) mux
will not be able to set a proper duration based on the next frame
(usually it just does next_dts - dts), and thus guesses that it will be
the same as the previous one. If we dropped a frame between those two,
the duration of said last frame will be wrong -- and the keyframe
(starting in the next fragment) will get the wrong pts, possibly
seemingly even going backwards.

If we lose a frame between the last frame and the keyframe, the pts
of the keyframe will still be a bit wonky, but according to wbs
(who wrote the mux), it's much better like so.
h264encode.cpp
h264encode.h
mixer.cpp
mixer.h
x264encode.cpp
x264encode.h