Skip to content

Instantly share code, notes, and snippets.

@mohd-akram
Last active January 20, 2023 08:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mohd-akram/536eb5d980ffd1b18476c3a6a8b3c8ab to your computer and use it in GitHub Desktop.
POSIX shell script to convert MKV file to MP4 using ffmpeg
#!/bin/sh
set -eu
if [ $# = 0 ]; then
printf "usage: %s file [opts]\n" "$(basename "$0")" >&2
exit 2
fi
f=$1
shift
if gpac -i "$f" inspect | grep -q DolbyVision; then
set -- -ab dby1 "$@"
fi
set -x
MP4Box -new -brand mp42 "$@" -add "$f" "${f%.*}.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment