.srt字幕格式如下:
ruby代码如下:
1 00:00:48,860 --> 00:00:51,400 站好,你不喜欢你的工作吗? 2 00:01:00,160 --> 00:01:01,540 食物 3 00:01:06,090 --> 00:01:08,090 你要去哪里? ....... |
ruby代码如下:
ruby 代码
- # param: time_str : string with "00:01:08,123" like format
- # param: offset : int, seconds to shift ahead
- def offset(time_str, offset)
- new_time = Time.parse(time_str) - offset
- format("%02d:%02d:%02d,%03d", new_time.hour,