]> git.sesse.net Git - ffmpeg/commit
lavfi/concat: allow to support inputs with different frame rates
authorCalvin Walton <calvin.walton@kepstin.ca>
Fri, 30 Aug 2019 17:28:17 +0000 (13:28 -0400)
committerNicolas George <george@nsup.org>
Sun, 8 Sep 2019 14:48:28 +0000 (16:48 +0200)
commit3ad5d4df9ce794d3eeb0f526c5f3e446bf97c616
treef570c135d7223ef582f79765bca656ca09adaed7
parent85386c36e331d1387a3ac0f322e3774c1b55dc26
lavfi/concat: allow to support inputs with different frame rates

Right now, the concat filter does not set the frame_rate value on any of
the out links. As a result, the default ffmpeg behaviour kicks in - to
copy the framerate from the first input to the outputs.

If a later input is higher framerate, this results in dropped frames; if
a later input is lower framerate it might cause judder.

This patch checks if all of the video inputs have the same framerate, and
if not it sets the out link to use '1/0' as the frame rate, the value
meaning "unknown/vfr".

A test is added to verify the VFR behaviour. The existing test for CFR
behaviour passes unchanged.
libavfilter/avf_concat.c
tests/fate/filter-video.mak
tests/filtergraphs/concat-vfr [new file with mode: 0644]
tests/ref/fate/filter-concat-vfr [new file with mode: 0644]