Skip to content

Instantly share code, notes, and snippets.

@barooney
Last active June 19, 2018 05:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barooney/0ace6e432bcb85e298f79a1c3d7086ce to your computer and use it in GitHub Desktop.
Save barooney/0ace6e432bcb85e298f79a1c3d7086ce to your computer and use it in GitHub Desktop.
Add subtitles to video file.
#!/bin/bash
# run with ./add-subtitles.sh video.mp4 subtitles.srt output.mp4
VIDEO_FILE=$1
SUBTITLE_FILE=$2
OUTPUT_FILE=$3
echo "Muxing " $VIDEO_FILE " and " $SUBTITLE_FILE " into " $OUTPUT_FILE "..."
ffmpeg -i $VIDEO_FILE -i $SUBTITLE_FILE -c:a copy -c:v copy -c:s mov_text $OUTPUT_FILE
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment