Created
December 23, 2010 00:27
-
-
Save silvein/752363 to your computer and use it in GitHub Desktop.
A bash function (I keep it in my .bash_profile) for remuxing mkv files to mp4
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
function mkv2mp4 { | |
INPUT_FILE="$1" | |
OUTPUT_FILE="${INPUT_FILE%.*}.mp4" | |
if [[ "" == "${INPUT_FILE}" ]]; then echo "Usage: mkv2mp4 <file.mkv>" && return 1; fi | |
if [[ ! -f "${INPUT_FILE}" ]]; then echo "Argument not a file." && return 1; fi | |
if [[ -f "${OUTPUT_FILE}" ]]; then echo "Output file '$OUTPUT_FILE' already exists." && return 1; fi | |
ffmpeg -vcodec copy -acodec copy -map_meta_data outfile:infile -i "${INPUT_FILE}" "${OUTPUT_FILE}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment