Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Add watermark to FFmpeg

Shulou Source: shulou.com Published: 2022-06-03 06:03:05 10月04日 Update

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

Tags: Watermark directory font width upper left corner copy time program problem color Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple OPPO Reno Shulou Information Docker Shulou Technology