I have a folder containing JPG images and need to re-size them to a different pixel width and height and save them to a different folder with the same file name as original

ffmpeg -i Original.JPG -vf scale=1200:900 output.JPG

this is the command i used to re-size a single image.But I need to do it for the bulk.

Any Help ?

  • I didn't knew that it is possible to resize JPEG with ffmpeg.exe! Thanks! – Kamil Nov 13 '14 at 20:32
  • Voted as a duplicate of a Windows question. Since you're not specifying your OS, it's hard to give an exact answer, but generally you should be looking at how to loop over all files in a directory and execute a command on them, which is fairly easy to find, I think. – slhck Nov 14 '14 at 5:36
  • 1
    Your Linux answer is here: superuser.com/questions/777782/… – slhck Nov 14 '14 at 5:37
  • In Linux shell script for f in *.png; do ffmpeg -i "$f" -vf scale=1200:900 "../another-folder/${f%%.png}.png"; done – 0xC0DEGURU Aug 10 at 13:47

You could write a simple Perl script that will do that for you. Check out this post which has a foreach loop which cycles through all the files in a directory. You could easily modify this and create a script to resize all your files.


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