This tutorial shows two methods: burn subtitles into the image or add them as a selectable subtitle track in MP4.
Install FFmpeg (if not already installed):
sudo apt-get install ffmpegbrew install ffmpegPrepare your files
Put your video and subtitle file (for example
subtitles.srtinput.mp4subtitles.srtBurn subtitles into video (hard subtitles)
If subtitles should always be visible, use:
ffmpeg -i input.mp4 -vf "subtitles=subtitles.srt" -c:a copy output-with-subs.mp4
This re-encodes video because text is rendered into the image.
Add subtitles as selectable track (soft subtitles)
If subtitles should be on/off switchable, use:
ffmpeg -i input.mp4 -i subtitles.srt -c:v copy -c:a copy -c:s mov_text output-softsubs.mp4
This keeps the video stream and adds a subtitle track.