Re: [dev] Writing subtitles for videos

From: Thomas Levine <__AT_thomaslevine.com>
Date: Tue, 24 Oct 2017 20:18:52 +0000

WebVTT format is more complex than I would like and also not fully
implemented on any browsers, as far as I can tell, so I use a small
subset that is very simple.



The following section is most of the parsing of my bespoke formats for
timings and texts. It references lots of other functions in the library
of interest that all do very little, so it might be very tedious to
read. The parsing of these files is simple enough that I did not give it
its own function; this passage is complex because it also handles build
dependencies, user interface concerns, and concatenation of subtitles.
https://thomaslevine.com/scm/langrompiloj/artifact?ln=72-102&name=a370f5205509f123

In summary of the above, I combine a timing file and a
named-for-a-language text file, and I come up with a sequence of
Subtitle objects, where a Subtitle contains a language, a list of times,
and a list of strings.

I implemented two different WebVTT formats that dump the Subtitle
sequence. I wanted to use the webvtt_karaoke, but I couldn't find any
browsers that supported the karaoke feature, so I am using
webvtt_replace.
https://thomaslevine.com/scm/langrompiloj/artifact?ln=6-31&name=42a903bd25efb0b0



Fortunately, the input format and data structure are simple enough that
you can probably ignore everything I discuss above. In my prior email
I referenced this timings file
https://thomaslevine.com/scm/langrompiloj/artifact/49ddb891f1f0b6fd

and these two text files.
https://thomaslevine.com/scm/langrompiloj/artifact/f01066b80ae8fe3b
https://thomaslevine.com/scm/langrompiloj/artifact/cf93e6b1b7967053

Using the files and the corresponding video as inputs, I arrive at the
these WebVTT files as outputs.
https://thomaslevine.com/!/langrompiloj/blaukraut/blaukraut_de.vtt
https://thomaslevine.com/!/langrompiloj/blaukraut/blaukraut_en.vtt

Markus Teich writes:
> Heyho Thomas,
>
> I did not look up the format, so it might be trivial, but do you mind shari
> ng
> your tooling for the WebVTT translation as well?
>
> --Markus
Received on Tue Oct 24 2017 - 22:18:52 CEST

This archive was generated by hypermail 2.3.0 : Tue Oct 24 2017 - 22:24:16 CEST