I have several video files in a directory and I want to convert all of them into other video formats.
Is there any way that I can convert all of them in just one go using FFMPEG. I mean without having to make a shell script for doing so.
2 Answers
The easiest way would be to use a for loop of your shell of choice. This task is so simple, you can just use the prompt, there's no need to create a shell script.
Here is the one-liner as an example for the widely-used bash (and compatible):
for i in *.mkv; do ffmpeg -i "$i" … ;done
I just did such a conversion starting from Marco's solution. I added changing the file extension, in my case, from .mp4 to .mp3:
#!/bin/bash
for i in *.mp4; do ffmpeg -i "$i" -codec:a mp3 "mp3/${i%.mp4}.mp3";done
for
loop?for i in *.mkv;do ffmpeg -i "$i" …;done