How to set background to subtitle in ffmpeg?

后端 未结 6 1498
陌清茗
陌清茗 2020-12-14 23:14

It is described here how ot burn a srt file into a video. However, I want to put a semi-transparent background to the subtitles so that the texts can be read more easily. H

6条回答
  •  遥遥无期
    2020-12-14 23:42

    Had the same question, no good answer was found. Apparently ffmpeg (and avconv know how to apply ass formatting to srt like this:

    avconv -i in.mp4 -vf "subtitles=subtemp.sub.0.sub:force_style='Name=Default,Fontname=Arial,Fontsize=28,PrimaryColour=&Hffffff,SecondaryColour=&Hffffff,OutlineColour=&H44000000,BackColour=&H0,BorderStyle=3,Shadow=0'" out.mp4
    

    (replacing avconv with ffmpeg should work, or close to it).

    Further reading about ass, specifically what seems to matter are BackColour and BorderStyle.

提交回复
热议问题