Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

FFMPEG command works in PowerShell but not in a batch file

Simply trying to extract frames from a video file using ffmpeg in a .bat file and it doesn’t work:

ffmpeg -i video.mp4 -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 tmp_frames/frame%08d.jpg

The error message:

Unable to find a suitable output format for ‘.\tmp_frames\frameC:\Test’
.\tmp_frames\frameC:\Test: Invalid argument

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This command works fine in PowerShell by itself, but running it as a batch file yields the above error.

Any ideas on how to fix this in the batch file?

>Solution :

In the .bat file, you must use the escape code for %, which is %%

ffmpeg -i video.mp4 -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 tmp_frames/frame%%08d.jpg
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading