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

Index » Learning resources

blackmacros Member
From: Australia Registered: 2009-04-14 Posts: 763

Hmm okay so I entered into the terminal

ffmpeg -ab 96k -vn -y -i /Users/David/Desktop/video/Tokyo_DOGS_ep01.avi output.mp3

and the error message was

-bash: /bin/ffmpeg: cannot execute binary file


Does that mean the ffmpeg file I have in /bin is not working, or not appropriate?

cb4960 Member
From: Los Angeles Registered: 2007-06-22 Posts: 917

Is ffmpeg set as an executable?

If not, type:

chmod a+x /bin/ffmpeg

to make ffmpeg executable.

blackmacros Member
From: Australia Registered: 2009-04-14 Posts: 763

I tried that, still the same message of "cannot execute binary file"

Then I downloaded the windows version of subs2srs and put the ffmpeg.exe file from that into /bin

After that I again typed ffmpeg -ab 96k -vn -y -i /Users/David/Desktop/video/Tokyo_DOGS_ep01.avi output.mp3

and this time the error was /bin/ffmpeg: Permission denied

Then I typed the chmod command you gave me then, and reran the above command. The error returned to being /bin/ffmpeg: cannot execute binary file

Advertising (register and sign in to hide this)
JapanesePod101 Sponsor
 
Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

try putting the mac one in the directory
(not just renaming the .exe to not have an extension)


despite my previous non-helpful speculations, i think this should work

edit: you might have to do all the terminal stuff over again because its a different file

Last edited by Asriel (2010 February 23, 10:43 pm)

cb4960 Member
From: Los Angeles Registered: 2007-06-22 Posts: 917

Kinda sounds like the ffmpeg your using isn't an executable, or at least not one that was built for the Mac platform. Where did you download this version of ffmpeg from?

blackmacros Member
From: Australia Registered: 2009-04-14 Posts: 763

Ok so, I've tried a bunch of different ffmpeg.exe . The most recent one is the one included in the windows version of subs2srs. I was still getting the "cannot execute binary file" message

The I tried the ffmpeg that Asriel recommended (one built for the mac). That one didn't work at all, because that one caused subs2srs to revert to crashing when I choose the video directory.

Last edited by blackmacros (2010 February 23, 10:51 pm)

cb4960 Member
From: Los Angeles Registered: 2007-06-22 Posts: 917

Since the ffmpeg.exe packaged with subs2srs was built specifically for Windows, it definitely won't work.

Using Asriel's version, try
ffmpeg -ab 96k -vn -y -i /Users/David/Desktop/video/Tokyo_DOGS_ep01.avi output.mp3
again and see what happens.

Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

the one i posted is the one that was included with ffmpegX, and ive used independently through the terminal to do a lot of things

i dont think the problem is ffmpeg, but im posting from my phone, so i cant fiddle around with it...

blackmacros Member
From: Australia Registered: 2009-04-14 Posts: 763

I put the ffmpeg Asriel provided in /bin then ran ffmpeg -ab 96k -vn -y -i /Users/David/Desktop/video/Tokyo_DOGS_ep01.avi output.mp3


Error message was

-bash: /bin/ffmpeg: Permission denied

EDIT:

Aha, but once I do that chmod thing, now things are working. My terminal is showing that its currently encoding, so I'll report back when that's done

Last edited by blackmacros (2010 February 23, 11:03 pm)

cb4960 Member
From: Los Angeles Registered: 2007-06-22 Posts: 917

From http://www.macosxhints.com/article.php? … 082125312:

I always wanted to use the ffmpeg command line tool (the one ffmpegX is the GUI of) in Terminal, but I didn't find it in Fink, and I didn't want to compile it from an experimental source. Well, there is a working binary of ffmpeg bundled with ffmpegX. To get it, simply follow these steps:

   1. Get ffmpegX from the above URL. It's a pretty useful tool, because the ffmpeg synatx isn't quite easy to handle.
   2. Control-click on the ffmpegX application, choose Show Package Contents from the pop-up menu, and navigate into Resources.
   3. Copy ffmpeg to /usr/local/bin.
   4. Execute the following in Terminal (as admin):

      sudo chown root:wheel /usr/local/bin/ffmpeg
      sudo chmod 755 /usr/local/bin/ffmpeg

Now you have a working version of ffmpeg in the Terminal.

Do the chmod command again.

Edit: again, looks like you already figured it out!

Last edited by cb4960 (2010 February 23, 11:03 pm)

blackmacros Member
From: Australia Registered: 2009-04-14 Posts: 763

Ok, success! output.mp3 produced succesfully. Now I'll just check to see if subs2srs will work now.

EDIT: WOOOHOOOO! After pressing go in subs2srs, everything seems to be working. It is encoding the audio now, so I'll report back when all is done

Last edited by blackmacros (2010 February 23, 11:08 pm)

Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

once you get it working, would you kindly post a list of the things you did to get it to work?

cb4960 Member
From: Los Angeles Registered: 2007-06-22 Posts: 917

Yes, please do. I'll put it into the readme file.

blackmacros Member
From: Australia Registered: 2009-04-14 Posts: 763

Ok I think it worked successfully!

The output folder has the media folder and .tsv in it. I just need to do the rest of the work with the blank anki template now, I think (but I've done that before sucessfully on a Mac).

Anyway, I have to go out now, but I'll be back in a few hours and will post a more detailed summary of what I did.

Until then here is a brief description

Download Mono
download ffmpeg (asriel link) in /bin (In Finder-->Go-->Go to folder-->/bin)
Do the chmod command
Make sure subs and vid in seperate directories
terminal: "export MONO_MWF_MAC_FORCE_X11=1"
terminal: "mono subs2srs path"

(I'll edit this later)

Thanks a lot for the help cb smile

Last edited by blackmacros (2010 February 23, 11:25 pm)

Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

for what its worth, i could only get it to run through the x11 terminal, which may be known already

also, why are some of the images for the subs (idx sub) all garbled? is there some way to convert them to text?

Reply #441 - 2010 February 24, 2:49 am
pm215 Member
From: UK Registered: 2008-01-26 Posts: 1354

If we're going to be producing lists of recommended instructions for this they probably shouldn't say "put random stuff in /bin" :-) Put it somewhere else and put that on the PATH...

Reply #442 - 2010 February 24, 3:16 am
Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

i agree

way back when i was working on a java implementation, i had it stored in the same folder as the program itself, which, in retrospect, is probably what led to my past confusion

Reply #443 - 2010 February 24, 4:00 am
raseru Member
From: california Registered: 2007-05-23 Posts: 159

We ought to spread this program. Make it for more languages. Like if you can find a different language to learn it from, upload that too. I'd love to see this program do better. Might help with more download links (and if it stood out a little more or got its own proper site)

I uploaded a deck for people learning English with Korean subtitles (admittedly for my gf) and did Korean to English one as well. Took me awhile to figure out how to convert .smi subtitles without breaking Korean font, lol

http://learnanylanguage.wikia.com/wiki/Sub2srs_decks

I added a section for non-Japanese. Dunno if that's ok or not, but meh

Last edited by raseru (2010 February 24, 4:01 am)

Reply #444 - 2010 February 24, 4:17 am
blackmacros Member
From: Australia Registered: 2009-04-14 Posts: 763

Ok, I just got back home and finished importing it all into an Anki deck and it worked 100% smile

What I did was download the mono version of subs2srs from the link on the first page then:

1. Download and install Mono from http://www.go-mono.com/mono-downloads/download.html

2. Download ffmpeg from the link Asriel provided http://www.megaupload.com/?d=ZBU4FM3M (perhaps you might want to package this with the download? As a layperson I found it very difficult to find despite much googling. Thankfully Asriel rode to the rescue)

3. Put the ffmpeg file in /bin. You can get to /bin by opening Finder, selecting Go from the toolbar, then select Go to folder and type /bin (pm215 mentioned this might not be a good idea, but I don't know how to add other directories to $PATH. I don't even really know what PATH is)

4. Open terminal (found in Applications-->Utilities)

5. Type "chmod a+x /bin/ffmpeg" (without quotes) into the terminal, then press enter

6. Type "export MONO_MWF_MAC_FORCE_X11=1" (without quotes) into the terminal and then press enter

7. Type "mono" (without quotes) in the terminal, followed by a space, and then drag the subs2srs.exe file onto the terminal so that it automatically finds its location. Press enter.

8. Use Subs2SRS. Yay. smile


Every time you wish to use subs2srs, you will have to repeat steps 6 and 7 to open the program.

Thanks a lot for the patient hand holding cb, and for your help too Asriel. smile

Last edited by blackmacros (2010 March 05, 6:22 pm)

Reply #445 - 2010 February 28, 2:34 am
nest0r Member
Registered: 2007-10-19 Posts: 5236 Website

Just thought I'd mention I finally got around to using the newest version of subs2srs--I hadn't tried any of the features I'd asked for just yet, really, including cropping. Works a treat, though! Eliminated bottom 70 pixels from a 1280x720 hardsubbed video, creating 'raw' video clips. Still tinkering with optimum max milliseconds per line. I'm thinking 2250-2500. Looking forward to making many decks... Now if you'll excuse me, I think I need a time out from the forum. Happy studying and thanks again.

Last edited by nest0r (2010 February 28, 2:48 am)

Reply #446 - 2010 March 01, 5:15 am
nest0r Member
Registered: 2007-10-19 Posts: 5236 Website

Hmm, so I've been having trouble getting audio/video clips generated with subs2srs--it says: "System.ComponentModel.Win32Exception: The system cannot find the file specified... " -- I noticed that for Audio Stream, when I select Video, it says "0 - ???", and that when I check the properties of the video, the audio stream has (edit: shift-JIS?) or whatnot, and also if I only generate snapshots, that works, so I'm thinking it's related to encoding of the audio? If so, how do I 'rename' the audio track within the avi? That is to say, if I play the .avi and check the properties, the audio stream has a name consisting of non-unicode gibberish.

I tried it with earlier versions and it doesn't give me error messages, even generates a .tsv with clip references, but the actual media folder is empty.

Last edited by nest0r (2010 March 01, 5:48 am)

Reply #447 - 2010 March 01, 2:14 pm
nest0r Member
Registered: 2007-10-19 Posts: 5236 Website

Okay, tried tinkering around with stream titles and I'm thinking that's not the problem. Guess I'll give up for now. The files in question are Shokojo Seira 01 and Buzzer Beat 03.

Here's the full error message that results in an Action Canceled once it attempts to generate audio or video clips (but not snapshots):

"Something went wrong while generating the video clips.
System.ComponentModel.Win32.Exception: The system cannot find the file specified
  at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
  at System.Diagnostics.Process.Start()
  at subs2srs.UtilsVideo.convertVideoToXvidAvi(String inFile, String audioStream, DateTime startTime, DateTime endTime, ImageSize size, ImageCrop crop, Int32 bitrateVideo, Int32 bitrateAudio, String outFile)
  at subs2srs.WorkerVideo.genVideoClip(WorkerVars workerVars, DialogProgress dialogProgress)
  at subs2srs.SubsProcessor.bw_DoWork(Object sender, DoWorkEventArgs e)"

Edit: Oh damn it, I think I might know what the problem is, but I deleted those particular files already. I think it's because I was running Tea Timer in the background, which also uses .NET framework, but it's always seemed to run awkwardly, in the way it appears in my alt-tab icon list... maybe I'm grasping at straws, though. I'll try to replicate the situation...

Edit2: Nevermind, that wasn't it. Tried a variety of other videos too, which didn't work. Then I tried with version 16, that worked, though sadly it doesn't use the max milliseconds or have those nifty previews. Curses!

Edit 3: Okay, everything I just wrote, forget it, it all works now with every version. Know what I did? I re-extracted the subs2srs zip file that kept failing on me. Voila.... Perhaps it has to be in the same root? *shrug*.. No, not *shrug*, *facepalm*.

Last edited by nest0r (2010 March 01, 3:41 pm)

Reply #448 - 2010 March 01, 4:21 pm
cb4960 Member
From: Los Angeles Registered: 2007-06-22 Posts: 917

Glad I could help wink

From the error message, it sounds like subs2srs.exe couldn't locate the relative path Utils\ffmpeg\ffmpeg.exe.

Reply #449 - 2010 March 01, 5:18 pm
nest0r Member
Registered: 2007-10-19 Posts: 5236 Website

cb4960 wrote:

Glad I could help wink

From the error message, it sounds like subs2srs.exe couldn't locate the relative path Utils\ffmpeg\ffmpeg.exe.

I'll keep that in mind 'next time'. All I know is, the thought that I could not use subs2srs filled me with fear such as I have never known. Greater even than staring upon the ineffable vastness of Cthulhu!

Reply #450 - 2010 March 01, 10:40 pm
blackmacros Member
From: Australia Registered: 2009-04-14 Posts: 763

nest0r wrote:

Greater even than staring upon the ineffable vastness of Cthulhu!

Surely not