1

While using ffmpeg to burn .srt subtitles to mp4 files I'm having an issue with multiple text lines - background is overlaying each other.

Command I'm using:

ffmpeg -i source_video_path.mp4 -vf "subtitles=srt_source.srt:force_style='OutlineColour=&H80000000,BorderStyle=3,Outline=1,Shadow=0,MarginV=25,Fontname=Arial,Fontsize=10,Alignment=2'" video_destination.mp4

enter image description here

Question is - is it possible to overcome the overlay while still having a transparent background while using .srt format or I need to use .ass format as a fix?

Dr. House
  • 483
  • 7
  • 23
  • 1
    Actually, `.ass` format doesn't support custom linespacing either (not to mention `libass` library is used for the both formats. Anyway, I found [this article](https://www.md-subs.com/line-spacing-in-ssa) if you decide to explorer `.ass` and haven't seen it before. – kesh May 03 '22 at 01:42

1 Answers1

0

You can avoid multiple lines overlaying each other by using BorderStyle=4 together with BackColour=&H80000000 which gives a 50% opaque black color background.

Full command would be:

ffmpeg -i source_video_path.mp4 -vf "subtitles=srt_source.srt:force_style='OutlineColour=&H80000000,BorderStyle=4,BackColour=&H80000000,Outline=0,Shadow=0,MarginV=25,Fontname=Arial,Fontsize=10,Alignment=2'" video_destination.mp4

enter image description here

Dr. House
  • 483
  • 7
  • 23