Я пытаюсь загрузить и проанализировать файл субтитров .srt в VB.net
. Это очень простой текстовый файл, но у меня возникли трудности.
Вот структура:
Hide Copy Code
1
00:00:01,600 --> 00:00:04,200
English (US)
2
00:00:05,900 --> 00:00:07,999
This is a subtitle in American English
Sometimes subtitles have 2 lines
3
00:00:10,000 --> 00:00:14,000
Adding subtitles is very easy to do
- Число
- Затем следует время начала и окончания
- за которым следует текст, который может состоять из 1 или нескольких строк
Что я действительно пытаюсь сделать, так это найти продолжительность файла субтитров во времени, то есть найти время последнего окончания файла субтитров. Я создаю программу, которая жестко кодирует субтитры к видеофайлу, поэтому мне нужно знать, как долго должно быть видео, исходя из длины файла субтитров.
Результат, который я ищу:
После прочтения файла .srt узнать «длину» файла .srt во времени, то есть последний временной код. В приведенном выше примере это будет: 00:00:14,000, когда субтитры отображаются в последний раз.