Same command, many files
Once a single FFmpeg command works on one file, batching it across a folder is a 3-line shell loop. There are three patterns worth knowing.
- Bash for-loop — readable, sequential, easy to interrupt.
- find + -exec — robust to weird filenames, recursive, single command per file.
- GNU parallel — runs N jobs at once. Speedup is dramatic when each encode is CPU-bound.
Always quote filenames
Spaces and special characters in filenames are the #1 source of broken batch scripts. Always quote "$f", never bare $f. Test on a folder with one file containing a space before you point it at 200 files.