我有一个输入像这样的:转换秒,并持续到SRT(字幕)时间格式(PHP)
start: 10 | duration: 1 | text: Subtitle Text 1
start: 15 | duration: 2 | text: Subtitle Text 2
start: 20 | duration: 3 | text: Subtitle Text 3
这是一个字幕的指令集,上面写着以下内容:
At 10 second of the video, show "Subtitle Text 1" for 1 seconds
At 15 second of the video, show "Subtitle Text 2" for 2 seconds
At 20 second of the video, show "Subtitle Text 3" for 3 seconds
这输入需要转换成SRT格式,所以它变成这样的:
1
00:00:10,000 --> 00:00:11,000
Subtitle Text 1
2
00:00:15,000 --> 00:00:17,000
Subtitle Text 2
3
00:00:20,000 --> 00:00:23,000
Subtitle Text 3
是否有可能有人向我展示如何使用PHP将任何给定的秒值转换为SRT格式(00:00:00,000)?
这就是我真正需要的,剩下的我可以弄清楚自己。
非常感谢,非常感谢。