Back

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

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?
Reply
Is ffmpeg set as an executable?

If not, type:

chmod a+x /bin/ffmpeg

to make ffmpeg executable.
Reply
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
Reply
May 16 - 30 : Pretty Big Deal: Save 31% on all Premium Subscriptions! - Sign up here
JapanesePod101
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
Edited: 2010-02-23, 11:43 pm
Reply
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?
Reply
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.
Edited: 2010-02-23, 11:51 pm
Reply
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.
Reply
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...
Reply
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
Edited: 2010-02-24, 12:03 am
Reply
From http://www.macosxhints.com/article.php?s...0082125312:

Quote: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!
Edited: 2010-02-24, 12:03 am
Reply
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
Edited: 2010-02-24, 12:08 am
Reply
once you get it working, would you kindly post a list of the things you did to get it to work?
Reply
Yes, please do. I'll put it into the readme file.
Reply
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
Edited: 2010-02-24, 12:25 am
Reply
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
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
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
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
Edited: 2010-02-24, 5:01 am
Reply
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
Edited: 2010-03-05, 7:22 pm
Reply
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.
Edited: 2010-02-28, 3:48 am
Reply
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.
Edited: 2010-03-01, 6:48 am
Reply
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*.
Edited: 2010-03-01, 4:41 pm
Reply
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
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
nest0r Wrote:Greater even than staring upon the ineffable vastness of Cthulhu!
Surely not
Reply