How to include special characters as text while watermarking video using ffmpeg?

779 Views Asked by At

Using the below command to add watermark in a video:

ffmpeg -i inputClip.mp4 -vf "drawtext=text='©Krishna':x=640:y=360:fontsize=24:fontcolor=white" -c:a copy output.mp4

I am not able to add certain special characters as text here like %,",' etc..

Can anyone let me know, if there are any limitations to it? Please share the reliable source as well.

1

There are 1 best solutions below

0
On

Easy method is to put the string into a text file then use the textfile option in drawtext instead of text:

ffmpeg -i inputClip.mp4 -vf "drawtext=textfile=text.txt:x=640:y=360:fontsize=24:fontcolor=white" -c:a copy output.mp4

Otherwise you have escape each special character. This is tedious. See FFmpeg Quoting and Escaping.