substudy: Make Anki cards and other resources from video & bilingual subtitles (command-line)

All about language programs, courses, websites and other learning resources
Notorious MIBG
White Belt
Posts: 21
Joined: Tue Oct 10, 2017 1:50 am
Languages: Native: English
Beginner: Korean
Language Log: https://forum.language-learners.org/vie ... =15&t=7752
x 28

Re: substudy: Make Anki cards and other resources from video & bilingual subtitles (command-line)

Postby Notorious MIBG » Tue Nov 28, 2017 2:45 am

Image

Followed all of the instructions and this is what I get. This is without HTML enabled on import. When I enable HTML on import I get a blue box with a question mark.
0 x
Pimsleur Korean 1 + 2: 47 / 60
Building KOLUP 1000 Sentence Anki Deck: 821 / 1000

User avatar
emk
Black Belt - 1st Dan
Posts: 1620
Joined: Sat Jul 18, 2015 12:07 pm
Location: Vermont, USA
Languages: English (N), French (B2+)
Badly neglected "just for fun" languages: Middle Egyptian, Spanish.
Language Log: viewtopic.php?f=15&t=723
x 6324
Contact:

Re: substudy: Make Anki cards and other resources from video & bilingual subtitles (command-line)

Postby emk » Tue Nov 28, 2017 3:16 am

Did you also copy your media files into the correct Anki folder?
0 x

Notorious MIBG
White Belt
Posts: 21
Joined: Tue Oct 10, 2017 1:50 am
Languages: Native: English
Beginner: Korean
Language Log: https://forum.language-learners.org/vie ... =15&t=7752
x 28

Re: substudy: Make Anki cards and other resources from video & bilingual subtitles (command-line)

Postby Notorious MIBG » Tue Nov 28, 2017 10:39 am

emk wrote:Did you also copy your media files into the correct Anki folder?


:lol: :oops:
2 x
Pimsleur Korean 1 + 2: 47 / 60
Building KOLUP 1000 Sentence Anki Deck: 821 / 1000

Andy E
Yellow Belt
Posts: 91
Joined: Sun Jul 19, 2015 8:41 am
Languages: *
Language Log: https://forum.language-learners.org/vie ... =15&t=8001
x 149

Re: Help needed to test binary releases!

Postby Andy E » Thu Nov 30, 2017 8:53 am

emk wrote:The first problem you encounted was that "Windows 10 did not want to run the exe". This happened because I haven't yet purchased an "Authenticode" certificate to "sign" the *.exe file. Sadly, these cost $199 to $499 per year.


My general experience with Windows SmartScreen is that once you've told it to run anyway, that's the end of it. It certainly hasn't complained about substudy again for me. I also use Windows Defender so I didn't get any anti-virus complaints either.

On another note... does it support VTT subtitle files?
0 x

User avatar
emk
Black Belt - 1st Dan
Posts: 1620
Joined: Sat Jul 18, 2015 12:07 pm
Location: Vermont, USA
Languages: English (N), French (B2+)
Badly neglected "just for fun" languages: Middle Egyptian, Spanish.
Language Log: viewtopic.php?f=15&t=723
x 6324
Contact:

Re: Help needed to test binary releases!

Postby emk » Thu Nov 30, 2017 11:08 am

Andy E wrote:On another note... does it support VTT subtitle files?

Nope. For now, I recommend that Windows users check out Subtitle Edit, which is awesome free software for all your subtitle prep needs.

EDIT: But vtt is a nice plain text format very similar to SRT and we may support it someday.
0 x

User avatar
emk
Black Belt - 1st Dan
Posts: 1620
Joined: Sat Jul 18, 2015 12:07 pm
Location: Vermont, USA
Languages: English (N), French (B2+)
Badly neglected "just for fun" languages: Middle Egyptian, Spanish.
Language Log: viewtopic.php?f=15&t=723
x 6324
Contact:

Re: substudy: Make Anki cards and other resources from video & bilingual subtitles (command-line)

Postby emk » Sat Dec 02, 2017 3:19 pm

Just a random technical interlude...

In order to build a cross-platform GUI, I've decided to go with Electron. But a lot of the technology has improved drastically in the last two years, so I'm going to have to re-learn a bunch of the details.

I'm writing the Electron-related code in TypeScript, which has really matured in the last couple of years. But just for the heck of it, I'm building the web UI using ReactJS (pretty mature) and ReasonML (wildly experimental, but the React maintainers are investing in it deeply). So my code is going to be written in Rust (all the low-level subtitle processing), TypeScript (all the UI touching Electron), and ReasonML (just the GUI state and rendering). Ideally, an app like this would be built using just two languages (Rust and ReasonML, probably, which are practically cousins), but ReasonML still isn't ready.

The first objective: Get File > Open to open up and play a video. This required a bunch of messing around:

Image

The next challenge is to get an actual video playing. Ultimately, this boils down to a typical HTML web application:

Image

The next steps will be to (1) display a list of subtitles, and (2) synchronize those subtitles with the movie. I built all this once before a few years ago, but I did it using Elm, which ultimately turned out to be bad at interfacing with JavaScript and to require lots of boilerplate.

Yes, substudy has always been a place that I play around with technologies that I'm considering using for real work a year from now. :-) So a couple of my choices might turn out to be impractical.
2 x

User avatar
emk
Black Belt - 1st Dan
Posts: 1620
Joined: Sat Jul 18, 2015 12:07 pm
Location: Vermont, USA
Languages: English (N), French (B2+)
Badly neglected "just for fun" languages: Middle Egyptian, Spanish.
Language Log: viewtopic.php?f=15&t=723
x 6324
Contact:

Re: substudy: Make Anki cards and other resources from video & bilingual subtitles (command-line)

Postby emk » Sun Dec 03, 2017 10:38 pm

And now we have subtitles again!

Image

Everything is still really clunky and broken, but you can click on a subtitle to jump to it, and when a subtitle is playing, the button lights up blue. Ideally, I want this player to support two modes:

  1. Regular playback. Just play regularly, possibly even with the subtitles hidden. When you encounter some dialog you don't understand, it would be nice to hit the left arrow to skip back 10 seconds (and enable the subtitles temporarily if they were turned off).
  2. Review mode. Scroll up and down the list of subtitles, listening to individual sections of dialog as many times as you want. When you find a subtitle that would make a good Anki card, just click it.
Of course, I still need to write the code!

Electron is pretty well-behaved, as usual. Reason-React was very challening at the beginning, because setting up the video player integrations is always a bit tricky using this style of framework. But it seems to be coming together nicely now.
4 x

User avatar
rdearman
Site Admin
Posts: 7231
Joined: Thu May 14, 2015 4:18 pm
Location: United Kingdom
Languages: English (N)
Language Log: viewtopic.php?f=15&t=1836
x 23123
Contact:

Re: substudy: Make Anki cards and other resources from video & bilingual subtitles (command-line)

Postby rdearman » Mon Dec 04, 2017 9:16 pm

Do you have to wear a neck brace to keep all those brains from dragging your head to the floor? :lol:
1 x
: 0 / 150 Read 150 books in 2024

My YouTube Channel
The Autodidactic Podcast
My Author's Newsletter

I post on this forum with mobile devices, so excuse short msgs and typos.

crush
Blue Belt
Posts: 514
Joined: Mon Nov 30, 2015 3:35 pm
Languages: EN (N), ES, ZH
Maintain: EUS, YUE, JP, HAW
Study: TGL, SV
On Hold: RU
x 953

Re: substudy: Make Anki cards and other resources from video & bilingual subtitles (command-line)

Postby crush » Mon Dec 04, 2017 10:12 pm

That's looking really great and super useful, i can't believe how quickly you're putting this together! This tool would be amazing for more advanced learners using subs2srs. Do the installation instructions from the repo still stand for the new UI/features?

Also, put up a Patreon campaign or something!
1 x

User avatar
emk
Black Belt - 1st Dan
Posts: 1620
Joined: Sat Jul 18, 2015 12:07 pm
Location: Vermont, USA
Languages: English (N), French (B2+)
Badly neglected "just for fun" languages: Middle Egyptian, Spanish.
Language Log: viewtopic.php?f=15&t=723
x 6324
Contact:

Re: substudy: Make Anki cards and other resources from video & bilingual subtitles (command-line)

Postby emk » Mon Dec 04, 2017 11:50 pm

crush wrote:That's looking really great and super useful, i can't believe how quickly you're putting this together!

This is approximately the fourth time I've built this particular UI, so I already know roughly where I want to go. :-) Out of the earlier three implementations, one was in Elm (too rigid to do what I needed), and two were in PureScript (the language was lovely but I didn't like the libraries).

I used to work on a commercial video tool that ran in the browser, so I know roughly what kind of language & libraries I'll need to make this maintainable. The problem with video is that there are all sorts of async state changes going on all the time, and this eventually makes it impossible to debug or maintain the code. The fix is two-fold (1) use a "pure functional" framework like React to centralize all the messy state and rigorously define how it gets updated, and (2) use a strongly typed language, preferably one with a "variant" types (aka "enum with payloads" or "algebraic data types"). This is slightly exotic, but it provides a rigorous way to manage all the complex stuff going on in the background.

crush wrote:This tool would be amazing for more advanced learners using subs2srs.

Yeah, in my experience, subs2srs-style cards actually work extremely well for advanced learners, but they're just too much of a hassle to make around B2 or C1, because you might only want 10 cards per episode. So you really need a video player that lets you pick just a few subs. And everything needs to be designed to minimize the hassle and prep work, which is really hard.

I would also love to experiment with a "video corpus" UI, where you can store and index multiple episodes and movies. Then you could search later for examples of interesting vocabulary, and make cards. But ars longa, vita brevis, you know?

crush wrote:Do the installation instructions from the repo still stand for the new UI/features?

I haven't written installation instructions for the new stuff, because I want to get a basic prototype working and then build cross-platform Electron binaries that you can just download and run. If you want to get it working now, you'd need to build the Rust code in the "backend" directory using "cargo install", and then use the resulting "substudy-backend" to make a JSON file from an episode. Then you'd need to switch to the "ui" directory, run "yarn", "npm link bs-platform", "bsb -make-world" and "yarn dev".

Obviously this is not a finished product! You'd have to know something about Rust and Node to get it working. I'd be happy to answer questions. But really, once it's actually semi-useful, I'll try to package it so it's user-friendly.

crush wrote:Also, put up a Patreon campaign or something!

This is planned! If I could get a Patreon which covered my Izneo subscription, and maybe paid for Windows and Mac code-signing keys, I would be happy. :-)
2 x


Return to “Language Programs and Resources”

Who is online

Users browsing this forum: No registered users and 2 guests