Skip to content

Instantly share code, notes, and snippets.

@christian-blades-cb
Created July 24, 2023 19:58
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 christian-blades-cb/0355cc6f3de279ef115ff735bbbb961e to your computer and use it in GitHub Desktop.
Save christian-blades-cb/0355cc6f3de279ef115ff735bbbb961e to your computer and use it in GitHub Desktop.
HEVC with ffmpeg and GPU
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p ffmpeg
for v in "$@"; do
ffmpeg -i "$v" -map 0:v -map 0:a -c:v hevc_nvenc -preset slow -crf 25 -tag:v hvc1 -q:a 100 "${v%.*}--x265.mp4"
exitcode=$?
if [ -z "$NO_DELETE" ] && [ $exitcode -eq 0 ]; then
rm "$v"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment