For future reference just use ffmpeg

Dec 28, 2015 · 133 words · 1 minute read ffmpegfile conversion

I had several gigabytes of video files in an ancient video format (AVI) that I wanted converted. QuickTime does not play well with AVI files so I immediately fired up VLC. After a few minutes of poking around I figured out that there wasn’t a good way of batch transcoding. There was the option to run VLC from the commandline but then I realized VLC was just a wrapper around other libraries and I might as well use those directly.

As it turns out this ended up being much less of a hassle than trying to figure out how commandline VLC works. For future reference, just use ffmpeg.

for file in *.avi
do
    echo $file
    ffmpeg -i "$file" -c:v libx264 -crf 19 -preset slow -c:a aac -strict experimental -b:a 192k -ac 2 "converted/${file/.avi/.mp4}"
done