How to set background to subtitle in ffmpeg?

后端 未结 6 1497
陌清茗
陌清茗 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条回答
  •  萌比男神i
    2020-12-14 23:42

    Create a png with a transparent box and a alpha channel in your favoured size. You can use e.g. gimp or photoshop.

    Then use this command:

    ffmpeg -i video.mp4 -i logo.png -filter_complex "[0:v][1:v]overlay=10:10" \
    -codec:a copy out.mp4
    

    where 10:10 is the distance from the upper left corner.

    After that you can insert your subtitles.

提交回复
热议问题