substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

All about language programs, courses, websites and other learning resources
User avatar
emk
Brown Belt
Posts: 1118
Joined: Sat Jul 18, 2015 12:07 pm
Location: Vermont, USA
Languages: English (N), French (B2+)
Just for fun (beginner): Middle Egyptian, Spanish.
Language Log: viewtopic.php?f=15&t=723
x 3389
Contact:

Re: substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

Postby emk » Thu Dec 10, 2015 12:15 am

It appears to be SRS night on the forum today; my apologies to all those who are feeling like there's a bit too much of it right now.

rdearman wrote:I'm guessing you haven't released the tracks functionality yet, because that option doesn't exist for me. The --help doesn't show a version number, it might be useful to add that in.

OK, I just released a new version with the "export tracks" command. I also added the version number you asked for. :-)

Code: Select all

Subtitle processing tools for students of foreign languages

Usage: substudy clean <subs>
       substudy combine <foreign-subs> <native-subs>
       substudy export csv <video> <foreign-subs> [<native-subs>]
       substudy export review <video> <foreign-subs> [<native-subs>]
       substudy export tracks <video> <foreign-subs>
       substudy list tracks <video>
       substudy --help
       substudy --version

For now, all subtitles must be in *.srt format. Many common encodings
will be automatically detected, but try converting to UTF-8 if you
have problems.

To install or upgrade, just follow the installation notes listed here. This version can output four different formats:

  1. Bilingual SRT subtitle files.
  2. CSV files (with media) for import into Anki.
  3. The "review" format, where you can browse through a list of subtitles, with images and audio clips.
  4. A set of short MP3 tracks with everything but the dialog stripped out, for your listening to on an MP3 player.
This is designed to give you bunch of different ways to work with the same media, depending on your needs and your mood. :-)

The new web UI is not officially released yet. If you want to try that out, you'll need to clone the repository from GitHub, switch to the "substudy/server" directory, and build it manually. This will also require installing the Elm developer tools. I'll release an official version later, once I've removed more of the rough edges.

Please let me know if you have any problems!
1 x

User avatar
emk
Brown Belt
Posts: 1118
Joined: Sat Jul 18, 2015 12:07 pm
Location: Vermont, USA
Languages: English (N), French (B2+)
Just for fun (beginner): Middle Egyptian, Spanish.
Language Log: viewtopic.php?f=15&t=723
x 3389
Contact:

Re: substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

Postby emk » Thu Dec 10, 2015 10:21 pm

OK, the GUI is finally starting to feel a bit more useful:

substudy-play-clip-buttons.png
substudy-play-clip-buttons.png (203.12 KiB) Viewed 713 times

How this works: If you click on one of the giant "play" icons next to a subtitle, it will automatically play just that subtitle, then stop again. This basically gives you the ability to flip between watching a movie and reviewing its subtitles intensively.

One of my goals is to make this interface good enough that I can use it for both Spanish movies (where my level is very low) and French movies (where my level is fairly high). I suspect that subs2srs cards could be useful even for advanced students, but using them effectively would need some sort of tool for making cards while watching a show normally, without subtitles.
2 x

User avatar
arthaey
Blue Belt
Posts: 963
Joined: Sat Jul 18, 2015 9:11 pm
Location: Seattle, WA, USA
Languages: EN (N); ES (adv receptive, int productive); FR (false beginner); DE (lapsed beg); ASL (lapsed beg); HU (tourist)
Language Log: viewtopic.php?f=15&t=3864&view=unread#unread
x 1347
Contact:

Re: substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

Postby arthaey » Fri Dec 11, 2015 1:36 am

How well does this work on a mobile browser, btw?
0 x
Log links: ASLFrenchHungarianSpanish
Anki catchup : 53 / 2204 April vocab challenge : 373 / 300

User avatar
emk
Brown Belt
Posts: 1118
Joined: Sat Jul 18, 2015 12:07 pm
Location: Vermont, USA
Languages: English (N), French (B2+)
Just for fun (beginner): Middle Egyptian, Spanish.
Language Log: viewtopic.php?f=15&t=723
x 3389
Contact:

Re: substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

Postby emk » Fri Dec 11, 2015 1:42 am

arthaey wrote:How well does this work on a mobile browser, btw?

I haven't tried it yet, but I'd imagine reasonably well. Some performance optimizations might be necessary. (This is not my first HTML 5 video app, nor the first one that had to support mobile, so I'm pretty sure that the basic feature set will be able to work with a bit of tweaking.) I'm also trying to design the UI to fit well on a large phone screen.
1 x

User avatar
rdearman
Site Admin
Posts: 2236
Joined: Thu May 14, 2015 4:18 pm
Location: United Kingdom
Languages: English (N)
French (studies), Italian (studies), Mandarin (studies),
Esperanto TAC (Only god knows why), Finnish (only in it for the cookies)
Language Log: viewtopic.php?f=15&t=1836
x 4425
Contact:

Re: substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

Postby rdearman » Wed Jan 27, 2016 11:05 pm

emk wrote:
arthaey wrote:How well does this work on a mobile browser, btw?

I haven't tried it yet, but I'd imagine reasonably well. Some performance optimizations might be necessary. (This is not my first HTML 5 video app, nor the first one that had to support mobile, so I'm pretty sure that the basic feature set will be able to work with a bit of tweaking.) I'm also trying to design the UI to fit well on a large phone screen.

Any progress on that?
0 x

User avatar
rdearman
Site Admin
Posts: 2236
Joined: Thu May 14, 2015 4:18 pm
Location: United Kingdom
Languages: English (N)
French (studies), Italian (studies), Mandarin (studies),
Esperanto TAC (Only god knows why), Finnish (only in it for the cookies)
Language Log: viewtopic.php?f=15&t=1836
x 4425
Contact:

Re: substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

Postby rdearman » Sat Mar 05, 2016 2:21 pm

Another feature request?

Someone posted a question about memorisation of poetry, and this lead me down a long track of looking for methods of memorising songs. Using a combination Substudy, VideoDownloadHelper, and Google2SRT, I was able to download a Youtube video (I filtered for close caption). The Google2SRT downloaded the captions for me as .srt file, and I used the Substudy tool to generate anki cards.

The Google2SRT is opensourced Java program. It allows you to download single or multiple captions as srt files.

I thought it would be wonderful to add the ability to download YouTube videos & CC to substudy. I'd love to see something like this command.

substudy export csv <youtube_identifier> <CC_lang> <CC_lang>

where youtube_identifier is the identifier you use to embed a youtube video in BBCode, and CC_lang is the identifier of the CC language like FR, EN, IT, etc. This command would then download the video, the captions, and generate a csv folder for import straight into anki. This could be used for songs, TED talks, university lectures, etc. Any content on YouTube with captions included.
1 x

maschingon
Yellow Belt
Posts: 64
Joined: Wed Aug 24, 2016 6:57 am
Location: Mérida, YUC, México
Languages: Spanish [C2], Portuguese [B2? C1 writing? no idea], Chinese [high intermediate level, no idea specifically]
Language Log: viewtopic.php?f=15&t=3906
x 28

Re: substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

Postby maschingon » Fri Oct 07, 2016 4:45 pm

Good day people,

I've been attempting to use substudy to turn a song into anki cards following my preferred format, but I'm failing to figure out how to run it from the terminal.

I have an mp3 (traicionera.mp3) and I have 2 subtitle files (traicionera_subtitles.es.srt, traicionera_subtitles.en.srt), and I've also downloaded all the necessary software found in emk's instructions (on his website), such as Rust, Cmake, ffmpeg, and whatever other crazy software (I don't know what any of it does - lol).

Whenever I type in the command substudy, it gives me the error message

Code: Select all

-bash: substudy: command not found


Anyways, I know that from the terminal, you can't just call anything from anywhere; you normally have to

Code: Select all

cd
to the file where the files are found. But in this case, do I

Code: Select all

cd
to a file where the srt files and mp3 files are found together? I'm just kind of confused about how to go about this.

If it's at all helpful (it probably isn't), I've included below what I tried this morning (I've tried many other ways, this is just what I currently have open in the terminal). Any help would be much appreciated!

Code: Select all

Last login: Thu Oct  6 23:07:44 on ttys001
Michaels-MBP:~ ElMasChingon$ substudy
-bash: substudy: command not found
Michaels-MBP:~ ElMasChingon$ cd desktop
Michaels-MBP:desktop ElMasChingon$ substudy
-bash: substudy: command not found
Michaels-MBP:desktop ElMasChingon$ substudy combine traicionera_subtitles.en.srt traicionera_subtitles.es.srt
-bash: substudy: command not found
Michaels-MBP:desktop ElMasChingon$ cd ..
Michaels-MBP:~ ElMasChingon$ c desktop
-bash: c: command not found
Michaels-MBP:~ ElMasChingon$ cd desktop
Michaels-MBP:desktop ElMasChingon$ cd substudy-master
Michaels-MBP:substudy-master ElMasChingon$ substudy
-bash: substudy: command not found
Michaels-MBP:substudy-master ElMasChingon$
0 x
Michael King (seudónimos: Miguel Rey / Miguel Rei / 金一迈)

dampingwire
Green Belt
Posts: 259
Joined: Tue Aug 04, 2015 8:11 pm
Location: Abingdon, UK
Languages: Italian (N), English (N), French (poor, not studying), Japanese (studying, JLPT N3)
x 168

Re: substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

Postby dampingwire » Fri Oct 07, 2016 7:34 pm

maschingon wrote:Whenever I type in the command substudy, it gives me the error message

Code: Select all

-bash: substudy: command not found



I've never used it but I'll stick my oar in anyway. I'm going to assume the tool you want is substudy-master but if I'm wrong, feel free to adjust appropriately.

If the tool lives in the directory you happen to be in then

Code: Select all

./substudy-master


should fire it up.

Otherwise if it lives elsewhere then

Code: Select all

elsewhere/substudy-master


should do it.

An alternative would be to put it on your path, but if the error message you got meant nothing to you, then "putting it on your path" probably means about as much :-)
1 x
新完全マスター N2聴解 : 94 / 103新完全マスター N2読解 : 99 / 177
新完全マスター N2文法 : 197 / 197TY Comp. German : 0 / 389

User avatar
rdearman
Site Admin
Posts: 2236
Joined: Thu May 14, 2015 4:18 pm
Location: United Kingdom
Languages: English (N)
French (studies), Italian (studies), Mandarin (studies),
Esperanto TAC (Only god knows why), Finnish (only in it for the cookies)
Language Log: viewtopic.php?f=15&t=1836
x 4425
Contact:

Re: substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

Postby rdearman » Fri Oct 07, 2016 7:34 pm

It would appear you don't have the substudy program in your path. This means you'll probably have to type the entire path, or figure out how to edit the path variable. I don't do MAC's however you can do it temporarily on a unix machine, which is what a MAC really is, by using the export command. Anyway, the simple way is to find the directory where the substudy command is using a search command or find:

Code: Select all

find ~ -iname substudy


then type in the full path to the executable

Mine is located:

Code: Select all

/home/rick/.multirust/toolchains/nightly/cargo/bin/substudy


yours is probably similar. I have the substudy folder in my path. You can do this (on a linux machine, and probably a Mac) by editing the .bashrc file in your home area. Then insert something like below with the appropriate corrections.

Code: Select all

export PATH=${PATH}:/home/rick/.multirust/toolchains/nightly/cargo/bin
1 x

User avatar
emk
Brown Belt
Posts: 1118
Joined: Sat Jul 18, 2015 12:07 pm
Location: Vermont, USA
Languages: English (N), French (B2+)
Just for fun (beginner): Middle Egyptian, Spanish.
Language Log: viewtopic.php?f=15&t=723
x 3389
Contact:

Re: substudy: A tool for making bilingual subtitles (MacOS X or Linux, command-line)

Postby emk » Sun Oct 09, 2016 11:45 am

If you've installed more recently, you might need to run:

Code: Select all

export PATH=${PATH}:~/.cargo/bin


I need to go update substudy a bit and track down a compilation issue on some newer Mac systems. I've been terribly busy with work and training lately, and I've fallen behind on maintaining some of my programs!

As always, if you're a developer, I do accept pull requests on github.
2 x


Return to “Language Programs and Resources”

Who is online

Users browsing this forum: No registered users and 1 guest