Skip to content

Instantly share code, notes, and snippets.

@jamiew
Created March 7, 2013 18:56
Show Gist options
  • Save jamiew/5110703 to your computer and use it in GitHub Desktop.
Save jamiew/5110703 to your computer and use it in GitHub Desktop.
Adding subtitles and audio tracks to an MP4 video with MP4Box
# Add subtitle track
MP4Box -add minecraft_uncut.srt:lang=eng:layout=0x60x0x-1:group=2:hdlr="sbtl:tx3g" Minecraft2_mobile.mp4
# Add audio track
# 1. doesnt work in quicktime/itunes
MP4Box -add commentary_audio.aac Minecraft2_mobile.mp4
# 2. supposed to work in quicktime/itunes but doesn't seem to; :name at least is definitely not supported
MP4Box -add commentary_audio.aac:disable:group1:lang=en:name="Director's Commentary" Minecraft2_mobile.mp4
# --- Experiments ---
# Add individual tracks to one megafile
mp4box -add video.m4v:lang=en -add audio1.m4a:group=1:lang=en:name="Dolby Surround" -add audio2.m4a:disable:group1:lang=en:name="Director's Commentary" output.m4v
@wiricesk
Copy link

wiricesk commented Jan 7, 2015

From an article on how to add music or audio track to video, I found the tool which can help you do the above task.

The tool can easily add MP3, WAV, AAC, M4A, WMA, AC3, MP2, AIFF, CAF, QCP, APE, FLAC, DTS, RA, OPUS and more to video like MP4, MKV, AVI, MOV, FLV, WMV, MXF, WebM, ASF, DV, MPG, RM, AVCHD, SWF, MOD, MTS, OGV, 3GP, etc.

Try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment