[FFmpeg-user] Combine vf and filter_complex for the same video?

Moritz Barsnick barsnick at gmx.net
Fri Sep 18 22:09:02 CEST 2015


On Fri, Sep 18, 2015 at 17:52:16 +0200, Gilles wrote:
> >simple to justify "-vf" instead of "-filter_complex".
> 
> If you have an example, I'm interested.

Yes, because filter combinations with only one input and one output
apparently aren't complex. (I wasn't aware of that.) See below.

> ffmpeg -i input.mp4 -c:v libx264 -filter_complex
> "scale=640:-1,split=2[v1][v2];
> [v1]crop=200:306:456:0,lutyuv=y=val*0.75[brightpart];
> [v2]lutyuv=y=val*2.5[darkpart];
> [darkpart][brightpart]overlay=x=456:y=0[v]" -map "[v]" -c:a copy
> -threads 2 -crf 20 -f mp4 output.mp4

Use the same as above with "-vf", drop the "[v]" at the end. The map
then refers to the demuxed input streams, so either omit it, or use
"-map 0:v":

$ ffmpeg -i input.mp4 -map 0:v -c:v libx264 -vf "scale=640:-1,split=2[v1][v2]; [v1]crop=200:306:456:0,lutyuv=y=val*0.75[brightpart]; [v2]lutyuv=y=val*2.5[darkpart]; [darkpart][brightpart]overlay=x=456:y=0" -c:a copy -threads 2 -crf 20 -f mp4 output.mp4

Moritz


More information about the ffmpeg-user mailing list