Skip to content

Instantly share code, notes, and snippets.

Created January 13, 2023 05:29
What would you like to do?
Bulk converts movies for my jellyfin server. Converts them all into a universal h.264 mp4 aac web format that should (theoretically) run on any device. It accepts any FFMPEG-capable format, and it will automatically skip conversion if the output file already exists, to save time.
shopt -s globstar
mkdir "$dest_dir"
for f in "${src_dir}"/**/*.*; do
ffmpeg -n -i "$f" -c:v libx264 -preset slower -pix_fmt yuv420p -movflags faststart -c:a aac -ar 44100 -b:a 256k -f mp4 "${dest_dir}/${name%.*}.mp4"
Copy link

MisterSirCode commented Jan 13, 2023

This script is EXTREMELY slow. I made this for my own purpose to create high quality web-ready videos. I do not recommend using it unless you have a small library / a very powerful PC.

If you can avoid using it, do so.

Copy link

Do not use this for non-english shows. Im working on a separate script for remuxing anime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment