0

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

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?

2 Answers 2

4

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
Sign up to request clarification or add additional context in comments.

Comments

2

...frame%08d.jpg : %0 will be replaced by the current batchfile name, hence '.\tmp_frames\frameC:\Test'

3 Comments

Is there an alternative I can use that won't do that?
Possibly, but I've no idea what you want in place of %08... What is it intended to do?
It's an ffmpeg command that basically turns the current iterating frame in the video file into a PNG file.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.