Skip to content

Instantly share code, notes, and snippets.

@dragonken
Forked from pwenzel/ffmpeg-mkv-to-mp4.sh
Created August 11, 2017 17:04
Show Gist options
  • Save dragonken/4a2b3ff9fbf8755a18c8d1216d54b914 to your computer and use it in GitHub Desktop.
Save dragonken/4a2b3ff9fbf8755a18c8d1216d54b914 to your computer and use it in GitHub Desktop.
MKV and AVI to MP4 Conversion for Apple TV
# See also https://trac.ffmpeg.org/wiki/Encode/AAC
# direct copy
ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4
# direct copy video, but convert audio to AAC with default variable bit rate
ffmpeg -i input.mkv -c:v copy -c:a aac -strict experimental output.mp4
# direct copy video, but convert audio to AAC with constant bit rate
ffmpeg -i input.mkv -c:v copy -c:a aac -strict experimental -b:a 320k output.mp4
# lossy but decent conversion with constant bit rate audio
# http://superuser.com/questions/525249/convert-avi-to-mp4-keeping-the-same-quality
ffmpeg -i input.avi -c:v libx264 -crf 19 -preset slow -c:a aac -strict experimental -b:a 192k -ac 2 out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment