Ripping and Encoding CD media with KAudioCreator and Grip
The best software that I have found for ripping (and encoding) your Audio
CDs into mp3 or OGG (recommended, and better) is either KAudioCreator or Grip
(both easily available from the official
Debian distro). There's not much to say about this EXCEPT the following:
if you want to encode in Ogg/Vorbis format THEN you should also apt-get
the package "vorbis-tools". If you want to encode in MP3 then you'll have
to work a BIT harder:
Since the MP3 format is crawling with a stinky stew of legal morons, you'll need to download the "lame" package which is NOT available through the official Debian distro. Instead, you can look on the website www.debian-multimedia.org. To make a long story short, you should add to your /etc/apt/sources.list file the following entry (you can change "unstable" to "stable" or "testing" or maybe even "experimental"):
deb http://www.debian-multimedia.org/ unstable mainThen (after an "apt-get update") you should be able to install lame with "apt-get install lame".
# YOU SHOULD ALSO KEEP a NORMAL DEBIAN (UNSTABLE/TESTING/STABLE)
# SERVER LISTED HERE TO MEET SOME DEPENDENCIES
In my experience "Grip" seems to do a better job of ripping CDs that might have some damage, but KAudioCreator has a nicer GUI. I use them both.
Ripping and Encoding DVD media with Acidrip and Dvd::rip
I finally have my machine ripping and encoding DVDs. Firstly,
you MUST make sure that your machine can PLAY dvds correctly... see my
Xine Howto for that.
Before we begin ripping and encoding, let's lay down some groundwork for what FORMATs we should use. Here I will ONLY support Open Source formats. You don't want some jerk in Redmond owning your data, do you?
Container format
The "container" is not a video format, but rather a "box" in which
to put a bunch of files. For example, the popular (but inferior, and
NOT Open Source) Microsoft AVI file is a "container". Within that file sits the
actual video, audio, and maybe subtitle formats. There are TWO good
Open Source containers that WE SHOULD USE:
OGM (Vorbis) or MKV (Matroska)
The OGM format is what the Vorbis team (of OGG audio fame) has founded as a container. This container can contain video, audio, and subtitles, although it cannot contain the "vobsub" subtitle format, which is a REAL pain - more about that later. The MKV format is the most advanced container format. The only annoying thing is that the most popular GUI DVD ripping programs don't seem to encode directly in MKV (I have NO idea why).
Video format
There are MANY video formats (called "codecs") out there. The best codecs
(these days) are different attempts to implement the so-called MPEG4 standard
(which is NOT a codec, but a STANDARD). The Microsoft codecs are called
DIVX, although this is obviously proprietary. Again, I'm trying
to avoid them, so I'll pick from one of the following OpenSource codecs:
FFMPEG (better license) or XVID (which is obviously DIVX spelled backwards).
Here I'll use XVID - I've heard that it renders superior video quality
to Microsoft's DIVX anyway.
Audio format
You already know what an mp3 is, and you probably already know what the
legal issues are concerning that pile of junk. The Vorbis team has a
(better, actually) standard called OGG. I'll use that exclusively here.
Subtitle format
There are (as far as I know) two decent formats for subtitles. The first
is called the Vobsub format which pulls the subtitles from the DVD in
graphical format (it is a sort-of MPEG file, actually). Usually this
comes as *two* different files, one with a ".idx" extension and the other
with a ".sub" extension, although oftentimes these files are zipped together
into a ".rar" file (more about that later).
The other subtitle format (the Windows Subrip format) has the extension ".srt", and this is just plain text. Usually these files are generated from a Vobsub file using some kind of Optical Character Recognition (OCR), although this seems to be more of an art than a science. I will not discuss any further here how to generate ".srt" files, although the package "gocr" might be useful to you for such things.
Now Vobsub files CANNOT be put in OGM containers, but SRT files can. This usually means that if you want to distribute an OGM file then you will also have to distribute a Vobsub ".rar" file along with it. This is a pain for two reasons: two files is worse than one for distribution; only MPlayer can play the *separate* ".rar" Vobsub files (Xine pukes, maybe VLC can take it). Furthermore the ".rar" files MUST be encoded with rar 2 format (you probably have rar 3 on your distro). Hence you will have to install a separate (older) rar compression utility. Very primitive.
All files can be put into MKV containers (we're starting to see the advantage already), so this will be our goal. Unfortunately we'll have to do the encoding into the OGM format with separate subtitle files and THEN convert this into MKV format.
Ripping and encoding
Once your machine is PLAYING DVDs correctly, then you have a choice between
several DVD rippers/encoders. Personally I think that the interface to
"acidrip" is the best, however there IS a show-stopper as of
the time of this writing. I noticed that the
audio and video are slightly out of sync, which apparently is a
known problem.
That leaves us with "dvdrip". This is actually a GUI frontend for the powerful "transcode" encoder. Both of these are NOT available with official Debian, but they are available from www.debian-multimedia.org as outlined above already.
Here are the packages that you SHOULD install:
dvdrip vorbis-tools rar-2.80 subtitleripper ogmtools gocr xvid4confThe last two are optional if you want to do some further playing around (Google for details).
With "dvdrip" it took me a couple of tries to figure out the interface. It's not that hard, but some things don't work like you think they should the first time. First, make sure that the directories that you configure have PLENTY of room. Then you should RIP the data (each raw movie will be about 8x1 Gig files on your harddrive)..... After the rip is complete it's time to set some things up before transcoding: in the Subtitles tab you can select the appropriate subtitles that you want, along with how it will be included in your movie. You can "Render" the subtitles directly with the movie, although I don't recommend that (you'll never get rid of them). Better is to click the "create after transcoding" checkmark in the "Create Vobsub file" box. This will create SEPARATE ".rar" files (which are zipped-up versions of Vobsub files).
VERY IMPORTANT TIP: If you are ripping and encoding MULTIPLE tracks from a DVD (i.e. you have more than one track selected in the "Rip Title" tab), then when you set up "Clip and Zoom", "Subtitles", and "Transcode" you need to repeat the settings for EACH TITLE SEPARATELY. When you finally hit the transcode button it will work on all of them in sequence (all night long). If you don't configure each title separately then your settings will only apply to the first one in the list. The rest will use the defaults. I wasted a whole night of transcoding on this. AHHHHHHHHH.
Cropping and Resizing (Clip and Zoom)
This is really just a matter of playing around. I don't
really know much about the different screen formats out there,
but here is what I have found so far. There are several
different aspect ratios that you'll likely encounter, and
some are listed as follows (width/height):
4/3=1.33:1 at 720x480 (NTSC Standard Television - usually quoted as 4/3
although 4/3=1.33/1 which is NOT 720/480=1.5/1!
This is because
the "pixels" in TV are not square, but are actually slightly
rectangular (about 13% taller than square). Hence a
720x480-pixel frame size gets rendered at a 4/3=1.33/1 aspect ratio!)
16/9=1.77:1 (Widescreen TV. This is STILL
delivered at 720x480 but the image is "squeezed" in horizontally - the
TV does the unsqueezing to 33% wider, hence generating an image
that is about 958x480. Obviously 958/480=2:1 which is NOT 16/9=1.77:1!!!
Again this is because TV pixels are not SQUARE -
taking that into account gives 16/9)
1.85:1 (Academy Flat movie format - wider than widescreen)
2.35:1 (CinemaScope movie format - even WIDER still)
Usually (from what I've seen so far - if you live in the US)
you'll receive the DVD images in NTSC 720x480 format (if
you live elsewhere then you probably will get PAL format, which
is a bit different but similar - I think the odd-shaped TV
pixels are different for PAL, too. Google for details. What
I describe here, however, is enough information for you to
figure out how to crop ANY movie in ANY format).
Obviously movies are filmed in (usually) 1.85:1 or
2.35:1 aspect ratio, so clearly the 720x480 DVD frame size
isn't WIDE enough (or is too tall, depending upon how you
look at it) to render the movie appropriately. This
is handled ON THE DVD ITSELF in 1 of 3 ways
(starting from the worst, getting
to the best):
(1) The sides of the movie are CUT OFF - this is called
Pan and Scan ("Fullscreen") and it sucks
(2) The movie is "letterboxed", meaning that big black
empty areas are put on the top and the bottom and the
movie is uniformly "shrunk" until it fits into 720 pixels
across. For a 2.35:1 movie (taking into account the non-square
pixels) the movie will be stored as a 720x270 "floating box"
in the middle
of the regular 720x480 frame. This is how the movie is
encoded on the DVD, which is a HUGE waste of space (but
better than cutting off the sides). For a 4/3 TV this
is what must be done eventually anyway, so it probably
doesn't matter much. For a widescreen TV, however, you
will probably be forced to put the TV in a pseudo-4/3
format (puts black bars on the sides and displays the
image in a 4/3 virtual box in the middle - this will
make the entire movie look like a little postage stamp
surrounded by black bars on ALL sides).
(3) The movie is "anamorphic", meaning that the movie is
squeezed in horizontally. This is just the way that
widescreen TV is encoded anyway, so this works WELL. Since widescreen
is 16/9 and the NTSC signal is 4/3 the image will be
stretched horizontally by 33% to render the image
appropriately on a widescreen TV. For regular 4/3 TV
the opposite is done: the DVD *player* COMPRESSES the
image VERTICALLY and adds black bars
on the top and bottom (otherwise everything looks too
skinny). This gives pretty much the same results on a
regular TV as the "letterbox" method above. (Your player
must be told to deliver the signal in 4/3 "letterbox" to
do this).
Anamorphic format is the best
because it uses the maximum amount of DVD
data space to its fullest advantage - giving you the highest
amount of "information" - hence the highest fidelity image.
For regular TV it probably doesn't matter much (still
go with the anamorphic, though - it costs no more, and it
IS the standard now), but for widescreen it IS a big deal.
It is clear that even with anamorphic "stretching" most movies will have black bars on the tops and bottoms EVEN ON THE DVD (since movies are usually wider than even the "widescreen" TVs). So it is true that SOME space is being wasted, but not nearly as much. Let's see how much. The NTSC frame on the DVD again is 720x480. This gets stretched by 33%. So (taking into account the non-square TV pixels) a 2.35:1 Cinemascope movie is encoded on the DVD as a 720x360-pixel floating image in the 720x480 frame. Clearly this is much more DATA than the 720x270 "letterboxed encoding" method.
A similar bit of logic applies to movies encoded in 1.85:1 format. The actual movie will be a 720x456-pixel floating frame in the 720x480 NTSC frame. HOWEVER this is NOT ALWAYS TRUE. It seems that some jackasses see how "close" 1.85 is to 1.77, so instead of encoding the movie at the correct 1.85:1 aspect ratio they crop a bit off the sides and make it 1.77:1 - filling the entire 720x480 pixels (but losing some data on the sides). Some losers just can't stand to have black bars (no matter how thin) on their widescreen TVs!!!
A warning: I'll bet that some idiotic studios crop even 2.35:1 movies to 1.77:1, so WATCH OUT. I haven't seen this yet, but I haven't ripped many DVDs, either. Why?!?
What this all means!
When cropping and zooming I do the following: in DVD::Rip
I set the "Presets" to "No Modifications" - I like to
do it myself (thank you).
I first clip
off the black bars on the top and bottom (so for a 2.35:1
movie I take 60 pixels off the top AND bottom to give a
720x360 picture). Then (since I'm going to be compressing
the data anyway) I "zoom" the 360 down to a number which
makes the ratio be 2.35:1. So I use a 720x306 frame (although
actually I use a 720x304 frame because then I get the "fast
resizing" option in dvdrip. A couple of pixels here and there
won't be noticeable). Notice that I didn't correct for the
crazy odd-shaped TV pixel size here because now I'm sticking
the movie on my computer, which has SQUARE pixels. So I
guess you didn't need to know any of the above junk (although
it can be confusing if you don't realize that TV pixels are
non-square and you know how to do 3rd grade math - or
"maths" if you are one of my British empire friends!!!)
For a 1.85:1 movie the method is similar. If the movie is formatted at its proper 1.85:1 format then (when played through the computer this is easier to see) very skinny black bars should appear on the top and bottom. This is GOOD!!! In this case I do the following: I first crop off 12 pixels from the top AND the bottom (cut off the black bars) - reducing me to a screen that is 720x456. Then I "zoom" the 456 to 384 pixels (I'm technically off by a couple of pixels but with 384 I can use the "fast resizing" option in dvdrip).
If there are NO black bars on the top and bottom then the movie has been encoded at 1.77:1 (16/9). In this case no cropping is necessary, but I scale the 720x480 down to 720x408 (again I'm a bit off but this gives "fast resizing"). Hopefully the movie was originally filmed at 1.77:1 (like HBO films), but more likely it has just been cropped. Either way there is nothing to do about it.
Now we're ready to "transcode" the DVD.
Transcoding
Now go into the "Transcode" tab. First, set your "Container" to OGG.
Then in the "Video options" choose the latest XVID format.
In the "Video bitrate calculation" box you can select the
quality of your movie. I find that the BEST compromise between size and
quality (for the typical 1.5-2 hour movie) is to use TWO 700MB files
(obviously you can just use a single 1400MB file if you don't care about
putting them on CDs). In the "Audio" box select "Vorbis". You can
change your bitrate preferences: 128kbps is BARE MINIMUM, 160 is fine,
192 is better (beyond
that I don't believe any human can detect the difference... still many
go for 256kbps).
Before you click the "Transcode" button you should check the "split files on transcoding" checkmark if you care to have separate files. I've also noticed that my audio is OUT OF SYNC if I leave the so-called "PSU Core" on, so I always turn the PSU Core OFF!!! Ironically I think the PSU Core is supposed to HELP with audio/visual syncing problems, but it has only caused me grief! Start the transcoding and go to bed.
Converting OGM to MKV
At the end of the process, in the "avi" subdirectory of your dvdrip
project you will have files with ".ogm" (and ".rar" extensions, if
you used subtitles). If you don't have subtitles then you are done:
an OGM file is perfectly good. If you do have subtitles, however,
then read on. First,
you should "unrar" the rar files (this extracts them into files with
".sub" and ".idx" extensions).
Install the (regular Debian) package "mkvtoolnix-gui" and run the program "mmg". This will allow you to take your OGM and Vobsub files and "mux" them all into a single MKV file. The interface is pretty self-explanatory (and it's pretty quick), so there's no need to elaborate. NOW you should be able to watch your movies in either Xine OR MPlayer with subtitles, and it will all be in one neat file.
Burning CD and DVD media with K3B
By far the best software for burning CDs is k3b (part of KDE). It just
seems to be the most stable, most options, etc. I used to use Gnomebaker,
but I often had problems with it crashing. Since I haven't had problems
with k3b there isn't much to say (except: install it).
Note that K3B claims to burn DVDs with no problem, although since I haven't actually tested that yet (haven't found the need so far) I cannot comment - it probably works (although, as usual, nothing is ever as easy as it seems).
This page has been visited 1,523 (0 today) times since December 04, 2005