Batch Processing Files in Directory with ffmpeg

Easy peasy…

Let’s say I have a bunch of .tiff files and I want to covert them to pngs:

The first thing to note is that we can make use of a loop structure in bash “for in”. It will designate a variable called “$file” for every “.tiff” file extension it finds. So if you run it in a directory with a bunch of .tiff files, it should loop every single one and run the ffmpeg command per file:

[pastacode lang=”bash” manual=”for%20file%20in%20*.tiff%3B%20do%20ffmpeg%20-i%20%22%24file%22%20%22%24%7Bfile%25.tiff%7D%22.png%3B%20done” message=”” highlight=”” provider=”manual”/]

NOTE: This site is all about helpful hints tricks and tips. The posts lately have been short on purpose. For one, I’m busy AF and don’t have the time to post anything of great detail. Additionally, I believe in simplicity. You can visit, find something helpful and move on with your life.

As always I appreciate your feedback, please leave a comment if you feel I’m leading people down a less than idea path or just comment because you like talking IDC.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.