[FFmpeg-user] Asynchronous overlays

Alexandre Ferrieux alexandre.ferrieux at orange-ftgroup.com
Wed May 18 18:24:20 CEST 2011


Hello,

I'd like to put side-by-side two video sources (with the overlay filter), with a completely asynchronous/decoupled 
scheme. Indeed my two video sources have varied and unstable frame rates, and in a naive setup of the overlay filter, 
ffmpeg insists on fetching a frame from each one for every output frame.

The idea is do decode both streams independently (threads) into the same overlay buffer, and have a third thread sample 
this at a regular rate (the wanted output frame rate), and feed that into the output chain (encoder + container). So, if 
at any given time one of the sources lags, the same frozen frame from it will be reused in several output frames (ie 
overlay buffer not updated in that area), but the overall output will not be stalled (as it is today).

Q1: is this doable with command-line flags to the ffmpeg executable ?

Q2: if not, I'd appreciate a sketch of where to look in the sources to do this in C.

-Alex


More information about the ffmpeg-user mailing list