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@phil:~/videos$ time reMuxToMP4 test.mkv
[x] reMuxToMP4 script, v0.5.2, written by Phil Dufault
[x] Contact him at: http://www.dufault.info
[x] Source filename: test.mkv
[x] Destination filename: test.mp4
[x] Video stream found, 624 x 320 @ 23.976 fps, using ffh264
[x] Audio stream found, 2 audio channels, using mad
[x] Muxed in mkv format, source file is 38MB
[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] Changing the h264 video stream profile from 5.1 to 4.1...success
[x] Deleting the old video source...success
[x] Moving new video stream to proper filename...success
[x] Muxing video stream at 23.976 fps...success
[x] Muxing the audio stream in...success
[o] All done!
Here’s a link to the source:
remuxtomp4
EDIT: I’ve updated the source to use mp4creator. Please let me know if this is working with your 360′s.
EDIT: v0.5.3r1 released, contains patches found in comments.
{ 52 comments… read them below or add one }
← Previous Comments
The mpeg4ip-server package (and thus mp4creator) has been removed from ubuntu oneiric, the version of mplayer they are shipping also seems to struggle with the audio extraction phase. Any chance of getting that github repo up so we can contribute patches to deal the new issues (maybe revert back to mp4box & ffmpeg, or add them as cmdline options). I also have a very minor patch, but its probably easier to add via github than blog comments.
Apologies for my tardy response. GitHub repo created:
https://github.com/pdufault/reMuxToMP4
← Previous Comments