Back

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

superliman Wrote:Thanks for the link!, I downloaded it and installed X11. I followed your instructions and ran the X11.app found in Utilities before running the mono subs2srs.exe command, however I still get an error something like:

"Could not open display (X-Server required. Check your DISPLAY environment variable)"

Is all I really need to do is run the X11 app before typing in the commands into Terminal? X11 opens up its own terminal but I assume I just leave that alone and enter the commands into the regular Terminal. Still no luck, any ideas appreciated.
Hi superliman,
I'm at work right now, so don't have my mac to check.
But try entering the following in the terminal where you run subs2srs:
export DISPLAY=127.0.0.1:0
All that does is tell subs2srs that the X11 display is running on your local machine (X11 can show applications on remote machines).

If that doesn't work, try entering this in the X11.app terminal
echo $DISPLAY
and looking at what it prints, then setting that in the other terminal before running subs2srs.
export DISPLAY=XXX <- replace XXX with the output from the echo $DISPLAY
Or you could try running subs2srs from the X11 terminal.

Hope that helps,
Andrew.
Reply
OK, Another problem I had, but I solved:

ON OS X, running through Mono, I could never get it to do video. It would say that it was doing video, but in reality, it wasn't.

The problem is with the way that subs2srs sends the command to ffmpeg.
For some reason, even though the source code has the filename surrounded by quotes, when it actually goes to run in the terminal, it acts as if the terminal quotes are taken out. I've written a very crude bash script that can do it over for me, but if you could try to fix this in the next version, that would be fantastic.
Reply
Asriel Wrote:OK, Another problem I had, but I solved:

ON OS X, running through Mono, I could never get it to do video. It would say that it was doing video, but in reality, it wasn't.

The problem is with the way that subs2srs sends the command to ffmpeg.
For some reason, even though the source code has the filename surrounded by quotes, when it actually goes to run in the terminal, it acts as if the terminal quotes are taken out. I've written a very crude bash script that can do it over for me, but if you could try to fix this in the next version, that would be fantastic.
You're finding a lot of good ones - I'll put it on my todo list. In the meantime, you could try eliminating spaces from the filenames and directories that you pass in to subs2srs.

In other words,
"/home/cb4960/subs2srs/some_show/video_files/file_1.avi" instead of
"/home/cb4960/subs2srs/some show/video files/file 1.avi".

(Unless of course, the temporary path that Mono gives me has spaces in it).
Reply
May 16 - 30 : Pretty Big Deal: Save 31% on all Premium Subscriptions! - Sign up here
JapanesePod101
Had some problems with my script, had a really long post.
Turned out to be irrelevant to the actual subs2srs program, so I deleted it all.
However, if this continues, I might end up with a complete subs2srs.sh
heh...

However:
tried using: /User/no/spaces/in/path/name/ and I still got:

/var/tmp/~subs2srs_temp.avi: I/O error occured
Usually means that the input file is truncated and/or corrupted

(the same message I get if I have spaces in the file path I give ffmpeg)

edit2: have you considered using mencoder instead of ffmpeg? I've found it goes faster, but that might just be my system.
Edited: 2010-04-19, 9:53 am
Reply
Asriel Wrote:Had some problems with my script, had a really long post.
Turned out to be irrelevant to the actual subs2srs program, so I deleted it all.
However, if this continues, I might end up with a complete subs2srs.sh
heh...

However:
tried using: /User/no/spaces/in/path/name/ and I still got:

/var/tmp/~subs2srs_temp.avi: I/O error occured
Usually means that the input file is truncated and/or corrupted

(the same message I get if I have spaces in the file path I give ffmpeg)

edit2: have you considered using mencoder instead of ffmpeg? I've found it goes faster, but that might just be my system.
Does it actually create ~subs2srs_temp.avi? If so then at least we can nail it down to the step where it cuts the video. In which case if you were to kill subs2srs before it erases ~subs2srs_temp.avi and then manually cut a clip using ~subs2srs_temp.avi, I wonder if you would still get the I/O error. If it does give you an error, what if you renamed it to something a little more simple like subs2srs.avi? And if it didn't create ~subs2srs_temp.avi, I guess the next question would be why? Is /var/tmp not really a scratch directory on the Mac? Does it not like the tilde?

I'm not familiar with mencoder, but maybe I'll compare its features and performance to ffmpeg someday.
Reply
I hope no Windows users read this thread and think subs2srs is complicated. Sad
Reply
aha!
I stopped the process before it got too far, and I couldn't go back to where it was making the ~subs2srs_temp.avi

It may be the case that the spaces in the filename don't matter at all!
It may even just be my system, or the ffmpeg that I told everyone to download!

When it creates ~subs2srs_temp.avi:
FFmpeg version CVS, Copyright © 2000-2004 Fabrice Bellard
Mac OSX universal build for ffmpegX
configuration: --enable-memalign-hack --enable-mp3lame --enable-gpl --disable-vhook --disable-ffplay --disable-ffserver --enable-a52 --enable-xvid --enable-faac --enable-faad --enable-amr_nb --enable-amr_wb --enable-pthreads --enable-x264
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on Apr 15 2006 04:58:19, gcc: 4.0.1 (Apple Computer, Inc. build 5250)
Input #0, avi, from '/Users/Wirth/sunao/movie/sunao.avi':
Duration: 00:57:48.7, start: 0.000000, bitrate: 2347 kb/s
Stream #0.0, 29.97 fps®: Video: h264, yuv420p, 1280x720
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 128 kb/s
Unknown codec 'libmp3lame'

which is something I ran into ages ago, but completely forgot about.
My script is using just "-acodec mp3" and it seems to work fine.
Reply
Looks like the ffmpeg that you are using was not compiled with the --enable-libmp3lame option but rather --enable-mp3lame.

http://ffmpeg.darwinports.com/ seems to have some easy-ish instructions on creating a libmp3lame version. Its something like:

1) Install Darwin Ports
2) cd /opt/local/bin/portslocation/dports/ffmpeg
3) sudo port install ffmpeg
4) Enter password
5) Wait a few minutes

Edit: If you decide that its worth your time, maybe you can share the binary with us.
Edited: 2010-04-19, 10:49 pm
Reply
Thank you avparker!

It seems the command export DISPLAY=127.0.0.1:0 did the trick, I can now successfully open subs2srs on my Mac!

However I'm having a few other issues with the program itself but I'm slowly figuring those out on my own...

in any case, thanks for the help!
Reply
Well, recent update:
I installed ffmpeg through DarwinPorts (tried compiling it before, but couldn't get it before -- darwinports is amazing Big Grin)
However, before, I had a 10mb file, and now I've got myself a 84k file. Would this only work on my machine? (I'm assuming that it's larger, because all the included stuff were included in the binary, whereas the darwinports one installed them separately? I'm not sure)

So yes, I could put it online somewhere, but would it work?

Also -- when I ran it through with the new ffmpeg, it seemed to work, except that it filled my hard drive like no other. I came home and saw "your HD is running out of space"
sure enough, the *.media folder was like 20GB -- which I haven't quite figured out why
(deleted the folder in a foolish haste...)
Reply
Sorry if this has already been asked (just so many pages to trawl through!).

More or less *all* of my Anime has the subs built in to the files. Is there anyway to use these (read extract?) in subs2srs? I rarely find Japanese stuff online that actually comes with separate sub files >_<

Thanks.
Reply
b0ng0 Wrote:Sorry if this has already been asked (just so many pages to trawl through!).

More or less *all* of my Anime has the subs built in to the files. Is there anyway to use these (read extract?) in subs2srs? I rarely find Japanese stuff online that actually comes with separate sub files >_<

Thanks.
I use MKVExtractGUI (requires MKVToolnix).
Reply
Asriel Wrote:Well, recent update:
I installed ffmpeg through DarwinPorts (tried compiling it before, but couldn't get it before -- darwinports is amazing Big Grin)
However, before, I had a 10mb file, and now I've got myself a 84k file. Would this only work on my machine? (I'm assuming that it's larger, because all the included stuff were included in the binary, whereas the darwinports one installed them separately? I'm not sure)

So yes, I could put it online somewhere, but would it work?

Also -- when I ran it through with the new ffmpeg, it seemed to work, except that it filled my hard drive like no other. I came home and saw "your HD is running out of space"
sure enough, the *.media folder was like 20GB -- which I haven't quite figured out why
(deleted the folder in a foolish haste...)
Maybe try compiling with --disable-shared --enable-static to get a more complete binary, one that doesn't rely on a bunch of shared objects.

I have no clue what would cause a 20 GB .media folder. Yikes.
Edited: 2010-04-21, 9:51 pm
Reply
I tried this programm today and it went well when I just had the japanese subs. But when I also used the english subtitles it happened that while importing the new deck there were only two field mapping options. The ones for Tag and Sequence Marker. So, I couldn't really import it.
Did I do something wrong or maybe is it a common problem?
Thank you for help.
Reply
I think I might start learning how to use Cocoa, and make an actual Mac version of this. The weird way I've got this hacked together for my machine works OK, but it could be a lot easier to use if I had some sort of GUI.

Do you have any problem with this, cb4960? I can't even guarantee that it'll ever reach a point where it's workable for anyone other than me.

edit: feature request, if I haven't found it yet -- "interactive" list of dialogue.
What I mean is, have a list of all the dialogue in it, so it's something like this:

[] 00:07:29.330 00:07:37.330 俺が生徒だったら うれしい。 それが いけない!
[x] 00:10:08.35 00:10:16.36 何かね いつまででも 話してられるっていうか→

where it has a [] Checkbox, Start Time, End Time, and Dialogue.
The checkbox would mean that you're going to include that in the final product. This is useful if you watched a show and only had like 4 lines you wanted, instead of having to prune through them afterwards. edit2: OK, the "Include Text" thing kind of does this for me, but I still think this would be useful, especially paired up with the next two.

There could be a [Preview] button that would play the audio for that time, and if it's not aligned, you could change the timing for that individual line right there, and hit the [Preview] button again to see if it's lined up.

The Dialogue box would just be text editing, plain and simple. This and the time editing would be extremely helpful for a) badly timed subtitles b) combining lines of dialogue
Edited: 2010-04-25, 3:47 am
Reply
this is a cool prog but where do you guys get the sub file with a reliable translation? dont ya lose something in translation?
Reply
PrivateLaughter Wrote:I tried this programm today and it went well when I just had the japanese subs. But when I also used the english subtitles it happened that while importing the new deck there were only two field mapping options. The ones for Tag and Sequence Marker. So, I couldn't really import it.
Did I do something wrong or maybe is it a common problem?
Thank you for help.
Send me both subtitle files and the .tsv file and I'll see if I can reproduce the problem.
Reply
Asriel Wrote:I think I might start learning how to use Cocoa, and make an actual Mac version of this. The weird way I've got this hacked together for my machine works OK, but it could be a lot easier to use if I had some sort of GUI.

Do you have any problem with this, cb4960? I can't even guarantee that it'll ever reach a point where it's workable for anyone other than me.
Sounds cool! I think that this would be a big help for Mac users who want to experiment with subs2srs but are intimidated by the initial setup.

Asriel Wrote:edit: feature request, if I haven't found it yet -- "interactive" list of dialogue.
What I mean is, have a list of all the dialogue in it, so it's something like this:

[] 00:07:29.330 00:07:37.330 俺が生徒だったら うれしい。 それが いけない!
[x] 00:10:08.35 00:10:16.36 何かね いつまででも 話してられるっていうか→

where it has a [] Checkbox, Start Time, End Time, and Dialogue.
The checkbox would mean that you're going to include that in the final product. This is useful if you watched a show and only had like 4 lines you wanted, instead of having to prune through them afterwards. edit2: OK, the "Include Text" thing kind of does this for me, but I still think this would be useful, especially paired up with the next two.

There could be a [Preview] button that would play the audio for that time, and if it's not aligned, you could change the timing for that individual line right there, and hit the [Preview] button again to see if it's lined up.

The Dialogue box would just be text editing, plain and simple. This and the time editing would be extremely helpful for a) badly timed subtitles b) combining lines of dialogue
The Windows version already has a preview dialog were you can preview the text, audio, and snapshot of the final lines:

[Image: v17anopreview.png]

I've been meaning to add the ability to hand pick the lines that will processed as per your suggestion.

Edit: I've also been meaning to add this feature to the Linux/Mac version, but whenever I display a line of Japanese text in the GUI, all I see are boxes. My codepage is set to UTF-8 so I'm not exactly sure what Mono is doing.
Edited: 2010-04-25, 10:20 am
Reply
I haven't read the entire topic, but I seem to be having a problem. I extracted the English subtitles from an MKV file, and I can see the subtitles when I open the file up in Notepad. However, when I use them in subs2srs, there's an error saying that they can't get the subtitles from the file.

Also, it says that the audio is protected and can't be extracted.

Any help?

EDIT: Well, I got the English Subtiutles to work, but when I try to make flashcards with both English and Japanese subtitles, it skips the first few Japanese lines. As in, I can see the lines in the actual sub file, but Subs2srs skips those lines for some reason.
Edited: 2010-04-27, 8:23 pm
Reply
errtu Wrote:this is a cool prog but where do you guys get the sub file with a reliable translation? dont ya lose something in translation?
anyone's input on this?
Reply
>errtuさん、
that's a quite difficult question to answer, in my experience. This is because most fansub (and professional subs, for that matter) will translate things in a way that sounds natural in English. Because of this, what they're actually saying at one point, and what the translation might say could be completely different.

What I do, when I use subs2srs or even just sentences in the wild, is that I don't use translations. I only save sentences/subs with an unknown word that I want to learn. If it's something like i+1, then I already understand the sentence, except for the 1 word, and don't need a translation.
Reply
The truth I think is you cannot trust the fan lations 100%. However, early on it is a starting point especially if you're not up on the slang. Just remember you get what you pay for (which is likely zero).

I haven't used any fan translation subs myself with the exception of a video that had english hard coded onto it. I found that those are very easy to lean on and gives a false sense of understanding of the Japanese. Still, I can see merit in using such translations if you're early in Japanese study and want to utilize the benefits of subs2srs.
Reply
smartazjb0y Wrote:EDIT: Well, I got the English Subtiutles to work, but when I try to make flashcards with both English and Japanese subtitles, it skips the first few Japanese lines. As in, I can see the lines in the actual sub file, but Subs2srs skips those lines for some reason.
subs2srs will skip lines that begin with a "{" character. This is to prevent it from matching lines that only contain a single word or character with a fancy effect applied to it (usually karaoke effects). Here is an example (in this case each character changes color and rotates):

Code:
...
Dialogue: 0,0:00:05.96,0:00:07.46,OP,,0000,0000,0000,,{\fad(0,300)\pos(297,380)\t(300,400,\fscy80)\t(400,500,\fscy120)\t(500,600,\fscy100)}曖
Dialogue: 0,0:00:05.96,0:00:07.46,OP,,0000,0000,0000,,{\fad(0,300)\pos(321,380)\t(600,700,\fscy80)\t(700,800,\fscy120)\t(800,900,\fscy100)}昧
Dialogue: 0,0:00:05.96,0:00:07.46,OP,,0000,0000,0000,,{\fad(0,300)\pos(345,380)\t(900,1000,\fscy80)\t(1000,1100,\fscy120)\t(1100,1200,\fscy100)}3
Dialogue: 0,0:00:05.96,0:00:07.46,OP,,0000,0000,0000,,{\fad(0,300)\pos(389,380)\t(1200,1300,\fscy80)\t(1300,1400,\fscy120)\t(1400,1500,\fscy100)}センチ
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(0,125,\fscy125)\t(125,250,\fscy100)\pos(249,370)\an5\1a&HFFFFFF&\t(0,100,\fry360\1a&H000000&)}そ
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(100,225,\fscy125)\t(225,350,\fscy100)\pos(271,370)\an5\1a&HFFFFFF&\t(100,180,\fry360\1a&H000000&)}り
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(180,305,\fscy125)\t(305,430,\fscy100)\pos(293,370)\an5\1a&HFFFFFF&\t(180,270,\fry360\1a&H000000&)}ゃ
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(270,395,\fscy125)\t(395,520,\fscy100)\pos(315,370)\an5\1a&HFFFFFF&\t(270,360,\fry360\1a&H000000&)}ぷ
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(360,485,\fscy125)\t(485,610,\fscy100)\pos(337,370)\an5\1a&HFFFFFF&\t(360,450,\fry360\1a&H000000&)}に
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(450,575,\fscy125)\t(575,700,\fscy100)\pos(359,370)\an5\1a&HFFFFFF&\t(450,500,\fry360\1a&H000000&)}っ
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(500,625,\fscy125)\t(625,750,\fscy100)\pos(381,370)\an5\1a&HFFFFFF&\t(500,600,\fry360\1a&H000000&)}て
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(600,725,\fscy125)\t(725,850,\fscy100)\pos(403,370)\an5\1a&HFFFFFF&\t(600,700,\fry360\1a&H000000&)}コ
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(700,825,\fscy125)\t(825,950,\fscy100)\pos(425,370)\an5\1a&HFFFFFF&\t(700,800,\fry360\1a&H000000&)}ト
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(800,925,\fscy125)\t(925,1050,\fscy100)\pos(447,370)\an5\1a&HFFFFFF&\t(800,900,\fry360\1a&H000000&)}か
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(900,1025,\fscy125)\t(1025,1150,\fscy100)\pos(469,370)\an5\1a&HFFFFFF&\t(900,1000,\fry360\1a&H000000&)}い
Dialogue: 0,0:00:07.46,0:00:08.56,OP,,0000,0000,0000,,{\fad(10,150)\fsc90\t(1000,1125,\fscy125)\t(1125,1250,\fscy100)\pos(491,370)\an5\1a&HFFFFFF&\t(1000,1100,\fry360\1a&H000000&)}?
...
If you really want to see these lines, convert the subtitle file to .srt format.
Reply
errtu Wrote:
errtu Wrote:this is a cool prog but where do you guys get the sub file with a reliable translation? dont ya lose something in translation?
anyone's input on this?
Personally I would say "No"
(note: I have finished core 2000 as well as the genki 1 + 2 grammar books before using subs2srs)

Sure sometimes the translations are different, but it's up to you to reconcile the Japanese and English subtitles. You can look up unknown words in the dictionary. It's a little time-consuming, but it is no big deal. If you still can't figure out how the English and Japanese is related, then you need to look up the relevant grammar.

The only problem I can see you having as if you start doing subs2srs too early in your studies, but even then you should still be looking up words in the dictionary that you don't know so I really don't think it's a problem.
Reply
cb4960 Wrote:
smartazjb0y Wrote:EDIT: Well, I got the English Subtiutles to work, but when I try to make flashcards with both English and Japanese subtitles, it skips the first few Japanese lines. As in, I can see the lines in the actual sub file, but Subs2srs skips those lines for some reason.
subs2srs will skip lines that begin with a "{" character. This is to prevent it from matching lines that only contain a single word or character with a fancy effect applied to it (usually karaoke effects). Here is an example (in this case each character changes color and rotates):

If you really want to see these lines, convert the subtitle file to .srt format.
Well, I've tried deleting all instances of { and I've tried converting to srt. There are a few problems though: When I convert the Japanese Subs to srt, the kanji are totally changed, so I just went into the ass file and deleted all { characters. With the English ones, I just converted it to SRT. Now, when I use subs2srs, with just Japanese subs alone, it works fine, but when I add in the English Subs, the English Subs are cut off at the end, meaning there are more subs in the file but they don't all appear in subs2srs, and the Japanese subs are mixed together, meaning there's more than one subtitle per line. I'm thinking there's way too much of a difference in the number of lines in the Japanese subtitles and the English Subtitles.
Edited: 2010-05-01, 11:01 am
Reply