如何将文本转换为字幕的时间

如何将文本转换为字幕的时间

我有一个视频,时长 6 小时 31 分钟,我想从 YouTube 获取字幕,但我无法做到,因为他们只截取 1 小时的视频。我已将每小时的每个视频上传到 YouTube 以获取字幕。

不过,我已将字幕放在一起,并从每个视频中删除了每个字幕文件的计时。

以下是该文件的列表:

was a salesman



again and saw how they can see how they
got because I love buying stuff right



see gotta love to buy stuff



right from people that love to sell
stuff that's number one number two



buy stuff often from people that are
good at selling stuff



right and the number three just do what
they did



right you're in a little



by seeing me sell today and I it's gonna
be a you know the minority of what I'm



doing
...etc

我想把它们转换成时间:

1
00:00:00,099 --> 00:00:03,144
was a salesman

2
00:00:03,549 --> 00:00:06,590
again and saw how they can see how they
got because I love buying stuff right

3
00:00:06,959 --> 00:00:08,550
see gotta love to buy stuff

4
00:00:08,055 --> 00:00:11,092
right from people that love to sell
stuff that's number one number two

5
00:00:11,092 --> 00:00:14,133
buy stuff often from people that are
good at selling stuff

6
00:00:15,033 --> 00:00:18,035
right and the number three just do what
they did

7
00:00:18,053 --> 00:00:22,114
right you're in a little

8
00:00:23,014 --> 00:00:26,111
by seeing me sell today and I it's gonna
be a you know the minority of what I'm

您知道如何将文本转换为时间吗?

我曾尝试将文本放入 youtube 上的计时中,但是它不允许我这样做,因为视频太大。它将能够进行 2 小时的计时。

答案1

由于您已删除计时,因此无法为每个视频重新创建计时并保持同步。您应该保留每个小时字幕片段的计时,并从前一个字幕的结尾调整每个后续字幕的计时。

如果第一个小时的字幕结束于 01:01:10.000,而下一组字幕开始于 00:00:01.544,那么可以使用字幕编辑等程序将其更改为 01:01:11.554 (01:01:10.000 + 00:00:01.554)。然后字幕就可以合并并与电影同步。

获取字幕的另一种方法是使用 FFMPEG:

对于 ASS 字幕“c:\PathToFFMPEG\ffmpeg.exe”-i“c:\PathToVideo\VideoFile.mp4”-vn -an -map 0:TrackIDtoExtract>-c:s:0 ass“NewSub.ass”

对于 SRT 字幕“c:\PathToFFMPEG\ffmpeg.exe”-i“c:\PathToVideo\VideoFile.mp4”-vn -an -map 0:TrackIDtoExtract -c:s:0 srt“NewSub.srt”

要列出曲目,请使用“c:\PathToFFMPEG\ffmpeg.exe”-i“c:\PathToVideo\VideoFile.mp4”

例如:“c:\user\xxx\desktop\ffmpeg.exe”-i“c:\user\xxx\desktop\VideoFile.mp4”-vn -an -map 0:2 -c:s:0 srt“c:\user\xxx\desktop\NewSub.srt”

相关内容