Use ffmpeg command line operation_add watermark

FFMPEG command line operation_add watermark

Download ffmpeg and configure environment variables


ffmpegDownload the latest release package on the official website
insert image description here

Unzip and binadd the path to the system environment variable
insert image description here

Test for success using the command line

$ ffmpeg.exe -version

insert image description here

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

insert image description here

My local video source is:realshort.mp4
insert image description here

The watermark image is:tree_s.png

insert image description here

$ 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.exeNaturally, it is the ffmpeg program;

-iThen specify the input file;

-filter_complexComplex filters, usually used when there are multiple input files. We have two input files here;

"overlay=5:5"
overlayThe 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


insert image description here

Video effect:

insert image description here

Guess you like

Origin blog.csdn.net/Stephen8848/article/details/124460497