Gå til hovedinnhold

Innlegg

Viser innlegg fra 2021

A simple script to convert all subfolders containing avi-files to mp4 using ffmpeg

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: #!/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 Run the skript in the directory with all the subfolders using: sh ffmpeg-subfolder-convert.sh