ffmpeg -h filter=overlay
——————
Filter overlay
Overlay a video source on top of the input.
slice threading supported
Inputs:
#0: main (video)
#1: overlay (video)
Outputs:
#0: default (video)
overlay AVOptions:
x <string> ..FV……. set the x expression (default “0”)
y <string> ..FV……. set the y expression (default “0”)
eof_action <int> ..FV……. Action to take when encountering EOF from secondary input (from 0 to 2) (default repeat)
repeat 0 ..FV……. Repeat the previous frame.
endall 1 ..FV……. End both streams.
pass 2 ..FV……. Pass through the main input.
eval <int> ..FV……. specify when to evaluate expressions (from 0 to 1) (default frame)
init 0 ..FV……. eval expressions once during initialization
frame 1 ..FV……. eval expressions per-frame
shortest <boolean> ..FV……. force termination when the shortest input terminates (default false)
format <int> ..FV……. set output format (from 0 to 7) (default yuv420)
yuv420 0 ..FV…….
yuv420p10 1 ..FV…….
yuv422 2 ..FV…….
yuv422p10 3 ..FV…….
yuv444 4 ..FV…….
rgb 5 ..FV…….
gbrp 6 ..FV…….
auto 7 ..FV…….
repeatlast <boolean> ..FV……. repeat overlay of the last overlay frame (default true)
alpha <int> ..FV……. alpha format (from 0 to 1) (default straight)
straight 0 ..FV…….
premultiplied 1 ..FV…….
framesync AVOptions:
eof_action <int> ..FV……. Action to take when encountering EOF from secondary input (from 0 to 2) (default repeat)
repeat 0 ..FV……. Repeat the previous frame.
endall 1 ..FV……. End both streams.
pass 2 ..FV……. Pass through the main input.
shortest <boolean> ..FV……. force termination when the shortest input terminates (default false)
repeatlast <boolean> ..FV……. extend last frame of secondary streams beyond EOF (default true)
This filter has support for timeline through the ‘enable’ option.
—————————-
#ffmpeg -i test-0.mp4 -vf ‘movie=filename=sea.mp4,scale=w=iw/3:h=ih/3[watermarker];[in][watermarker]overlay=x=0:y=0’ -f mp4 $(date +%Y%m%d)_output_$(date +%H%M%S).mp4
#ffmpeg -i input_0.jpg -i input_1.jpg -filter_complex ‘[1:v]scale=w=iw/1:h=ih/1[v1];[0:v][v1]overlay=x=0:y=70’ -strftime 1 -f image2 %Y%m%d_output_%H%M%S.jpg
#ffmpeg -i fuzhou.mp4 -i seas1.mp4 -i seas2.mp4 -i seas3.mp4 ‘[0:v]pad=width=iw*2:height=ih*2[a];[a][1:v]overlay=x=w[b];[b][2:v]overlay=x=0:y=h[c];[c][3:v]overlay=x=w:y=h’ -f mp4 $(date +%Y%m%d)_output_$(date +%H%M%S).mp4