Add watermark to FFmpeg
Add watermark fengyuzaitu in the upper left corner
Ffmpegd.exe-I video.mp4-vf drawtext=fontfile=arial.ttf:text=fengyuzaitu output.mp4
Add watermark fengyuzaitu in the center
Ffmpegd.exe-I video.mp4-vf drawtext=fontfile=arial.ttf:x=w/2:y=h/2:text=fengyuzaitu output.mp4
Specify watermark color and width
Ffmpegd.exe-I video.mp4-vf drawtext=fontfile=arial.ttf:x=w/2:y=h/2:fontsize=24:fontcolor=yellow:text=fengyuzaitu output.mp4
Add the current timestamp
Ffmpegd.exe-I video.mp4-vf drawtext= "fontfile=arial.ttf:text='% {localtime\:% H\\:% M\:% S}'" output.mp4
Encounter problems
[Parsed_drawtext_0 @ 0000015FE818EE80] Cannot find a valid font for the family Sans
[AVFilterGraph @ 0000015FE6473A80] Error initializing filter 'drawtext' with args' fontfile=arial.ttf:text=fengyuzaitu'
Error reinitializing filters!
Failed to inject frame into filter network: No such file or directory
Error while processing the decoded data for stream # 0:1
Solve
Copy the required fonts from the C:\ Windows\ Fonts directory to the directory where the program executes