There’s not much to talk about since the script is still in development, but I can give a few examples to show how the script is intended to work.
Before proceeeding, it’s important to discuss auto-detection. This bit of “magic” can be a real time saver.
- DVD Title Detection: Scans for the DVD title with the longest running time, then scans for other DVD titles that are within 1% of that time. If this logic yeilds only one title, all episodes are assumed to be in that title. If the number of titles found matches the number of episodes specified for the disc, each episode is assumed to have its own title.
- Audio Track Detection: Save yourself a headache and let the script detect and rip all audio tracks.
- Subtitle Track Detection: Same thing.
- Chapter Span List Detection: This you have to be a little careful on. If left to itself, the script will find out how many chapters are in the specified DVD title and divide that by the numbers of episodes specified by the current episode span. The result is rounded down to the nearest whole number (since integer math is used.) This is usually correct, but special episodes can muck this up.
A note on DVD chaptering: There’s usually one or two extra chapters at the end of the DVD title. The most common one is a “ghost” chapter near the last few frames of the title stream. I’m not sure if this is part of the DVD Video specification or not, but its reason for being is easy enough to figure out — chaptering only lists beginning frame numbers. Why it has to be there when you could easily determine the same thing by taking the total overall stream frame count and subtracting the starting frame number of the last chapter is beyond me. Another common one is a “DVD Authoring Credit” chapter, primarily found on DVDs that were fully produced overseas by foreign companies and brought to the US by local companies. In both cases, rounding down the results of [total-chapter]÷[episodes] excludes these chapters.
A note on x264 encoding: Yes, x264 does best when the resulting video resolution is in increments of 16 both horizontally and vertically. However, the devs made a very important change in 2005 that allows non-mod16 resolutions. While x264 still requires 16×16 macroblocks internally, it will pad the video out with mirrored data if the source doesn’t fill the required space. The signifigance on encoding quality varies — the cleaner the source the less of an impact this mirrored data has. Even in worse-case scenarios, it’s better than leaving black borders around the video. Just as a personal recommendation though, if the modulo of your horizontal or vertical cropping is greater than eight, consider rounding up to the next interval of 16. (Example: Crop 32 pixels instead of 28 or crop 16 pixels instead of 10.)
Unfortunately, you must do a bit of homework before using the script.
- The easiest bit of info is which episodes are on each DVD. This is usually given somewhere in the “marketing” — box set cover, box set inserts, DVD jacket, or DVD insert.
- You must determine which DVD title(s) these episodes reside in. This usually requires the help of
mplayer -identify. The actual DVD title numbers themselves don’t have to reamin consistent as long as the episodes always reside inside the longest title(s) on each DVD. If this isn’t the case, there are work-arounds.
- You must determine the chapter setup for all the episodes. This is usally consistent throughout a series, but special episodes can muck up the usual format. The script can automatically determine how many chapters there are per episode, but it assumes that all episodes take the same number of chapters. If there are special circumstances, the DVD on which this occurs can be left out of the series and done later with a manual specification of the chapter spans.
- More likely than not, you’ll want to crop the video to remove black borders. The easiest way to do this is set up ~/.mplayer/input.conf with a keyboard shortcut for switch_ratio 0 and start playing your video through mplayer. Pause the video when you find a bright scene, press your keyboard shortcut to disable scaling, use an application like GIMP to grab a screen shot of the MPlayer window, and then zoom in until you can easily discern pixels. When counting pixels to crop, include “fading” pixels as well.
Just for the sake of showing off, titles will be listed four times in the following order: US title, JP translated title (if the US title was changed), JP romaji title, JP title.
The Adventures of Mini-Goddess
Ah! My Goddess! Being Small Is Convenient!
Aa! Megami-sama! Chicchaitte Koto wa Benri da ne
Just a note: It really shows that the American producers did not give one shit about this series. I know it’s a poor-quality (at least in comparison to the main series) non-canonical off-shoot of the Ah! My Goddess! franchise, but the title is Engrish and ignores the fact there are FOUR goddesses. The best part is how the copyright notice reads “based on the original comics ‘The Adventures of Mini-Goddesses’,” and the DVD labels themselves read MINI_GODDESSES_VOL_[x]. If that doesn’t show a complete lack of care, I don’t know what does.
At any rate…
This is probably the easiest example to use. There’s crap for extras. The DVDs all have the same number of episodes. The episodes all take up the same number of chapters. This is a perfect fit for automation.
- Each DVD contains 12 episodes. (They’re only 7½ minutes long.)
- The episodes all reside inside the longest DVD title, which remains consistent across all DVDs (title #4.)
- The episodes all take three chapters each with no deviation, and there are only 2 superfluous chapters and the end of the DVD title.
srs-dump -loc ~ -ppn MG -esl 1-12,13-24,25-36,37-48 -frc 24p30t-24p -crp 8,10,2,0 -gif
This will use ~/MG as a working directory to dump episodes. The -frc switch sets some parameters to convert the mixed 24fps progressive and 30fps hard-telecined content into 24fps progressive video. The -crp switch sets the left, right, top, and bottom crop settings in pixels. The -gif switch will copy all the DVDs to the hard drive first, so the script won’t be waiting on you to change DVDs.
The script will use the longest title, detect and grab all audio and subtitle tracks, and then correctly determine the number of chapters per episode.
Ah! My Goddess!
This one is perfect for showing why auto-detection isn’t always right and how to get around it.
- Each DVD contains 5 (discs 1 & 2) or 4 (discs 3 – 6) episodes.
- The episodes all reside inside the longest DVD title, but that title number changes between DVDs.
- The episodes all take fives chapters each, except the last three, which take four.
srs-dump -loc ~ -ppn AMG -esl 1-5,6-10,11-14,15-18,19-22 -frc 30t-24p -crp 4,4,0,0 -gif
srs-dump -loc ~ -ppn AMG -esl 23-26 -csl 1-5,6-9,10-13,14-17 -frc 30t-24p -crp 4,4,0,0
The first line does the bulk of the work for the series. It uses auto-detection for the first 5 DVDs since auto-detection will get the right info. The -frc switch will convert the 30fps hard-telecined content to 24fps progressive. And -gif will make sure the computer has plenty of work lined up.
For the last DVD, however, the chapter span list must be manually specified since the last three episodes only take four chapters. Everything else remains the same. Note the lack of the -gif switch, since there’s only one DVD.
There’s also a few extras on each DVD. If you want to rip these, you can use -esl united to completely skip episode numbering. You can even use -csl in conjuction with -esl united, which is useful to seperate the original JP opening and closing sequences. (They’re in the same DVD title.)
Ah! My Goddess: Flights of Fancy
Ah! My Goddess: Everyone Has Wings
No, I’m not picking on the AMG series. They just happened to be first alphabetically and are coincidentally all set up differently.
- Each DVD contains 4 episodes.
- Each episode is in its own title.
- There is one bogus title on each DVD.
- The bogus title is about 100s (7%) shorter on all DVDs except the first one.
Flights of Fancy has an interesting twist. The one bogus title on each DVD is supposed to be for voice actor commentary, but both “bogus” and “legitimate” titles point to the same stream and therefore contain the same audio tracks. Auto-detection can rule out this bogus title on all but the first DVD, since they actually skip the opening and closing sequences.
srs-dump -loc ~ -ppn AMG2 -esl 1-4 -ttl 3,4,9,10 -frc 30t-24p -crop 10,6,0,0
srs-dump -loc ~ -ppn AMG2 -esl 5-8,9-12,13-16,17-20,21-24 -frc 30t-24p -crop 10,6,0,0
Automatic audio track detection will get the bonus commentary track wherever it appears. (Its appearance is not consistent.)