如何读取.SUB文件? [英] How to read .SUB Files?

查看:53
本文介绍了如何读取.SUB文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图制作一个可以读取和编辑字幕的工具,我首先从读取和编辑.SRT文件开始,这很容易,但是很容易,但是当我转到下一个文件类型.SUB文件时,其格式为{ Showtime} {Hidetime} Text(例如{1234} 1235} Hello)我无法找出showtime或hide time的值是什么意思,所以我试图通过看电影的时间来弄清楚,最后将其除以25得到秒,效果很好,我也可以将其另存为.SRT,并且该文件可以在电影中以完美的时序运行,但是当我尝试与另一部电影一起使用时,由于该常数是22,所以它不起作用!
所以现在我真的很困惑,这个数字与电影记录的长度有关还是我只是在阅读方法上有误导性?
任何帮助将不胜感激.
这是代码的一部分:

I was trying to make a tool that reads and edits subtitles, I started by reading and editing .SRT files the most common and it was easy but when I cam to the next file type .SUB files which has the format of {Showtime}{Hidetime}Text(e.g {1234}1235}Hello) I was unable to find out what does the value of showtime or hide time mean I tried to figure out by watching the movie timing and ended up dividing it by 25 to get seconds, well it worked and I could also save it as .SRT and that file worked on the movie with perfect timing but when I tried that with another movie it didn''t work as the constant this time was 22!
So now I''m really confused about it, is the number related to the movie record length or am I just misleading in how to read it?
Any help would be appreciated.
That''s a piece from the code:

string showtimeStr = blockStr.Substring(blockStr.IndexOf('{') + 1, blockStr.IndexOf('}') - 1);
showtime = TimeSpan.FromSeconds(Convert.ToDouble(showtimeStr.Trim()) / 25);

推荐答案

检查帧号-25FPS非常正常.
Check against frame number - 25FPS is pretty normal.


这篇关于如何读取.SUB文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆