Ryan (tekman) wrote,
Ryan
tekman

Convert 720p/ac3 mkv to 720p/aac iPad-compatible mp4/m4v on Mac OS X Snow Leopard

# Video is not transcoded, just demuxed/muxed
# Audio is downmixed to stereo with DRC 
#
# You need these tools:
# * mkvextract (to demux the Matroska file)
#   * http://www.bunkus.org/videotools/mkvtoolnix/
#   * Just install through MacPorts, it doesn't pull in anything annoying
# * a52dec (to decompress and downmix the ac3)
#   * http://liba52.sourceforge.net/
#   * Compile from source
# * faac (to recompress the audio to mp4a/aac)
#   * http://www.audiocoding.com/
#   * Compile from source
# * MP4Box (to remux into MPEG-4 container) 
#   * http://kurtnoise.free.fr/mp4tools/
#   * Pre-compiled standalone OS X executable

mkvextract tracks ${BASE}.mkv 1:${BASE}.ac3 2:${BASE}.264
a52dec -o wav ${BASE}.ac3 > ${BASE}.wav
faac -b 96 --mpeg-vers 4 -o ${BASE}.aac ${BASE}.wav
MP4Box -add ${BASE}.264:fps=23.976 -add ${BASE}.aac ${BASE}.m4v
rm ${BASE}.{264,ac3,wav,aac}
Update: Here's a gist of an mkv2m4v script that automates the process: http://gist.github.com/502844
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 7 comments