Re: [dev] Writing subtitles for videos

2017-10-24 Thread Thomas Levine
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=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=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



Re: [dev] Writing subtitles for videos

2017-10-24 Thread Markus Teich
Thomas Levine wrote:
> I settled on the following mpv configuration.
> https://thomaslevine.com/scm/langrompiloj/artifact/6a086022d93af1a1
> https://thomaslevine.com/scm/langrompiloj/artifact/161b62d352fec4f7
> 
> This produces a file like the one below, which I edit until the subtitles are
> acceptably timed. Each line marks the beginning of the next cue and the end of
> the previous cue.
> https://thomaslevine.com/scm/langrompiloj/artifact/49ddb891f1f0b6fd
> 
> Texts for the subtitles are stored in other files, one file per language.
> These files have one line per cue, so they have one fewer line than the
> corresponding timings file.
> https://thomaslevine.com/scm/langrompiloj/artifact/f01066b80ae8fe3b
> https://thomaslevine.com/scm/langrompiloj/artifact/cf93e6b1b7967053
> 
> I then produce a WebVTT file for each combination of a timing file and
> language.

Heyho Thomas,

I did not look up the format, so it might be trivial, but do you mind sharing
your tooling for the WebVTT translation as well?

--Markus



Re: [dev] Writing subtitles for videos

2017-10-24 Thread Hadrien Lacour
On Tue, Oct 24, 2017 at 03:48:28PM +, Thomas Levine wrote:
> I settled on the following mpv configuration.
> https://thomaslevine.com/scm/langrompiloj/artifact/6a086022d93af1a1
> https://thomaslevine.com/scm/langrompiloj/artifact/161b62d352fec4f7
>
> This produces a file like the one below, which I edit until the
> subtitles are acceptably timed. Each line marks the beginning of the
> next cue and the end of the previous cue.
> https://thomaslevine.com/scm/langrompiloj/artifact/49ddb891f1f0b6fd
>
> Texts for the subtitles are stored in other files, one file per
> language. These files have one line per cue, so they have one fewer
> line than the corresponding timings file.
> https://thomaslevine.com/scm/langrompiloj/artifact/f01066b80ae8fe3b
> https://thomaslevine.com/scm/langrompiloj/artifact/cf93e6b1b7967053
>
> I then produce a WebVTT file for each combination of a timing file and
> language.
>
> Thank you for everyone's input
>
> Hadrien Lacour writes:
> > It may be possible to do this with mpv and lua scripts.
>

Thanks for reporting back, I'm sure this'll help a lot.



Re: [dev] Writing subtitles for videos

2017-10-24 Thread Thomas Levine
I settled on the following mpv configuration.
https://thomaslevine.com/scm/langrompiloj/artifact/6a086022d93af1a1
https://thomaslevine.com/scm/langrompiloj/artifact/161b62d352fec4f7

This produces a file like the one below, which I edit until the
subtitles are acceptably timed. Each line marks the beginning of the
next cue and the end of the previous cue.
https://thomaslevine.com/scm/langrompiloj/artifact/49ddb891f1f0b6fd

Texts for the subtitles are stored in other files, one file per
language. These files have one line per cue, so they have one fewer
line than the corresponding timings file.
https://thomaslevine.com/scm/langrompiloj/artifact/f01066b80ae8fe3b
https://thomaslevine.com/scm/langrompiloj/artifact/cf93e6b1b7967053

I then produce a WebVTT file for each combination of a timing file and
language.

Thank you for everyone's input

Hadrien Lacour writes:
> It may be possible to do this with mpv and lua scripts.



Re: [dev] Writing subtitles for videos

2017-09-03 Thread Timothy Rice
> Holy shit. Is everyone on here a fucking child trying to score points about
> something that really doesn't matter? People like you are the reason why
> Usenet died.
> 
> Grow up.
> 
> If you want to know how to deal with something like an adult:

He said, resurrecting shit that had already fizzled out, in order to
indulge in juvenile flaming, which I'm given to understand is some great
sin.

Fuck off and take your own advice.




Re: [dev] Writing subtitles for videos

2017-09-03 Thread fao_

On 2017-08-31 1:07 pm, Timothy Rice wrote:

We are really glad to know you've been entertained.


I think you mean "I am really glad".


this would have been more constructive to address directly Thomas to 
ask

about his needs if you're interested at all in this discussion.


It sounds like you want to have a discussion about how to do things
constructively.

Are you sure you would have anything to contribute to such a 
discussion, or

are you just going to give me a four paragraph feature request without
actually contributing anything yourself?



Thank you for the noise, bro.


No, please, the thanks must go to *you*, for adding noise to call me 
out on

making noise about you making noise.

Noise ad infinitum, all because you called out isabella for calling out
Thomas for presenting a four paragraph feature request.

Your bat.


Holy shit. Is everyone on here a fucking child trying to score points 
about

something that really doesn't matter? People like you are the reason why
Usenet died.

Grow up.

If you want to know how to deal with something like an adult:

* If it's not interesting to you, ignore it, don't bother whining about 
it

  because nobody cares.
* If you think it's not relevant, direct them to somewhere else and move 
on,

  don't flame like some twelve year old who just got a laptop.
* If you think they've asked a stupid question, tell them how their 
question
  is stupid and how to improve, move on. If you don't want to do that, 
move on.


Simple.

--
- fao_
PGP fingerprint: 739B 6C5C 3DE1 33FA
"Too enough is always not much!"



Re: [dev] Writing subtitles for videos

2017-08-31 Thread hiro
no, please don't contribute to suckless, your code will suck like usual.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread Quentin Rameau
> I think you mean "I am really glad".

No, you're wrong.

> It sounds like you want to have a discussion about how to do things
> constructively.

Not really, I just do things, discussions are what you do and this is
certainly not constructive, as we can see here.

> Are you sure you would have anything to contribute to such a
> discussion, or are you just going to give me a four paragraph feature
> request without actually contributing anything yourself?

I'm sorry, I don't usually contribute to such discussions, I contribute
to actual projects with actual code.
People like you contribute to feature requests and useless discussions,
and noise.

> No, please, the thanks must go to *you*, for adding noise to call me
> out on making noise about you making noise.

I never called you, I don't even know you, you came on your own with
your bro thing (not sure what this is).

> Noise ad infinitum

No, let's stop here, I think too much time has already been wasted (at
least mine for sure).
Feel free to add something surely most useful to this thread, although
I'd prefer you'd actually contribute to suckless, you can find a lot of
things needing actual work to be done.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread Timothy Rice
> We are really glad to know you've been entertained.

I think you mean "I am really glad".


> this would have been more constructive to address directly Thomas to ask
> about his needs if you're interested at all in this discussion.

It sounds like you want to have a discussion about how to do things
constructively.

Are you sure you would have anything to contribute to such a discussion, or
are you just going to give me a four paragraph feature request without
actually contributing anything yourself?


> Thank you for the noise, bro.

No, please, the thanks must go to *you*, for adding noise to call me out on
making noise about you making noise.

Noise ad infinitum, all because you called out isabella for calling out
Thomas for presenting a four paragraph feature request.

Your bat.




Re: [dev] Writing subtitles for videos

2017-08-31 Thread Quentin Rameau
> Unlike the OP's four paragraph feature request against software which
> suckless obviously doesn't offer, I have at least found isabella's
> content entertaining and concise.

We are really glad to know you've been entertained.

> While I'm sure it was kind of you to step in to defend your bro, I
> would have preferred if your bro had demonstrated the simple ability
> to report what they found unsatisfactory about existing software and
> provided their first stab at some C code aimed at addressing the
> perceived problems.

I don't know Thomas more than I know you (ie not at all).
But I know Izabera.

While it's kind of you to step in to defend your bro, this would have
been more constructive to address directly Thomas to ask about his
needs if you're interested at all in this discussion.

Thank you for the noise, bro.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread hiro
> i thought this was a mailing list for hackers?

hahahahahahahaha



Re: [dev] Writing subtitles for videos

2017-08-31 Thread hiro
> i judge people by their ability to perform basic tasks
define basic.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread hiro
> i'm fairly confident my grandma could do it too
> maybe she can teach you for a small fee

i'm glad she taught you these very important life skills. i'm sure it
will come in handy when you can install an arschlinux for some
desperate hooker in return for food and LTE traffic.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread hiro
finally somebody with a legit software requirement! nobody cares about
a nerd's imagined answers to imagined problems.
thanks kamil, it was about time somebody contributed something of
actual value on this list. :)



Re: [dev] Writing subtitles for videos

2017-08-31 Thread Kamil Cholewiński
Background: a close friend is doing subtitling for $, usually for local
film festivals. One festival often means dozens of movies to be
translated and subtitled. Most people doing this are freelance
translators with limited technical background.

> ffplay prints the playback time in centisecond precision to the terminal
> when it is playing, so you can pause to see where in the video you are
> and write the time down yourself.

No, this is beyond stupid. Try this when you have dozens of hours of
video to subtitle, on a deadline. You want this activity to be as
streamlined as humanly possible. There's no room for philosophy here,
the people doing this are already tired.

The current de-facto state of the art is to hit a key to show-next/hide
the subtitle while the video is playing. This can be done live while the
film is being displayed at a theater, or pre-recorded (possibly with
time-stretched playback).

> I haven't editted a lot of subtitles, but for sound synchronization, a
> waveform is extremely useful.

Now this is an interesting idea and I think extending existing software
with this functionality would make it somewhat more usable.

Any improvement that takes away a part of the manual labor would be
awesome. Using machine learning, or speech recognition, to auto-suggest
subtitle timing? Hell fucking yeah, that would seriously rock.

<3,K.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread Thomas Levine
As Felix pointed out (and I had not previously realized), the subtitles
depend mostly on the audio, and the video can largely be ignored.
I thus think it has relatively little to do with blind.

I had looked at mpv and came upon the annoyingly close but still
unhelpful watch-later feature. I considered whether it was possible to
implementing my proposal with just edits to input.conf and whether it
was worth using libmpv, but had not considered lua scripts. A Lua script
indeed looks promising.
https://gist.github.com/Hakkin/5489e511bd6c8068a0fc09304c9c5a82
https://github.com/thebombzen/scripts/blob/master/src/markchapter.lua

It still seems a bit messy, (Perhaps a scripting language could be
avoided entirely if the mpv configuration were written in C.) but this
will probably satisfy me for now.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread Hadrien Lacour
On Thu, Aug 31, 2017 at 08:04:26AM +, Thomas Levine wrote:
> I want to write some subtitles for some videos. I found several subtitle
> editors through web searches, and their documentation doesn't make them
> look very good. What's more, I haven't managed to install any of them
> properly, which is both inconvenient and further indicative of suck.
>
> I think that most of what I want could be accomplished by having a video
> player that writes the current time somewhere (like a file) when I press
> a particular key. I would play the video until I get to the position
> where I want to start or stop a subtitle, then I would press the key,
> and then I would copy that time to the subtitles file.
>
> Another helpful feature would be to reload the subtitles file without
> changing the current time; this way I could review the subtitles more
> quickly.
>
> Do any video players already do this? Or, does anyone have other
> recommendations about the editing of subtitles?
>

It may be possible to do this with mpv and lua scripts.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread isabella parakiss
On 8/31/17, Quentin Rameau  wrote:
>> i judge people by their ability to perform basic tasks
>
> Like trolling on mailing lists, thank you.
>
>


https://asciinema.org/a/uxviYMKZbD1FJ2ftRKUo5lVj8
i thought this was a mailing list for hackers?
am i the troll or the guy that can't do this?



Re: [dev] Writing subtitles for videos

2017-08-31 Thread Mattias Andrée
On Thu, 31 Aug 2017 11:34:00 +0200
Quentin Rameau  wrote:

> Hi Mattias
> 
> > I tried it out, it sucked donkey balls; i'd rather just use
> > ffplay and a text editor; the video playback didn't even work
> > for me.  
> 
> Isn't this something that could be done with blind?
> I wonder if this would be within its goal scope.
> 

I'm not planing to do subtitles, I want to keep it purely
video. However, it's in the todo-list to make a simple
graphical tool for finding frames. It will have video and
audio playback, keyframe listing, and maybe waveforms, as
well as timestamp and frame number. So it will be useful
as an alternative to the ffplay part.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread Quentin Rameau
> i judge people by their ability to perform basic tasks

Like trolling on mailing lists, thank you.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread isabella parakiss
On 8/31/17, Quentin Rameau  wrote:
>> 99% of the fansubbers use aegisub
>> they're teens and they all managed to install it properly
>> i'm fairly confident my grandma could do it too
>> maybe she can teach you for a small fee
>
> We're glad to know you judge the quality of a software by its ability
> te be easily installed only.
>
>


i judge people by their ability to perform basic tasks



Re: [dev] Writing subtitles for videos

2017-08-31 Thread Quentin Rameau
Hi Mattias

> I tried it out, it sucked donkey balls; i'd rather just use
> ffplay and a text editor; the video playback didn't even work
> for me.

Isn't this something that could be done with blind?
I wonder if this would be within its goal scope.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread Mattias Andrée
On Thu, 31 Aug 2017 11:25:21 +0200
Quentin Rameau  wrote:

> > 99% of the fansubbers use aegisub
> > they're teens and they all managed to install it properly
> > i'm fairly confident my grandma could do it too
> > maybe she can teach you for a small fee  
> 
> We're glad to know you judge the quality of a software by its ability
> te be easily installed only.
> 

I tried it out, it sucked donkey balls; i'd rather just use
ffplay and a text editor; the video playback didn't even work
for me.


pgpy3TR9Nl7ij.pgp
Description: OpenPGP digital signature


Re: [dev] Writing subtitles for videos

2017-08-31 Thread Quentin Rameau
> 99% of the fansubbers use aegisub
> they're teens and they all managed to install it properly
> i'm fairly confident my grandma could do it too
> maybe she can teach you for a small fee

We're glad to know you judge the quality of a software by its ability
te be easily installed only.



Re: [dev] Writing subtitles for videos

2017-08-31 Thread isabella parakiss
On 8/31/17, Thomas Levine <_...@thomaslevine.com> wrote:
> I want to write some subtitles for some videos. I found several subtitle
> editors through web searches, and their documentation doesn't make them
> look very good. What's more, I haven't managed to install any of them
> properly, which is both inconvenient and further indicative of suck.


99% of the fansubbers use aegisub
they're teens and they all managed to install it properly
i'm fairly confident my grandma could do it too
maybe she can teach you for a small fee



Re: [dev] Writing subtitles for videos

2017-08-31 Thread Mattias Andrée
On Thu, 31 Aug 2017 08:04:26 +
Thomas Levine <_...@thomaslevine.com> wrote:

> I want to write some subtitles for some videos. I found several subtitle
> editors through web searches, and their documentation doesn't make them
> look very good. What's more, I haven't managed to install any of them
> properly, which is both inconvenient and further indicative of suck.
> 
> I think that most of what I want could be accomplished by having a video
> player that writes the current time somewhere (like a file) when I press
> a particular key. I would play the video until I get to the position
> where I want to start or stop a subtitle, then I would press the key,
> and then I would copy that time to the subtitles file.
> 
> Another helpful feature would be to reload the subtitles file without
> changing the current time; this way I could review the subtitles more
> quickly.
> 
> Do any video players already do this? Or, does anyone have other
> recommendations about the editing of subtitles?
> 

ffplay prints the playback time in centisecond precision to the terminal
when it is playing, so you can pause to see where in the video you are
and write the time down yourself.


pgpsRhwM6jLv5.pgp
Description: OpenPGP digital signature


Re: [dev] Writing subtitles for videos

2017-08-31 Thread Felix Van der Jeugt
Hi

Quoting Thomas Levine (2017-08-31 10:04:26)
> Or, does anyone have other recommendations about the editing of
> subtitles?

I haven't editted a lot of subtitles, but for sound synchronization, a
waveform is extremely useful. Instead of hitting a button when you hear
something, you can just select the exact point the amplitude increases.

I'm afraid I don't know any even remotely suckless tools for this,
though.

Sincerely,
Felix



signature.asc
Description: signature


[dev] Writing subtitles for videos

2017-08-31 Thread Thomas Levine
I want to write some subtitles for some videos. I found several subtitle
editors through web searches, and their documentation doesn't make them
look very good. What's more, I haven't managed to install any of them
properly, which is both inconvenient and further indicative of suck.

I think that most of what I want could be accomplished by having a video
player that writes the current time somewhere (like a file) when I press
a particular key. I would play the video until I get to the position
where I want to start or stop a subtitle, then I would press the key,
and then I would copy that time to the subtitles file.

Another helpful feature would be to reload the subtitles file without
changing the current time; this way I could review the subtitles more
quickly.

Do any video players already do this? Or, does anyone have other
recommendations about the editing of subtitles?