[whatwg] SRT research: timestamps

Ralph Giles giles at mozilla.com
Fri Oct 7 10:27:29 PDT 2011


On 06/10/11 01:58 AM, Simon Pieters wrote:

> I don't know how many have negative interval, I'd need to run a new
> script over the 52,000,000 lines to figure out. (If you want me to check
> this, please contact me with details about what you want to count as
> "negative interval".)

I had in mind something like:

cat *.vtt | awk '/-->/ {
  ns = split($1, start, "[:.,]");
  ne = split($3, end, "[:.,]");
  if (ns != ne) print "timestamp field counts differ";
  if (end[1] -start[1] < 0) print "negative interval";
}
BEGIN { negs = 0; misses = 0; }
END { print negs, "negative intervals";
      print misses, "cues skipped because field counts were different";
}'

Which will probably still miscount some garbage lines, but gives a rough
idea.

> leading id e.g.
> 10300:11:53,891 --> 00:11:56,155
> 
> 33

OTOH, sounds like the leading id issue is vanishingly uncommon, so I'm
just curious if there are any other queues which would be rejected that way.

 -r




More information about the whatwg mailing list