This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

CLI Magic: Porting DVDs with HandBrake

By Mayank Sharma on April 24, 2006 (8:00:00 AM)

Share    Print    Comments   

The multimedia capabilities of the handheld electronic devices we carry has increased over the last few years. Devices such as the iPod and even several cell phones have become music-oozing gadgets for people on the go. While you can copy your favourite MP3s directly into a handheld device, DVDs (if you have the right to copy them) take some effort, due to the fact that the devices have tiny screens and lack the processing power needed for playing high-quality DVDs. HandBrake, designed initially for BeOS and then ported to Linux and Mac OS, helps encode DVDs for your portable device.

User Level: Beginner

HandBrake under Linux doesn't yet have a graphical user interface and is only accessible from the command line. Although it requires a lot of libraries, you don't have to worry about that. Jam, a software build tool that makes building programs simple, takes care of downloading all the libraries and compiling them. Just make sure you have gcc, g++, and nasm installed. Open a terminal and run the commands:

wget -c http://download.m0k.org/handbrake/HandBrake-0.7.1.tar.gz
tar xvf HandBrake-0.7.1.tar.gz
cd HandBrake-0.7.1
./configure
jam

Depending on your connection speed and hardware, this could take upto 30 minutes. Once its done, gain root access (either through su or sudo) and copy the file you just created to a system directory:

cp HBTest /usr/local/bin/handbrake

It's also a good idea to install a versatile video player such as VLC.

Getting started

Before you begin encoding, make sure to note the location of your DVD drive and the folder where you want to keep the encoded videos. The source will be the VIDEO_TS folder that every DVD has, and in these examples the destination will be an encoded_movies directory under your home directory. This simple command will encode the entire DVD into a MPEG-4 file format:

handbrake -i /media/dvd/VIDEO_TS/ -o ~/encoded_movies/movie.mp4

Like any good CLI application, HandBrake is highly customizable. The command above will combine all chapters into one file. You can use the -c switch to select specific chapters that you want to encode:

handbrake -c 6 -i /media/dvd/VIDEO_TS/ -o ~/encoded_movies/movie_part6.mp4

This will only encode chapter 6. HandBrake will also accept a range of chapters, such as 2-4.

You can't play the videos you create with these commands on most portable devices because the devices have speed and resolution limits. For example, my Sony Ericsson K750i phone will best play MP4 videos at 176x144 at 25 frames/second with a bitrate of 192Kbps and audio sampled at 44100Hz at a bitrate of 128Kbps. To get a DVD video to play on my phone I use HandBrake with a lot more options:

handbrake -w 144 -h 176 -b 192 -r 25 -B 128 -R 44100 -i /media/dvd/VIDEO_TS/ -o ~/encoded_movies/for_phone_movie.mp4

The -w and -h options control the width and height of the video. If you specify only one of these, HandBrake calculates the other, keeping the aspect ratio constant. -b sets the video bitrate; by default it's 1000Kbps. -r keeps track of the video frame rate. -B is responsible for the audio bit rate, and defaults to 128. -R sets the audio sample rate. Some options, such as -r and -R, have a limited set of rates they can take. You can see the choices by typing handbrake -h.

More encoding

In addition to making portable videos out of DVDs, you can use HandBrake like any other DVD ripper to store videos on your hard disk. It can output MP4, AVI, and OGM movies. You specify the format using the -f option. By default HandBrake detects the format from the output filename specified with -o.

If your DVD has multiple audio sources, such as an alternate language, you can choose to encode the output with these as well by specifying the audio channels with the -a option. Only the first audio channel is encoded by default. To get better quality movies, but at twice the encoding time, use the -2 switch. It performs much better compression, making sure those fast action scenes are crystal clear.

Handbrake is powerful encoding tool for making DVDs playable on portable devices and ripping and storing DVDs. It sports many command-line options to make it extremely controllable, and yet not so many as to scare away a new user.

Share    Print    Comments   

Comments

on CLI Magic: Porting DVDs with HandBrake

Note: Comments are owned by the poster. We are not responsible for their content.

excellent

Posted by: Anonymous Coward on April 24, 2006 08:28 PM
thanks for the heads up on handbrake - I've been trying to get DVDRip to work on a couple of occasions earlier, unsuccessfully - handbrake did made it all a lot easier.

#

tovid.org

Posted by: Anonymous Coward on April 26, 2006 07:19 AM
For those interested in creating DVDs for playback in a stand-alone DVD player, check out tovid.org<nobr> <wbr></nobr>... an awesome utility I found a few weeks back. As a side note, if you want to play DVDs on your DVD player, you're probably going to need DVD-R media.

I've been looking for a utility to put some of my movies on my PDA for a while now. I tried DVDshrink (Windows util) and other various programs with minimal success. This program looks awesome!!!

Also, VLC rocks! I use it as my primary player and it even comes as a standalone<nobr> <wbr></nobr>.exe that will work from a USB key. I think I found it at portableapps.com.

#

pre-req's

Posted by: Anonymous Coward on April 26, 2006 08:51 AM
sudo apt-get install jam nasm

#

relief joint

Posted by: Anonymous Coward on May 30, 2006 01:28 AM
[URL=http://nervepainrelief.jeeran.com/painrelief<nobr>.<wbr></nobr> htm] Nerve pain relief [/URL]
[URL=http://www.back.painreliefnetwork.net/lowbac<nobr>k<wbr></nobr> pain.htm] Low back pain [/URL]
[URL=http://blog.gala.net/uploads/painreliefback/<nobr>b<wbr></nobr> ackpainrelief.htm] Back pain relief [/URL]
[URL=http://www.weblog.ro/usercontent/13155/profi<nobr>l<wbr></nobr> es/kneepainrelief.htm] Knee pain relief [/URL]
[URL=http://www.info.painreliefnetwork.net/Pain-R<nobr>e<wbr></nobr> lief.html] Pain relief [/URL]
[URL=http://www.sitefights.com/community/scifi/pa<nobr>i<wbr></nobr> nrelief/painreliefpreved.htm] Pain relief [/URL]
[URL=http://www.info.painreliefnetwork.net/Medica<nobr>t<wbr></nobr> ion-Pain-Relief.html] Medication pain relief [/URL]
[URL=http://www.info.painreliefnetwork.net/Natura<nobr>l<wbr></nobr> -Pain-Relief.html] Natural pain relief [/URL]


[URL=http://painrelief.fanspace.com/index.htm] Pain relief [/URL]
[URL=http://lowerbackpain.0pi.com/backpain.htm] Back Pain [/URL]
[URL=http://painreliefproduct.guildspace.com] Pain relief [/URL]
[URL=http://painreliefmedic.friendpages.com] Pain relief [/URL]

#

Pain relief

Posted by: Anonymous Coward on May 30, 2006 02:05 AM
[URL=http://nervepainrelief.jeeran.com/painrelief<nobr>.<wbr></nobr> htm] Nerve pain relief [/URL]

  [URL=http://www.back.painreliefnetwork.net/lowbac<nobr>k<wbr></nobr> pain.htm] Low back pain [/URL]

  [URL=http://blog.gala.net/uploads/painreliefback/<nobr>b<wbr></nobr> ackpainrelief.htm] Back pain relief [/URL]

  [URL=http://www.weblog.ro/usercontent/13155/profi<nobr>l<wbr></nobr> es/kneepainrelief.htm] Knee pain relief [/URL]

  [URL=http://www.info.painreliefnetwork.net/Pain-R<nobr>e<wbr></nobr> lief.html] Pain relief [/URL]

  [URL=http://www.sitefights.com/community/scifi/pa<nobr>i<wbr></nobr> nrelief/painreliefpreved.htm] Pain relief [/URL]

  [URL=http://www.info.painreliefnetwork.net/Medica<nobr>t<wbr></nobr> ion-Pain-Relief.html] Medication pain relief [/URL]

  [URL=http://www.info.painreliefnetwork.net/Natura<nobr>l<wbr></nobr> -Pain-Relief.html] Natural pain relief [/URL]


  [URL=http://painrelief.fanspace.com/index.htm] Pain relief [/URL]

  [URL=http://lowerbackpain.0pi.com/backpain.htm] Back Pain [/URL]

  [URL=http://painreliefproduct.guildspace.com] Pain relief [/URL]
[URL=http://painreliefmedic.friendpages.com] Pain relief [/URL]

#

awesome

Posted by: Administrator on April 25, 2006 10:45 AM
finally a good DVD ripping program

#

handbrake

Posted by: Administrator on April 25, 2006 01:42 PM
nice! Will try it soon. Tryed DVDrip before, and it was a failure for me. Used to rip with mencoder. That program has somewhat similar syntax as handbrake. But in its man there's only an *.avi encoding option. So I had to use special program later to encode it to mp4 for my PSP. Hope handbrake will make it in one go.

#

CLI Magic: Porting DVDs with HandBrake

Posted by: Anonymous [ip: 67.164.43.83] on July 28, 2007 06:07 AM
Thanks for putting this together. This really works like a charm!!

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya