Last active
January 20, 2023 08:26
-
-
Save mohd-akram/536eb5d980ffd1b18476c3a6a8b3c8ab to your computer and use it in GitHub Desktop.
POSIX shell script to convert MKV file to MP4 using ffmpeg
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/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