sachac / subed

subed is a subtitle editor for Emacs
177 stars 16 forks source link

(error "Found invalid start time: \"00:00:00.000 --> 00:00:03.400\"") #61

Closed suliveevil closed 1 year ago

suliveevil commented 1 year ago

I encountered this error when editing subtitle generated by Buzz (powered by OpenAI Whisper C++ version)

https://github.com/chidiwilliams/buzz

WEBVTT

00:00:00.000 --> 00:00:03.520
Mac Power Users Episode 592

00:00:03.520 --> 00:00:06.400
WWDC 2021

00:00:06.400 --> 00:00:08.400
in the future of Mac Automation.

00:00:08.400 --> 00:00:18.200
Hello and welcome back to Mac Power Users.

00:00:18.200 --> 00:00:19.560
My name is Stephen Hackett.

Could you help me out? Thank you very much.

Debugger entered--Lisp error: (error "Found invalid start time: \"00:00:00.000 --> 00:00:...")
  signal(error ("Found invalid start time: \"00:00:00.000 --> 00:00:..."))
  error("Found invalid start time: %S" "00:00:00.000 --> 00:00:03.400")
  #f(compiled-function () #<bytecode -0x1c5a20884d25afc1>)()
  apply(#f(compiled-function () #<bytecode -0x1c5a20884d25afc1>) nil)
  subed-validate-format()
  subed--sort()
  subed-sort()
  run-hooks(subed-sanitize-functions)
  subed--sanitize()
  subed-sanitize()
  subed-prepare-to-save()
  run-hooks(before-save-hook)
  basic-save-buffer(nil)
  save-buffer()
  #f(compiled-function (buffer) #<bytecode 0x8c750db36c52b8a>)(#<buffer mpu592.srt>)
  map-y-or-n-p(#f(compiled-function (buffer) #<bytecode 0x386155ccd182e70>) #f(compiled-function (buffer) #<bytecode 0x8c750db36c52b8a>) (#<buffer mpu592.srt>) ("buffer" "buffers" "save") ((18 #f(compiled-function (buf) #<bytecode -0x13c75ba9d05c38a4>) "view this buffer") (6 #f(compiled-function (buf) #<bytecode 0x81e69c181c6e49c>) "view this buffer and quit") (100 #f(compiled-function (buf) #<bytecode -0x24c8ee819382ae6>) "view changes in this buffer")))
  save-some-buffers(:no-prompt #f(compiled-function () #<bytecode 0x1165867bd47a6294>))
  apply(save-some-buffers (:no-prompt #f(compiled-function () #<bytecode 0x1165867bd47a6294>)))
  timer-event-handler([t 0 5 0 :repeat save-some-buffers (:no-prompt #f(compiled-function () #<bytecode 0x1165867bd47a6294>)) idle 0 nil])

macOS 13.0.1 Emacs-plus: GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin22.1.0, NS appkit-2299.00 Version 13.0.1 (Build 22A400)) of 2022-11-23

sachac commented 1 year ago

Hi! It looks like the filename ends in .srt, but your start time is in .vtt format instead. WebVTT milliseconds start with "." while SRT milliseconds start with ",". Do you want to try renaming your file so that it ends in a .vtt? Thank you!

suliveevil commented 1 year ago

Silly me, I opened srt file first then opened vtt while didn't change mode.

suliveevil commented 1 year ago

Thank you very much for your kind heart and awesome package! 🥰