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
@Frizlab
Copy link

Frizlab commented Jan 25, 2014

You, sir, just saved my life! :)

@mhanney
Copy link

mhanney commented Jul 3, 2014

Many thanks!

@growingmature
Copy link

I use iDealshare VideoGo to add subtitles to MP4, it also helps to add subtitles to other video like AVI, MKV, WMV, MOV, VOB and etc.

Step by step guide at http://www.idealshare.net/video-converter/add-subtitles-to-mp4.html

It has both Mac version and Windows version.

It even has the feature of extract subtitles from video or removing subtitles from video

Step by step guide on how to add audio track to video at http://www.idealshare.net/add-music-to-video.html

@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