现在有能将 vtt 正确转换为 srt 或其他常见字幕格式的工具吗?

2017-08-10 16:28:40 +08:00
 wby238

以前在 u2b 下的 vtt 都是简单处理下就能变成 srt 的,但最近下载的自动字幕的格式跟 write-sub 的格式差了很远,有没有工具 /方法能处理? 下面是自动字幕的 vtt 示例:

WEBVTT
Kind: captions
Language: en
Style:
::cue(c.colorCCCCCC) { color: rgb(204,204,204);
 }
::cue(c.colorE5E5E5) { color: rgb(229,229,229);
 }
##

00:00:01.310 --> 00:00:05.609 align:start position:19%
what<00:00:02.310><c> is</c><00:00:02.399><c> going</c><c.colorCCCCCC><00:00:02.610><c> on</c><00:00:02.669><c> everybody</c><00:00:02.879><c> and</c><00:00:03.120><c> welcome</c></c>

00:00:03.270 --> 00:00:07.950 align:start position:19%
to<c.colorE5E5E5><00:00:03.449><c> part</c></c><c.colorCCCCCC><00:00:03.689><c> 7</c><00:00:04.230><c> of</c></c><c.colorE5E5E5><00:00:04.380><c> our</c><00:00:04.529><c> Python</c><00:00:05.040><c> plays</c></c><c.colorCCCCCC><00:00:05.279><c> grand</c></c>
7633 次点击
所在节点    问与答
5 条回复
yuwan
2017-08-10 17:42:22 +08:00
我也遇到了这个问题,所以写了一个命令行工具 [vtt-srt]( https://www.npmjs.com/package/vtt-srt)
yuwan
2017-08-10 17:42:41 +08:00
安装:`npm install vtt-srt -g`
然后再到字幕所在文件夹下运行 `vtt-srt` 即可
wby238
2017-08-10 19:56:30 +08:00
@yuwan 我试了一下,但好像只是单纯将 vtt 的后缀改为 srt 而已啊。这样的话字幕体验还是很糟糕。

转换后的示例:
```
WEBVTT
Kind: captions
Language: en
Style:
::cue(c.colorCCCCCC) { color: rgb(204,204,204);
}
::cue(c.colorE5E5E5) { color: rgb(229,229,229);
}
##

00:00:01.310 --> 00:00:05.609 align:start position:19%
what<00:00:02.310><c> is</c><00:00:02.399><c> going</c><c.colorCCCCCC><00:00:02.610><c> on</c><00:00:02.669><c> everybody</c><00:00:02.879><c> and</c><00:00:03.120><c> welcome</c></c>

00:00:03.270 --> 00:00:07.950 align:start position:19%
to<c.colorE5E5E5><00:00:03.449><c> part</c></c><c.colorCCCCCC><00:00:03.689><c> 7</c><00:00:04.230><c> of</c></c><c.colorE5E5E5><00:00:04.380><c> our</c><00:00:04.529><c> Python</c><00:00:05.040><c> plays</c></c><c.colorCCCCCC><00:00:05.279><c> grand</c></c>
```
yuwan
2017-08-10 20:54:35 +08:00
请问你是什么播放器呢,我测一下
目前我用 movist 和 iina player 都无任何问题
wby238
2017-08-10 21:31:54 +08:00
@yuwan potplayer

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/381967

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX