Home » Questions » Computers [ Ask a new question ]

Repackage m4v file

Repackage m4v file

I have some m4v files I made with Handbrake where the AC3 audio channel was the first one, and the stereo was the second. This causes problems with some things (like Quicktime) so I want to repackage the file such that the stereo track is the first audio track. I don't want to re-encode things.

Asked by: Guest | Views: 203
Total answers/comments: 1
Guest [Entry]

"Get MP4BOX and do it in a couple of passes.

First, get a good look at the streams in file, you will need to know their numbers so you can extract them appropriately:

mp4box -info media_file.m4v

Next, you will want to extract the individual streams:

mp4box -raw 1 media_file.m4v
mp4box -raw 2 media_file.m4v
etc...

Finally, you will want to reassemble the streams into a new container. Make special note that you may need to adjust the fps - MP4BOX defaults to 25fps. The info command from step 1 should include the relevant info

mp4box -add media_file.x264 -add media_file.aac -add media_file.ac3 -fps 23.976 new_output_container.m4v

For good measure, you may want to also take advantage of the new itags support to inject a bit of metadata into your m4v container:

mp4box -itags ""name=Your Great Movie"" new_output_container.m4v"