ffmpeg字幕背景问题当多行(使用.srt格式)时

发布于 2025-01-25 15:36:46 字数 631 浏览 2 评论 0原文

当使用ffmpeg burn .srt字幕mp4文件时,我遇到了多个文本行的问题 - 背景是彼此覆盖的。

命令我正在使用:

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

”在此处输入图像描述”

问题是 - 在使用.srt格式时仍然具有透明的背景,或者我需要使用时,可以克服覆盖层。 .ass格式作为修复?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酒儿 2025-02-01 15:36:46

您可以通过使用borderstyle = 4BackColour =& h80000000一起避免彼此覆盖的多条线,从而提供50%不透明的黑色背景。

完整命令将是:

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

“在此处输入图像描述”

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文