.bat script utilising FfMPEG not running

FFMPEG .bat script not running when I double click on the script file. It tries to open for a millisecond, and then just disappears. My videos are in .MP4 format same as in the script.

Here is the script:

FOR /F *tokens=*" %%G IN ('dir /b *.mp4') DO ffmpeg -i "%%G" -vf fade=in:0:d=5 -af afade=in:0:d=5 "%%~nG_1.mov"

And this is the result I am getting when I paste script to the CMD in folder:

*" %%G IN ('dir /b *.mp4') DO ffmpeg -i "%%G" -vf fade=in:0:d=5 -af afade=in:0:d=5 "%%~nG_1.mov" was unexpected at this time.

  • what happens when you open a cmd window and run your script from there?

    – 

There is a typo *tokens=*" should be "tokens=*"

try this

FOR /F "tokens=*" %%G IN ('dir /b *.mp4') DO ffmpeg -i "%%G" -vf fade=in:0:d=5 -af afade=in:0:d=5 "%%~nG_1.mov"

Leave a Comment