Created
January 13, 2023 05:29
-
-
Save MisterSirCode/8256289300b02a5764525cebb007fd66 to your computer and use it in GitHub Desktop.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
shopt -s globstar | |
src_dir="MoviesSource" | |
dest_dir="Movies" | |
mkdir "$dest_dir" | |
for f in "${src_dir}"/**/*.*; do | |
name=${f##*/} | |
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" | |
done |
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
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.