I've started to use ffmpeg recently. I have been using only the -filter_complex flag to apply filters. I stumbled upon this SO question:
A ffmpeg maintainer answers it using the -lavfi flag:
ffmpeg -i input.mp4 -lavfi "[0:v]scale=iw:2*trunc(iw*16/18),boxblur=luma_radius=min(h\,w)/20:luma_power=1:chroma_radius=min(cw\,ch)/20:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,setsar=1" output.mp4
I tried to change -lavfi flag to -filter_complex:
ffmpeg -i input.mp4 -filter_complex "[0:v]scale=iw:2*trunc(iw*16/18),boxblur=luma_radius=min(h\,w)/20:luma_power=1:chroma_radius=min(cw\,ch)/20:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,setsar=1" output.mp4
The result is the same and didn't notice a perf change.
Is there a difference when using either flags?
From the FFmpeg documentation:
-lavfi filtergraph (global) Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or outputs. Equivalent to -filter_complex.