[FFmpeg-devel] [WIP] [PATCH 1/2] lavfi: add an API to synchronize multiple video inputs.

Paul B Mahol onemda at gmail.com
Wed Aug 28 14:59:38 CEST 2013

On 8/27/13, Nicolas George <nicolas.george at normalesup.org> wrote:
> Compared to dualinput, this API can handle more than two
> inputs and can generate frames synchronized to any or all
> input streams.
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/framesync.c |  222 +++++++++++++++++++++++++++++++++++++++++++
>  libavfilter/framesync.h |  242
> +++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 464 insertions(+)
>  create mode 100644 libavfilter/framesync.c
>  create mode 100644 libavfilter/framesync.h
> Note: this is work in progress, but I do not know when I will be able to
> work on it again.
> It came as a reaction to mail on the user mailing list: how to overlay a
> video on top of a constant background. The problem is that the overlay
> filter, and the dualinput API that was extracted from it to serve for other
> filters, can only synchronize on the background video: since the background
> is a constant image, it does not move. If the video on top has constant
> frame rate, the problem can be solved by setting vf_fps on the background.
> Otherwise, the suggested solution was to make a sandwich: overlay the
> completely opaque background on top of the video to get the background with
> the video timestamps, and then overlay the video. That works (except if the
> background itself has alpha), but that is ugly and inefficient.

Why adding filter that just repeats frame is (still) ignored?

Btw, I really like multiple input support feature and I'm interested in this
feature being applied.

> The obvious quick-and-dirty solution would be to add sync=second option to
> the dualinput API, but that is just that: quick and dirty, it does not
> cover
> other uses: combining R, G, B input planes (three inputs), computing the
> PSNR of videos with the same frame rate but different skipped frames (must
> generate an event for frames on any input).
> This API aims to handle all the cases.


More information about the ffmpeg-devel mailing list