This simple bash loop will go into each subfolders in the directory where you run the script and convert each avi-file to the mp4-container with the libx264 video codec and aac audio codec using ffmpeg:
- Create a new file, e.g. ffmpeg-subfolder-convert.sh and edit this file so it looks like this:
- Run the skript in the directory with all the subfolders using:
#!/bin/bash
for i in */*.avi;
do
ffmpeg -i "$i" -c:v libx264 -preset slow -crf 22 -c:a libfdk_aac -b:a 128k "$i".mp4 ;
done
sh ffmpeg-subfolder-convert.sh
Kommentarer