Skip to content

Instantly share code, notes, and snippets.

@somq
Created September 12, 2020 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somq/53f1d26934dd5b198c96a1d812d9cf5b to your computer and use it in GitHub Desktop.
Save somq/53f1d26934dd5b198c96a1d812d9cf5b to your computer and use it in GitHub Desktop.
Convert x264 to x265 files found in a folder with ffmpeg
#!/bin/bash
FOLDER=$PWD/*.mkv
for filename in $FOLDER; do
echo "Processing $filename file..."
INPUT=$filename
OUTPUT="${filename/.mkv/_x264.mkv}"
echo "Processing echo "${filename/.mkv/_x264.mkv}" file..."
ffmpeg -y -i $INPUT -c:v libx264 -crf 18 -c:a copy $OUTPUT
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment