Question

I'm currently generating images of a video every X seconds (in this case, 1 image every minute). I have a command line that works perfectly, but I would like to make it work on batches of videos as opposed to each video individually. Is this possible? I've used PHP scripts on a batch of videos to generate one image at X seconds, but I'd like more than one image per video.

This is the command line that I use on individual videos:

ffmpeg -i INPUT.mp4 -f image2 -vf fps=fps=1/60 -b:v 64k OUTPUT-%05d.jpg

Was it helpful?

Solution

If you are using Bash:

for file in *.mp4; do ffmpeg -i ${file} -f image2 -vf fps=fps=1/60 -b:v 64k ${file}-%05d.jpg; done

This will take each file in the current directory with an extension of .mp4 and call the ffmpeg command on it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top