1

The following works in command line but not in a batch file:

ffmpeg -i ext_%04d.jpg video.mp4

%0 is parsed as a variable and I can't figure out how to handle it. Is it even possible?

edit : I know how escaping and % work, like in for loops etc, but if I do : SET "var=ffmpeg -i ext_%%04d.jpg video.mp4", it still doesn't work.

1

2 Answers 2

3

Use the double percent sign - %% - like this :

ffmpeg -i ext_%%04d.jpg video.mp4
4
  • I already tried playing with double percent and escaping, but it returns an error each time. I'm not a beginner at CMD and this is frustrating.
    – ilko
    Oct 10, 2018 at 23:13
  • the following in batch doesn't work : SET "Var=ffmpeg -i ext_%%04d.jpg video.mp4" echoing this displays only one %, but ffmpeg still returns an error
    – ilko
    Oct 10, 2018 at 23:14
  • What is the error and why doesn't ffmpeg like the command?
    – harrymc
    Oct 11, 2018 at 7:54
  • "Could not get frame filename number 2 from pattern 'c:\enc\ext2.mp4' [this is the output] (either set update or use a pattern like %03d within the filename pattern)"
    – ilko
    Oct 11, 2018 at 16:49
0

Okay, I've found out that "-f image2" was causing the error in the command. Seems like it's not the proper format for converting images to video.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .