0

I have the following code which adds a small overlay text over my video:

ffmpeg -i video.mp4 -vf "drawtext=fontfile=path\font.ttf:text='ABC':fontcolor=black:fontsize=45:box=1:boxcolor=white@1:boxborderw=5:x=(w-text_w)/2:y=50:enable='gte(t,5)',drawtext=fontfile=path\font.ttf:text='DEF':fontcolor=black:fontsize=45:box=1:boxcolor=white@1:boxborderw=5:x=(w-text_w)/2:y=100:enable='gte(t,5)'" -codec:a copy output.mp4

I have around videos for which I want to do the same command. I have the 100 commands ready through excel formulas. Now, can someone please help me how I can execute these 100 FFMPEG commands as a batch file on Windows 11?

2 Answers 2

0

Open any txt file editor. Paste each command separated by newline each (press Enter). Save as .bat (not .bat.txt, so click 'All files'). Execute it by right click Run or Execute

Consider making the 100 commands in batch and not Excel next time.

0

You might also like to make a ".bat/.cmd" file that takes the file name as a parameter Note the %%1 is the input file and %%2 is the name of the output file =>addABC.bat

 ffmpeg -i %%1 -vf "drawtext=fontfile=path\font.ttf:text='ABC':fontcolor=black:fontsize=45:box=1:boxcolor=white@1:boxborderw=5:x=(w-text_w)/2:y=50:enable='gte(t,5)',drawtext=fontfile=path\font.ttf:text='DEF':fontcolor=black:fontsize=45:box=1:boxcolor=white@1:boxborderw=5:x=(w-text_w)/2:y=100:enable='gte(t,5)'" -codec:a copy output.mp4

Then you can use it like this =>

 addabc  video.mp4 output.mp4

its also possible to just use the input name and append something to it for the output file name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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