Skip to content

Instantly share code, notes, and snippets.

@Shubhayu-Das
Created October 1, 2021 06:16
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 Shubhayu-Das/c22ec3bd5ac2683cbb06e133555af906 to your computer and use it in GitHub Desktop.
Save Shubhayu-Das/c22ec3bd5ac2683cbb06e133555af906 to your computer and use it in GitHub Desktop.
Script to run HEVC compression using FFmpeg
#!/usr/bin/env bash
name="$1"
# If there are subtitles, keep the part related to "s"
ffmpeg -i "$name" -c:v copy -map 0:v:0 -vcodec libx265 -crf 28 -map 0:a:0 -c:a copy -map 0:s:1 -c:s ass "temp.mkv"
echo "Initial size:"
du -h "$name"
echo "Compressed size:"
du -h temp.mkv
# rm "$name"
mv temp.mkv "$name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment