Use subs2srs to Create Anki Decks Based on Your Favorite Movie or Show

Index » Learning resources

Reply #251 - 2009 July 19, 8:45 pm
Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

So I don't think this was going to end up being a very efficient port the way I was doing it. So now I'm basically starting from scratch, and I hope to use only ffmpeg, because to make every user download the Mono framework, and Fink so they could get mp3splt would just be ridiculous.

I'm working in Java, mainly because of it can be used anywhere, and they have ffmpeg for other systems as well. I'm hoping to bundle them all together and it might be able to be universal big_smile

I'm still only dreaming though. Shouldn't be too hard to get it working.

Reply #252 - 2009 July 21, 1:52 am
Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

OK So, I just finished a command-line version. (JavaSubs2SRS? javaSubs? v.0.0.1?)

It's pretty limited in what it can do (only SRT files that start with "1" as the first subtitle. And it does the entire file, rather than a select duration)

The only problem is that I can only get it to work in my IDE (Eclipse). I can't get it to run directly form the command line, and I'm not quite sure why. If anyone has any idea, I'd love to hear from you.

It's also a pretty messy program. It was thrown together pretty quickly, so I know there are better ways to do certain things, but I just wanted to get it done quickly.

Of if anyone can help me with compiling, I'd love to upload it and get it to all you Mac users! (Maybe linux?)

Last edited by Asriel (2009 July 21, 1:53 am)

Reply #253 - 2009 July 21, 2:27 am
avparker Member
From: Tokyo Registered: 2007-05-06 Posts: 168 Website

Hi Asriel,
sorry, I got much less done on the weekend than I thought I would, and I didn't really get to the Subs2SRS stuff (I did install the mono package, but that's as far as I got).

I'd really like to help out, it'd be great to be able to make these decks.
Unfortunately I don't have a lot of time, perhaps a few hours here and there.
Probably only enough to do a bit of testing.

What happens when you run from the command line?
I assume you get an exception.

Advertising (register and sign in to hide this)
JapanesePod101 Sponsor
 
Reply #254 - 2009 July 22, 12:50 pm
Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

Subs2SRS Mac Edition version 0.0.0.0.0.0.1 is being released!
There's probably a lot of bugs, and it only does SRT files, and it does the entire show, rather than just a range...
BUT IT'S RELEASED!!!!

Just make sure that you place the "Subs2SRS" folder into the main HD folder (you know, with "Applications" "System" "Library" and "User" folders...)

A list of command-line arguments is given in the ReadMe.txt file.

http://www.megaupload.com/?d=31W9UQOC

Let me know how it goes for you!!!

Reply #255 - 2009 August 02, 8:01 am
LordGolem Member
From: Italy Registered: 2006-07-28 Posts: 30

The mac edition doesn't work for me.

If I don't use options I get this:

Macintosh:Subs2SRS golem$ java -cp /Subs2SRS/Subs2SRS.jar Subs2SRS Exception in thread "main" java.lang.NullPointerException
    at java.io.File.<init>(File.java:277)
    at srtScript.<init>(srtScript.java:22)
    at Subs2SRS.main(Subs2SRS.java:61)


If I use options I get this:

Macintosh:Subs2SRS golem$ java -cp /Subs2SRS/Subs2SRS.jar Subs2SRS -s /Subs2SRS/Input/cb1.srt -f /Subs2SRS/Input/cb1.avi
Error: File not found: /Subs2SRS/Input/cb1.srt
IO Exception?

Reply #256 - 2009 August 02, 10:58 am
Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

I know that if you don't use options, it won't run. I should probably fix that to have standard settings...

As for why you get the "File not found" error...I'm not 100% sure why it's not working (as long as the files are in there, of course)...
I'll play around and see if I can reproduce it in order to fix it.

Reply #257 - 2009 August 02, 11:01 am
Tobberoth Member
From: Sweden Registered: 2008-08-25 Posts: 3364

Doesn't it work on Linux? I mean, Java is Java, unless you're using something OS specific it should work fine on Linux too right?

That the subs2srs has to be put in a specific spot on your harddrive doesn't bode well though... why is there such a limitation?

Last edited by Tobberoth (2009 August 02, 11:04 am)

Reply #258 - 2009 August 02, 11:08 am
Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

Baah, Ok I think I know what's wrong. I screwed up in the documentation....

When you type in the filename of the subtitles or the video files, don't put in the whole path. So if you did

java -cp /Subs2SRS/Subs2SRS.jar Subs2SRS -s cb1.srt -f cb1.avi

it should work. Although, there's no point in including a video file if you're not going to have audio or video or snapshots. Just saying.

Reply #259 - 2009 August 02, 11:12 am
Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

The reason I have it work on Mac is because really all it does is invoke ffmpeg, which should work if you have a linux version in the same directory as Subs2SRS.jar

You ask why it has to be in a specified directory:
Hopefully it won't have to be like that forever. The way I found the directory control in Java to work was set up by where the main class file is located.
I have ideas of how to get it to work elsewhere, but so far it begins searching for files in either the main Subs2SRS directory, or the directory where the main Java files on your system are stored.

Shouldn't be something too hard to fix...I just don't know how...

Reply #260 - 2009 August 06, 12:32 am
LordGolem Member
From: Italy Registered: 2006-07-28 Posts: 30

Still doesn't work:

Macintosh:~ golem$ java -cp /Subs2SRS/Subs2SRS.jar Subs2SRS -s cb1.srt -f cb1.avi
Error: File not found: cb1.srt


Successfully exported TVS file! Formatted as follows:

Original Subtitle

-----

The output dir is empty.

Reply #261 - 2009 August 06, 2:23 am
bombpersons Member
From: UK Registered: 2008-10-08 Posts: 907 Website

Hey, Asriel, could you make a sourceforge page for this (with a git / svn repo)? I've never coded in Java, but I wouldn't mind helping out if you like.

Last edited by bombpersons (2009 August 06, 2:23 am)

Reply #262 - 2009 August 13, 2:21 am
ghinzdra Member
From: japan Registered: 2008-01-07 Posts: 499

after having carefully selected , merged , connected hundred of lines of Mononoke hime and basically spent hours in making a personnal deck for this movie  I discovered  that almost all the picture in my deck are botched up. Most of the time it s nothing but a grey screenshot  , for about a dozen  a pixel mix  and only 4 pictures (out of more 400) have been shot correctly.
I tried twice with the exact same result.

grey
http://img27.imageshack.us/img27/2920/mononokehime00100020091.th.jpg

blur
http://img522.imageshack.us/img522/8857/mononokehime00100302095.jpg


http://img205.imageshack.us/img205/3306/mononokehime00100444717.jpg

correct
http://img522.imageshack.us/img522/9272/mononokehime00101122149.th.jpg

Anyone got an idea of what s going on ? most important how to fix it ?

Last edited by ghinzdra (2009 August 13, 2:23 am)

Reply #263 - 2009 August 13, 6:45 am
ghinzdra Member
From: japan Registered: 2008-01-07 Posts: 499

Oh by the way I used an ogm file with double audio track english/japanese ....As it took english and not japanese I wonder if the picture problem has also something to do with the file format...

Reply #264 - 2009 August 20, 9:16 pm
koreymcmurtrey New member
From: Kentucky Registered: 2009-07-17 Posts: 3

I have a quick question.  Am I right in thinking that this only works with ripped movie files, and wouldn't work just owning the DVD of, say Mononoke Hime?  I have the Region 2 Mononoke coming in soon in the mail, and I wanted to take advantage of this awesome-sounding program.  What would I need to do to be able to use subs2srs?

Reply #265 - 2009 August 20, 11:07 pm
ghinzdra Member
From: japan Registered: 2008-01-07 Posts: 499

in the first place take a look to this topic http://forum.koohii.com/viewtopic.php?id=3915
and yes subs2srs is unable to deal with DVD....
considering the audio sampling and the snapshot process it would be incredly painful.
it takes about 30 minutes to rip a DVD  and 4 hours to encode it in a decent way
so even if you don t know much about video there s no need to elaborate further ?

you need to get your hand on a compressed video file ffmpeg is able to deal with (because sub2srs is based on it)
either you make it by yourself or you download it. And if you read my previous post you must know that ffmep isn t totally reliable. So avoid exotic format like OGM ,OGG
obviously the safest standard is the lowest : avi for container /divx for video/mp3 for sound . MKV as container and H264 for video are also safe . Didnt try AAC and MP4.

if you download some subtitle watch out  .... Besides padding the timing , sometimes you are compelled to redo the whole timing as the subtitles comes from a different edition and all the timing is mucked up. It s the case with mononoke hime : I had a subtitle made for a 2H09 long movie  and most of the versions on internet are 2H13 (the irony being the 2H09 version I found was OGM file ...so I could nt use subs2srs with it).In which case I hope you rule with aegisub because retiming can be a real pain in the ass if you re not accostumed the keyboard shortcuts especially for such a long movie .

As I m currently making deck of my DVD  , I ll publish a tutorial within 2 weeks.

Last edited by ghinzdra (2009 August 20, 11:23 pm)

Reply #266 - 2009 August 21, 5:44 pm
ghinzdra Member
From: japan Registered: 2008-01-07 Posts: 499

HerrPetersen wrote:

@ghinzdra: I managed it: you have to edit the plugin-file and change "actionSuspendCard" to "actionDelete".  You can also copy-paste the below text under the comments of the file  (after deleting the previous content)

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from ankiqt import mw

def init():
    mw.mainWin.toolBar.addSeparator()
    mw.mainWin.toolBar.addAction(mw.mainWin.actionSuspendCard)

mw.addHook("init", init)

def init():
    mw.mainWin.toolBar.addSeparator()
    mw.mainWin.toolBar.addAction(mw.mainWin.actionDelete)

mw.addHook("init", init)

Like this you have a Suspend button AND a DeleteFact button.

I installed the latest version of anki and I don t find this plugin file anymore : where is it ?

Reply #267 - 2009 August 24, 5:16 pm
nest0r Member
Registered: 2007-10-19 Posts: 5236 Website

I'm a newbie when it comes to this sort of thing. If I want to take an Anki deck that's already been made with subs2srs, and edit it using an include list/remove non-kanji lines, how would I go about doing that? Is there a way to run it through subs2srs again with new 'advanced' options, or is it better to use another program to edit the .csv (or whatever it is) files, and if so, how?

Last edited by nest0r (2009 August 24, 5:17 pm)

Reply #268 - 2009 August 30, 2:27 am
cb4960 Member
From: Los Angeles Registered: 2007-06-22 Posts: 917

Hello,

I have just released version 13 of subs2srs.

Download subs2srs v13 via SourceForge

Added context support. This option (accessed from the Advanced Subtitle Options dialog) allows you to observe the context in which a line of dialog appears. This is accomplished by attaching lines leading up to the line of dialog and attaching lines trailing the line of dialog. Text, audio clips, snapshots and video clips will be attached in this manner.

Example showing leading and trailing text:

http://img193.imageshack.us/img193/542/tokiwokakerushoujoankic.png

As always, let me know if I broke something.

cb4960

Last edited by cb4960 (2009 August 30, 2:31 am)

Reply #269 - 2009 August 30, 3:09 am
bombpersons Member
From: UK Registered: 2008-10-08 Posts: 907 Website

Ah, that context thing is looks awesome! I thought it might get in the way, but the way it's set out, it doesn't look like it will get in the way at all big_smile

Reply #270 - 2009 August 30, 3:37 am
mezbup Member
From: sausage lip Registered: 2008-09-18 Posts: 1681 Website

I've never tried using it before, but I did just now on a densha otoko ep and when it got to generating the audio the whole thing just broke.

What happened??

Reply #271 - 2009 August 30, 4:50 am
mezbup Member
From: sausage lip Registered: 2008-09-18 Posts: 1681 Website

uh well the previous version works and doesnt throw up an error. Kinda fiddly to get it all working nicely though but i've been meaning to get around to learning how to use this properly.

Reply #272 - 2009 August 30, 8:31 am
Nukemarine Member
From: 神奈川 Registered: 2007-07-15 Posts: 2347

Ok, gonna re-do the next show I had lined up, "花より男子" ep 1, with this.

The other benefit I can see for this Context option is for badly time subs (like in 絶対彼氏) which cut off or include a bit more dialogue than the line under question.

Reply #273 - 2009 August 30, 9:06 am
ruiner Member
Registered: 2009-08-20 Posts: 751

I haven't used it yet, but I like the graduated size differentiation, though I'd probably still change the colours of those fields to a gray gradient in Anki's options to make sure my eyes don't stray as easily.


This makes setting up dialogue chains of call-and-response cards easier, for sure. When I originally thought of them, I was just going to manually cut up the dialogues by hand, I think. I don't know how I expected to do it... no more theorizing w/o practice for me! (Now I will proceed to theorize w/o testing out the new subs2srs.)

Now I'd just mark the time spans down for those dialogue scenes, then edit the subsequent mini deck so that, let's see, the Current Line's cue (Previous Line's audio/image or video, expression optional) is on the Question side, then the cue's meaning (optional?) and the Current Line's audio/video/expression/meaning is on the Answer side... not sure if in that case I'd bother with Next Lines trailing it, to avoid unnecessary overlap. Also not sure if I'd bother adding the Expressions for earlier Previous lines on the Question side.

The Context tab says that it attaches text, audio, snapshots, etc--does that mean when you select the # of leading and trailing lines, that you end up w/ a series of Previous Line subfields like Previous Line Audio, Previous Line Video, et cetera? Guess I'd eliminate most of those as per the above paragraph, though if Anki had multiple Play buttons I'd tinker around w/ that.

Maybe we can have a group project where we add Actor's lines to the subtitles for various scenes, and convert .srts to .ssa/.ass files.

Or perhaps I'd only do call-and-response decks made from episodes/films I'd already studied and perhaps tagged with actors in the process? Hmm...

Last edited by ruiner (2009 August 30, 9:08 am)

Reply #274 - 2009 August 30, 10:16 am
Nukemarine Member
From: 神奈川 Registered: 2007-07-15 Posts: 2347

I do have a request:

Can the field that shows the title of the show "movie_yyy" be changed to be "movie_yyy_xxxx". It will be sequential to the cards created in that sub batch.

Reason: If you use Anki's media check, it'll rename the audio and media files. Without those to sort and identify, it's hard to know where in the show or subtitle file

Reply #275 - 2009 August 30, 2:10 pm
ruiner Member
Registered: 2009-08-20 Posts: 751

Nukemarine wrote:

I do have a request:

Can the field that shows the title of the show "movie_yyy" be changed to be "movie_yyy_xxxx". It will be sequential to the cards created in that sub batch.

Reason: If you use Anki's media check, it'll rename the audio and media files. Without those to sort and identify, it's hard to know where in the show or subtitle file

Did Grandpa Nukemarine wander off before finishing this comment?