Skip to content

Instantly share code, notes, and snippets.

@CrimsonGlory
Created March 8, 2017 03:02
Show Gist options
  • Save CrimsonGlory/7b7df26285389be6b30500992ce6b33f to your computer and use it in GitHub Desktop.
Save CrimsonGlory/7b7df26285389be6b30500992ce6b33f to your computer and use it in GitHub Desktop.
Burn (harcode) srt into mp4
Step 1. Download ffmpeg
(ffmpeg static builds: https://johnvansickle.com/ffmpeg/ )
Step 2. Make sure the SRT is valid:
Valid format:
1
00:00:00,000 --> 00:00:03,540
hi bla bla bla
Invalid:
1
00:00:00 --> 00:00:03
hi bla bla bla
Step 3. execute
ffmpeg -i video.mp4 -vf "subtitles=subfilename.srt" output.mp4
Bonus:
To download CC from youtube.
youtube-dl --all-subs http://www.youtube.com/watch?v=etc
It will download a vtt file. To convert it to srt
ffmpeg -i filename.vtt subtitle.srt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment