[FFmpeg-user] Read values from a text or CSV file?

Gyan ffmpeg at gyani.pro
Mon Sep 2 10:07:24 EEST 2019



On 02-09-2019 12:05 PM, Michael Koch wrote:
> Hello all,
>
> for a special effect I want to overlay a small video over the main 
> video, where the position of the overlay is a function of time. It's a 
> complicated function and can't be expressed by a simple formula. 
> Segment-wise linear interpolation might work, but many segments are 
> required and the command line may get too long:
>
> between(t,0,1) * lerp(x0,x1,t) +
> between(t,1,2) * lerp(x1,x2,t-1) +
> between(t,2,3) * lerp(x2,x1,t-2) + ...
>
> Is there any way to read the pre-calculated coordinates for the 
> overlay filter from a text or CSV file? Or from a PGM file, as in the 
> remap filter?

You can just read the whole filtergraph from a file.

     ffmpeg -i in -filter_complex_script graph.txt ...

where graph.txt is

e.g.

     [0:v][2:v]overlay=...[out]


Gyan


More information about the ffmpeg-user mailing list