简体   繁体   English

FFMPEG多个styles in.srt文件

[英]FFMPEG multiple styles in .srt file

I have an SRT file and want to change the background color and level of transparency for individual tracks.我有一个 SRT 文件,想更改各个轨道的背景颜色和透明度。 Is this possible, or would I have to adopt a more advanced format?这可能吗,还是我必须采用更高级的格式? Would this task even work in FFMPEG?这个任务甚至可以在 FFMPEG 中工作吗?

1
0:0:1,440 --> 0:0:1,970  Y1:20
<font color="#FF1F497D">{\an2}the settlement?</font>
2
0:0:2,640 --> 0:0:3,150  Y1:20
<font color="#FFC0504D">{\an2}Yes.</font>
3
0:0:3,740 --> 0:0:4,690  Y1:20
<font color="#FFFFFFFF">{\an2}Have you been waiting long?</font>

Use ASS format.使用 ASS 格式。 It's more advanced and more complicated but it can do what you want.它更先进,更复杂,但它可以做你想做的事。

在此处输入图像描述

You can use Aegisub to make or convert the subtitles.您可以使用Aegisub制作或转换字幕。

Or ffmpeg can convert SRT to ASS and you can manually add tags .或者ffmpeg可以将 SRT 转换为 ASS,您可以手动添加标签

ffmpeg -i input.srt output.ass

Example ASS file:示例 ASS 文件:

[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
ScriptType: v4.00+
PlayResX: 384
PlayResY: 288
ScaledBorderAndShadow: yes

[Aegisub Project Garbage]
Last Style Storage: Default

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,16,&H00FFFFFF,&H00FFFFFF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,3,1,0,2,10,10,10,0

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:01.44,0:00:01.97,Default,,0,0,0,,{\c&H00FFFF&\3a&H80&\3c&HFF00FF&}the settlement?{\c}
Dialogue: 0,0:00:02.64,0:00:03.15,Default,,0,0,0,,{\c&H50C0FF&\3a&HA2&\3c&H00FF00&}Yes.{\c}
Dialogue: 0,0:00:03.74,0:00:04.69,Default,,0,0,0,,{\c&HFFFFFF&\3a&H80&\3c&HFF00FF&}Have you been waiting long?{\c}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM