FFMPEG command line operation_add watermark
Download ffmpeg and configure environment variables
ffmpeg
Download the latest release package on the official website
Unzip and bin
add the path to the system environment variable
Test for success using the command line
$ ffmpeg.exe -version
Returning the version information means that the system environment variable has taken effect, and
the ffmpeg command line can be used
Add watermark to video using ffmpeg command line
Prepare the following materials first
- original video source
- watermark image
My local video source is:realshort.mp4
The watermark image is:tree_s.png
$ ffmpeg.exe -i realshort.mp4 -i tree_s.png -filter_complex "overlay=5:5" out.mp4
Briefly explain the concept of the above command line parameters
ffmpeg.exe
Naturally, it is the ffmpeg program;
-i
Then specify the input file;
-filter_complex
Complex filters, usually used when there are multiple input files. We have two input files here;
"overlay=5:5"
overlay
The format of the filter command:
overlay[=x:y[[:rgb={0, 1}]]
Function description: the foreground window (second input) covers the specified position of the background window (first input)
out.mp4
, and finally the name of the specified output file
Run the successful output video
Video effect: