0

I am having a command to convert mkv files in a folder to mp4. When I try to add watermark to the converted files, it works fine in cmd prompt but when I run it in batch file it gives me an error saying Error initializing filter 'drawtext' with args. Following is the ffmpeg command:

ffmpeg -y -r 20 -i %~d1%~p1%~n1.mkv -vf "drawtext=text='Watermark Text':x=10:y=H-th-10:fontfile=/Windows/Fonts/Calibri.ttf:fontsize=45:fontcolor=white@0.2: x=(w-text_w)/2: y=(h-text_h)/2" -c:v libx264 -preset ultrafast -b:v 1000k %~d1%~p1%~n1

Where am I wrong?

0

Try to use escape character for batch file:

ffmpeg -y -r 20 -i %~d1%~p1%~n1.mkv -vf ^"drawtext=text='Watermark Text':x=10:y=H-th-10:fontfile=/Windows/Fonts/Calibri.ttf:fontsize=45:fontcolor=white@0.2: x=(w-text_w)/2: y=(h-text_h)/2^" -c:v libx264 -preset ultrafast -b:v 1000k %~d1%~p1%~n1
1
  • Adding escape character didnt do the trick. In report im getting, Error initializing filter 'drawtext' with args 'text=Watermark Text:x=10:y=H-th-10:fontfile=/Windows/Fonts/Calibri.ttf:fontsize=45:fontcolor=white@0.2: x=(w-text_w)/2: y=(h-text_h)/2' Error reinitializing filters! – Hadley V Sunny Apr 11 '18 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.