Skip to content

Instantly share code, notes, and snippets.

@pwenzel
Last active September 10, 2023 16:22
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save pwenzel/d6a0b54b120afac0bd1f to your computer and use it in GitHub Desktop.
Save pwenzel/d6a0b54b120afac0bd1f 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