9

I have found out how ffmpeg can add image watermark at the bottom left of a video

ffmpeg -i "C:\test.mp4" -i "C:\test\watermark.png" -filter_complex "overlay=10:main_h-overlay_h-10" "C:\test-watermark.mp4"

but I am looking for a way to add text (white, 12px text, with black shadow to make the text readable) instead of an image. Can somebody help me?

Bálinth István
  • 93
  • 1
  • 1
  • 4

2 Answers2

27

Use the drawtext filter.

ffmpeg -i "C:\test.mp4"
 -vf "drawtext=text='Place text here':x=10:y=H-th-10:
               fontfile=/path/to/font.ttf:fontsize=12:fontcolor=white:
               shadowcolor=black:shadowx=5:shadowy=5"
"C:\test-watermark.mp4"
Gyan
  • 85,394
  • 9
  • 169
  • 201
0

Loop through all and watermark each file

    foreach ($f in Get-ChildItem){
$file_name=$f.Name.replace($f.Extension,"")
$file_ext=$f.Extension
$watermark_text='KARACHI AI - MEETUP # 16 | AI in Agriculture and Real Estate' 
ffmpeg -i $file_name$file_ext -vf "drawtext=text="$watermark_text":x=10:y=H-th-10:fontsize=40:fontcolor=white" -preset ultrafast $file_name"_WM"$file_ext}