Back

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

cb4960 Wrote:@Nukemarine

Okay, I think that I get it now. You just need the ability to enter a start time and an end time. That should be easy enough.
It pisses me off that some people can put in a sentence what it took me 2 paragraphs to get through. How did I ever become an instructor?

Yes, a start time and a stop time. Sometimes I make stuff more complicated than it needs to be.
Reply
with the new update, i no longer have any problems making snapshots - it now makes the appropriate number of them.

thanks for going the extra mile to work out the kinks
Edited: 2009-03-01, 6:39 pm
Reply
Hello,

I have just released version 8 of subs2srs (see the first post). I added the ability to limit subtitle processing a specified span of time.

cb4960
Edited: 2009-03-01, 7:52 pm
Reply
May 16 - 30 : Pretty Big Deal: Save 31% on all Premium Subscriptions! - Sign up here
JapanesePod101
Couple of issues I had with my last batch:

1. With the timing limits, the video is processing frames past the cut-off point. Is there a way have it also fall within the timing limits (useful for shows like death note with 3 minutes worth of ending and intros). **edit: just reread CB's post on page 3, turns out it's a limitation of the rendering software. Is there a way to force a stop though? Yeah, you have to go frame by frame at the beginning, but when the last frame is hit, can the program get stopped for that video?

2. When doing bulk batches, some odd things happen. If I look at the folder with the videos (using Windows), a hidden file gets created (I assume some type of index file) that I cannot remove. This prevents subs2srs from wanting to work ("number of files in video must match subs"). Now, I get around that by moving the videos to a new file (cut, paste onto the folder). Problem then occurred when that file where I "select all" then "cut" and "paste" on top of becomes the default first file when subs2srs ran (In this case, it started with video number 4 and looped to the first three at the end).

One solution is an option letting the user see, then confirm the file match-ups:

Example: [video: Death Note 01.avi; audio: Death_Note_001.mp3; subs1: Death Note 01.japanese.srt subs2: Death Note 01.english.srt] Is this correct?

Selecting yes moves to the next set of the series, selecting no stops the process. If there's a problem, it's obvious before the batch processing starts and the user can make changes and try again.
Edited: 2009-03-03, 9:44 pm
Reply
Nukemarine Wrote:Couple of issues I had with my last batch:

1. With the timing limits, the video is processing frames past the cut-off point. Is there a way have it also fall within the timing limits (useful for shows like death note with 3 minutes worth of ending and intros). **edit: just reread CB's post on page 3, turns out it's a limitation of the rendering software. Is there a way to force a stop though? Yeah, you have to go frame by frame at the beginning, but when the last frame is hit, can the program get stopped for that video?
I just read some of the AviSynth docs again. Turns out that you can use the Trim() command to cut out all of the frames that you don't want - in our case, the frames that are not needed for snapshots. In my initial testing, the snapshot process took a mere 3.5 minutes as opposed to the 17 minutes it took using the old method.

Nukemarine Wrote:2. When doing bulk batches, some odd things happen. If I look at the folder with the videos (using Windows), a hidden file gets created (I assume some type of index file) that I cannot remove. This prevents subs2srs from wanting to work ("number of files in video must match subs"). Now, I get around that by moving the videos to a new file (cut, paste onto the folder). Problem then occurred when that file where I "select all" then "cut" and "paste" on top of becomes the default first file when subs2srs ran (In this case, it started with video number 4 and looped to the first three at the end).

One solution is an option letting the user see, then confirm the file match-ups:

Example: [video: Death Note 01.avi; audio: Death_Note_001.mp3; subs1: Death Note 01.japanese.srt subs2: Death Note 01.english.srt] Is this correct?

Selecting yes moves to the next set of the series, selecting no stops the process. If there's a problem, it's obvious before the batch processing starts and the user can make changes and try again.
Hmm, I hadn't considered hidden files (WINDOWS!!!). What I could do is just ignore hidden files.

Expect a new release by the end of the week.
Edited: 2009-03-03, 10:46 pm
Reply
Hello, I have just released version 9 of subs2srs (see first post).

Changes:

1) Snapshot processing is about 5 times faster now.

2) Any hidden files contained within the subtitle, audio, and video directories are now ignored.
Reply
First of all, this is really, really cool.

I'm a little concerned though: It's taking me 6+ hours just to generate the 880 or so audio clips from a one-hour-long show. Does that sound right? I'm using the built-in feature that creates them from the .avi. Would it be faster to tear the audio out and process it separately?
Reply
yep defitenely strange .

I didn't spent my time with my eyes riveted on the clock but I m pretty sure it didn't take me more than 30 mn to do the audio AND the snapshot of a 20 m long n deathnote episode. I take on average 65 samples .... Do the maths.
Your timing is all the more unusual that you don't mention anything about taking snapshot while it's the most time consuming part of the process (I assume that's why cb4960 released a new version : 5 times faster seem insane)

BTW 6H is way too long but 880 clips is also a bit excessive don't you think so ? I bet you don't edit your subs and you put them straight into anki ? Maybe you advocate for keeping the whole story together but otherwise I cannot but advise you to edit a little bit through aegisub and pick up what you really need .
Reply
derthnada Wrote:First of all, this is really, really cool.

I'm a little concerned though: It's taking me 6+ hours just to generate the 880 or so audio clips from a one-hour-long show. Does that sound right? I'm using the built-in feature that creates them from the .avi. Would it be faster to tear the audio out and process it separately?
Currently, processing audio directly from a video file is a fairly slow process. When I get a chance, I'm going to look into some optimizations. 6 hours seems a bit excessive for 880 lines, but it is entirely possible if you are using an older machine. It would probably take my midrange EE6600 about an hour to process the audio for that number of lines.

The reason for the slowness it probably due to the fact that I make a separate to call FFmpeg for every line. So it has to load the same file over and over - each time seeking to the correct position.

So what you could do is try extracting the audio first using "Tools->Extract audio from video". That way FFmpeg only loads the file once. Maybe for the next version I will just extract the audio in this manner (creating a potentially large but temporary file) and then feed it to mp3splt.
Edited: 2009-03-10, 8:45 pm
Reply
Yeah, that threw me at first... It seems like maybe the FFmpeg call has to seek through everything before it can return the audio clip, because it starts fast then slows down big time. Instead I ripped audio using virtualdub and it literally took about 3 minutes (whereas it was taking hours before). I didn't realize there was a "Tools->Extract audio from Video" option, (or that it would have been beneficial) or else I would have used that immediately.

Great program though, I think using this really is the best way to study.
Reply
cb4960 Wrote:So what you could do is try extracting the audio first using "Tools->Extract audio from video". That way FFmpeg only loads the file once. Maybe for the next version I will just extract the audio in this manner (creating a potentially large but temporary file) and then feed it to mp3splt.
That totally did the trick, thanks!

This is so bad-ass.
Reply
Hello, I have just released version 10 of subs2srs (see first post).

Changes:

1) Automatic audio processing ("Extract audio from the video files") is about 20 times faster now.

2) Vobsub bitmap generation will now obey the Span option. Only the bitmaps in the desired span will be generated.
Reply
Hello, I have just released version 10.1 of subs2srs (see first post).

Changes:

1) The "Extract Audio from Video" dialog now uses mp3splt to split the MP3 files.

2) Added ID3v2 tags to all MP3 files.

3) Includes latest version of mp3splt (2.2.3).
Edited: 2009-03-15, 4:51 pm
Reply
cb,

Outstanding. This program is turning out great. I showed it to a guy that did the Defense Language Institute for Chinese. He wishes he had something like that way back when.

Out of interest, if you were looking at the shadowing thread, if I can ask advice. You're finding more about the audio utility. So, is there an easy way to make shadowing audio? Idea being program still is splitting the audio with appropriate buffer time. However, it can look at these "splits" and merge them back with blank spacing for the audio.

Seems to be outside the charter of subs2srs, but may be worth as an additional program of sorts. Does it look feasible?
Reply
I do not know of any program that will add silence based on the length of the mp3.

However, if want you to add a fixed length silence (5 seconds, etc.), you can use something like the following.
Code:
set silence_file=silence.mp3
set output_file=output.mp3
type nul > %output_file%
for /f %%a in ('dir /b *.mp3') do (if not %%a==%silence_file% copy /b %output_file% + %%a + %silence_file% %output_file%)
Usage:
Place the above commands inside a batch file (.bat) and save.
Put the mp3's in the same folder as the batch file.
Create a silent mp3 file of the desired length (with audacity), name it silence.mp3, and place in the same folder as the batch file.
Execute the batch file. It will create a file called output.mp3 that will contain the joined mp3 files with silence in between.
Edited: 2009-03-15, 7:42 pm
Reply
cb4960 Wrote:I do not know of any program that will add silence based on the length of the mp3.
Take a look at S2Shadowing, the export function gives you this option. (or will when it's finished)

http://forum.koohii.com/showthread.php?p...9#pid46209

At the moment it exports to a playlist file with the spacer mp3s inserted. eg:

Playlist:
sentence1.mp3 [1.25 seconds]
slience1.25.mp3 [1.25 seconds]
sentence2.mp3 [2.5 seconds]
slience2.5.mp3 [2.5 seconds]
sentence3.mp3 [1.0 second]
slience1.0.mp3 [1.0 second]

So when you listen to it on your iPod / Winamp you will hear it with the spaces for shadowing.

I'm working on exporting it as one big combined mp3 at the moment [edit: I just had a flash of inspiration and this will be done when I get home, piece of cake!], but I'm starting to think that actually the playlist is the better idea...
Edited: 2009-03-15, 8:55 pm
Reply
ok, so im having issues again with my snapshots

Im trying to go from dvd to subs2srs

i can get the .sub file no problem, but since there is only 1 of them and several .vob files - i need to compile the dvd rip into one file

my question being, what format do you recommend converting the video to bc for me it either skips the photos all together or it takes one for everyframe - (btw im using handbrake to compile)
Reply
Do'h! I must have took the previous fix out when I was optimizing snapshot processing. I'll merge it back in when I get home.
Reply
Guys,there's a way to import videos in anki?
I mean, importing the video connected to the subtitle's line and not only screen shots
I asked about this at the anki's creator and he told me that it's possible if you have some programming ability,and sure I haven't...
Reply
Hello, I have just released version 10.2 of subs2srs (see first post).

Changes:
Fixed the problem described by duder a few posts above. The problem occurred when a subtitle file had a line starting on the first frame. This causes AviSynth to take a snapshot of every frame in the video. So I just place the line at the second frame instead. Sorry for the inconvenience.
Reply
Hello, first of all great program and great work.

I'm having a problem with the newest version, when the program creates the mp3 files, it seems like it is trying to put the .mp3 extension twice. For instance "hana_001_000.01.39-000.03.27.mp3.mp3"

When I try to import it into anki via the text file it doesn't work, however if I manually add the mp3 file in the example to a anki card, it will work, the text file lists the mp3 as "hana_001_000.01.39-000.03.27.mp3" like it should be, but since the actual audio file name has an extra .mp3 it doesn't import correctly.
Reply
Hello, I have just released version 10.3 of subs2srs (see first post).

Changes:

Fixed the problem described by StoneJack in the above post. Looks like the new version of mp3splt adds the .mp3 extension even if you already include it in the output filename.
Edited: 2009-03-20, 7:18 pm
Reply
cb4960 there is a way to split a video by his timing info(I mean of the srt file) with your program?
Practically...do the splitting process of the audio for the video and having a lot of .avi files chunks
Reply
Yes, ffmpeg can be used for this purpose. A simple example:
Code:
ffmpeg.exe -y -i input.avi -ss 00:00:01.000 -t 00:00:05.000 output.avi
Look here for more options (size, bitrate, codec, etc.):
http://www.ffmpeg.org/ffmpeg-doc.html#SEC9

Maybe I'll add this to subs2srs someday.
Edited: 2009-04-12, 4:57 pm
Reply
FFmpeg is a great program but it might be a bit bothersome for Windows users to get since it is only released in source code. It's possible to find binaries, but those are usually really old and outdated.
Reply