2

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?

1 Answer 1

3

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

2
  • How to increase the margins to have bigger outside area with those settings? While setting outline=5 I get funny looking outlines which are less transparent than that area which I wanted to get bigger.
    – Peter.k
    Feb 25 at 18:31
  • Ok, found the way. OutlineColour=&HFFFFFFFF,BorderStyle=4,BackColour=&H44FFFFFF,Outline=6,Shadow=0,MarginV=10. Increased outline and set outline color to full transparency.
    – Peter.k
    Feb 25 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.