dufault.info

Ramblings of a phone weenie, Linux sysadmin, and other things geeky

11  03 2008

A Script to Remux MKV Videos Into MP4 Videos

I’ve written a script that dumps the audio and video from an mkv file, encodes the audio into a two channel AAC stream, and remuxes the audio/video into a MP4 wrapper so it’s playable on the Xbox 360. The script is Linux-only, obviously, written in bash using mplayer, normalize-audio, mencoder, MP4Box, mkvinfo, and mkvextract as tools.

It works pretty well:
phil@philDesktop:~/videos$ time reMuxToMP4 test.mkv
[x] reMuxToMP4 script, v0.5.0, written by jexxie
[x] Contact at: http://ubuntuforums.org/member.php?u=207388
[x] Source filename: test.mkv
[x] Destination filename: test.mp4
[x] Video stream found, 1280 x 720 @ 23.976 fps, using ffh264
[x] Audio stream found, 6 audio channels, using a52
[x] Muxed in mkv format
[x] Dumping the audio…success
[x] Normalizing the audio…success
[x] Encoding the audio to low-complexity AAC…success
[x] Extracting audio from MP4 container (silly neroAacEnc)…success
[x] Extracting the video from the mkv…success
[x] Muxing video at 23.976 fps…success
[x] Deleting audio and video tempfiles…success
[o] All done!
real 8m21.845s
user 3m58.467s
sys 0m39.446s

Here’s a link to the source:
remuxtomp4

Share and Enjoy:
  • Digg
  • del.icio.us
  • Mixx
  • StumbleUpon
  • Technorati

4 Comments

(Required)
(Required, will not be published)

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.

« Portait of the Google bot HTC Touch running android »