0

I use ffmpeg -i FILE_NAME -vf fps=1/1 FILE_NAME%05d.jpg -hide_banner to convert a single file to several images which keep the file name followed by 5 zeros, a counter and then ends with a .jpg.

How do I do the same thing to all, let's say .mov, files in a single folder, keeping the file naming convention the same?

I understand there will be a loop and a *.mov to select all files in the folder but I'm lost in the naming convention part.

1
for FILE_NAME in *.mov
do
    ffmpeg -i "$FILE_NAME" -vf fps=1/1 "$FILE_NAME"%05d.jpg -hide_banner
done

This will result in output files named like something.mov00000.jpg. To remove the .mov or any other file type ending you can do

for FILE_NAME in *.mov
do
    ffmpeg -i "$FILE_NAME" -vf fps=1/1 "${FILE_NAME%.*}"%05d.jpg -hide_banner
done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.