V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
wby238
V2EX  ›  问与答

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

  •  
  •   wby238 · 2017-08-10 16:28:40 +08:00 · 7514 次点击
    这是一个创建于 2457 天前的主题,其中的信息可能已经有所发展或是发生改变。

    以前在 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>
    
    5 条回复    2017-08-10 21:31:54 +08:00
    yuwan
        1
    yuwan  
       2017-08-10 17:42:22 +08:00
    我也遇到了这个问题,所以写了一个命令行工具 [vtt-srt]( https://www.npmjs.com/package/vtt-srt)
    yuwan
        2
    yuwan  
       2017-08-10 17:42:41 +08:00
    安装:`npm install vtt-srt -g`
    然后再到字幕所在文件夹下运行 `vtt-srt` 即可
    wby238
        3
    wby238  
    OP
       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
        4
    yuwan  
       2017-08-10 20:54:35 +08:00
    请问你是什么播放器呢,我测一下
    目前我用 movist 和 iina player 都无任何问题
    wby238
        5
    wby238  
    OP
       2017-08-10 21:31:54 +08:00
    @yuwan potplayer
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   768 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:34 · PVG 04:34 · LAX 13:34 · JFK 16:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.