Skip to content

Instantly share code, notes, and snippets.

@abrman
Created June 20, 2021 19:49
Show Gist options
  • Save abrman/4221a1d567e9087fdc5012a152de5d4e to your computer and use it in GitHub Desktop.
Save abrman/4221a1d567e9087fdc5012a152de5d4e to your computer and use it in GitHub Desktop.
ffmpeg add srt to video file with solid black subtitle background
# Adds subtitles.srt to video.mp4 as solid black background, and saves as subbed_video.mp4
# via: https://stackoverflow.com/questions/25870169/how-to-set-background-to-subtitle-in-ffmpeg
# Options:
# OutlineContour=&AARRGGBB - [Alpha, Red, Green, Blue], Change Alpha value for semi-transparent background
# Outline=3 - Specifies the padding for the background rectangle.
ffmpeg -i video.mp4 -filter_complex "subtitles=subtitles.srt:force_style='OutlineColour=&000000000,BorderStyle=3,Outline=3,Shadow=0,MarginV=20'" subbed_video.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment