srt

How can I modify this SRT file parser?

一曲冷凌霜 提交于 2021-02-11 14:41:42
问题 I found some good code for parsing .srt files on stackoverflow (Parsing SRT file with Objective C) shown below: NSScanner *scanner = [NSScanner scannerWithString:[theTextView string]]; while (![scanner isAtEnd]) { @autoreleasepool { NSString *indexString; (void) [scanner scanUpToCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:&indexString]; NSString *startString; (void) [scanner scanUpToString:@" --> " intoString:&startString]; (void) [scanner scanString:@"-->" intoString

How do I parse a .srt subtitle file

六眼飞鱼酱① 提交于 2020-06-17 15:29:26
问题 I'm trying to load and parse a .srt subtitle file in VB.net . It is a very simple text file, but I'm having difficulty. Here is the structure: 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 A number Followed by start and end time followed by the text which can be 1 or multiple lines What I'm really trying to do

Is it possible to extract SubRip (SRT) subtitles from an MP4 video with ffmpeg?

拥有回忆 提交于 2020-01-02 01:07:53
问题 I have checked the FFMpeg documentation and many forums and figured out the correct command-line to extract subtitles from an .MP4 video should look like so: ffmpeg -i video.mp4 -vn -an -codec:s:0 srt out.srt However, I get the following error, which lends me to question whether this is feasible at all: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height Using ffmpeg -codecs , I can confirm that ffmpeg should be able to

What is wrong with the subtitles format?(Video.js)

久未见 提交于 2019-12-13 03:45:44
问题 video.js says that there is an error while parsing the .srt subtitle file, here's the content: 1 00:01:14,909 --> 00:01:16,999 WOMAN 1: Well, my dad was a farmer. 2 00:01:18,162 --> 00:01:20,622 Um, like everybody else back then. 3 00:01:22,750 --> 00:01:24,920 Of course, he didn't start that way. 4 00:01:25,503 --> 00:01:27,463 [DISTANT RUMBLING] 5 00:01:30,008 --> 00:01:31,048 [ALARM BEEPING] 6 00:01:31,217 --> 00:01:33,137 MAN [OVER RADIO]: Computer says you're too tight. 7 00:01:33,303 --

use grep and awk to transfer data from .srt to .csv/xls

本小妞迷上赌 提交于 2019-12-12 18:04:39
问题 I got an interesting project to do! I'm thinking about converting an srt file into a csv/xls file. a srt file would look like this: 1 00:00:00,104 --> 00:00:02,669 Hi, I'm shell-scripting. 2 00:00:02,982 --> 00:00:04,965 I'm not sure if it would work, but I'll try it! 3 00:00:05,085 --> 00:00:07,321 There must be a way to do it! while I want to output it into a csv file like this: "1","00:00:00,104","00:00:02,669","Hi, I'm shell-scripting." "2","00:00:02,982","00:00:04,965","I'm not sure if

Batch to Create video .srt Subtitles with right timing

浪尽此生 提交于 2019-12-12 14:39:23
问题 Oh boy! I don't know even know what to start with) So, I have a folder with a lot of videos. What I need is to create subtitles with the names of those videos also minding their length to create subtitles in .srt format. I have already look up some info and copied some code @echo off set dirpath=%1 dir C:\FolderwithVideos /O:S /b /-p /o:gn > "C:\result.txt" call replacer.bat result.txt ".mp4" "" exit As a result i got this in result.txt videoname1 videoname2 videoname3 What I need is to make

Making Batch file code with VBScript to work with Unicode symbols

故事扮演 提交于 2019-12-08 11:09:06
问题 So recently I asked for help with creating .srt subtitles. Here is the link. I got the help and everything works fine until the videofile in the folder has unicode symbols in its name. If it does, then VBScript error appears. Question is how to make this code work correctly with Unicode symbols. Here is the code: @echo off&cls ::The Path of your Videos files set "$VideoPath=C:\FolderwithVideos" ::If you want your Code in this BAT remove the REMs Below : rem dir "%$VideoPath%" /O:S /b /-p /o

support srt/vtt subtitle and syncing in video player flutter

浪子不回头ぞ 提交于 2019-12-08 09:50:46
问题 I want to play srt subtitles in my app. I have integrated srt_parser so far. Also, I am able to get the current position of the player by this code inMilliseconds = _videoPlayerController.value.position.inMilliseconds; Here is srt parse code. String data = '''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 3 00:00:10,000 --> 00:00:14,000 Adding subtitles is very easy to do'''; srtParser() { List<Subtitle> subtitles = parseSrt

Parse a SRT file with jQuery Javascript

醉酒当歌 提交于 2019-12-05 03:31:15
问题 I'm trying to parse .srt but I get an internal error and I can't figure out what is it. Here is my code: var subtitles; jQuery.get('SB_LKRG-eng.srt', function(data) { //alert(data); function strip(s) { return s.replace(/^\s+|\s+$/g,""); } srt = data.replace(/\r\n|\r|\n/g, '\n'); //alert(srt); srt = strip(srt); //alert(srt); var srt_ = srt.split('\n\n'); alert(srt_); var cont = 0; for(s in srt_) { st = srt_[s].split('\n'); alert(st); if(st.length >=2) { n = st[0]; i = strip(st[1].split(' --> '

Parse a SRT file with jQuery Javascript

最后都变了- 提交于 2019-12-03 20:12:25
I'm trying to parse .srt but I get an internal error and I can't figure out what is it. Here is my code: var subtitles; jQuery.get('SB_LKRG-eng.srt', function(data) { //alert(data); function strip(s) { return s.replace(/^\s+|\s+$/g,""); } srt = data.replace(/\r\n|\r|\n/g, '\n'); //alert(srt); srt = strip(srt); //alert(srt); var srt_ = srt.split('\n\n'); alert(srt_); var cont = 0; for(s in srt_) { st = srt_[s].split('\n'); alert(st); if(st.length >=2) { n = st[0]; i = strip(st[1].split(' --> ')[0]); o = strip(st[1].split(' --> ')[1]); t = st[2]; if(st.length > 2) { for(j=3; j<st.length;j++) t +