<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The HyRax Macrocosm &#187; MPlayer</title>
	<atom:link href="http://www.serenux.com/tag/mplayer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.serenux.com</link>
	<description>Life, the Universe and Ubuntu.</description>
	<lastBuildDate>Sun, 29 Aug 2010 21:35:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>HowTo: Use lxbdplayer &#8211; the Open Source Blu-Ray Disc player for Linux</title>
		<link>http://www.serenux.com/2010/06/howto-use-lxbdplayer-the-open-source-blu-ray-disc-player-for-linux/</link>
		<comments>http://www.serenux.com/2010/06/howto-use-lxbdplayer-the-open-source-blu-ray-disc-player-for-linux/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 10:45:51 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Blu-ray]]></category>
		<category><![CDATA[High-Definition]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Lucid]]></category>
		<category><![CDATA[MPlayer]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=738</guid>
		<description><![CDATA[Yes, you read that right &#8211; there is finally an Open Source Blu-Ray Disc player GUI for Linux, albeit unofficial and certainly very grey in legality depending on which country you are in. lxbdplayer is the collaborative effort of four French Engineering students. What they have written is basically a frontend that combines the apps [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, you read that right &#8211; there is finally an Open Source Blu-Ray Disc player GUI for Linux, albeit unofficial and certainly very grey in legality depending on which country you are in.</p>
<p><em>lxbdplayer</em> is the collaborative effort of four French Engineering students. What they have written is basically a frontend that combines the apps <em>DumpHD</em> and <em>AACSKeys</em> which I have used in previous Blu-Ray articles into one easy to use GUI. Decrypted BD streams are then piped into <em>MPlayer</em> for playback.</p>
<p>The end result is that you can now watch your BD movies almost as simply as a regular video player without the need to go through the process of ripping them into an MKV file first, or chewing up loads of drive space.</p>
<p><span id="more-738"></span>Now before you get all excited, this is a work in progress and you are ultimately limited to the decryption keys that have been discovered so far. You have no better ability to watch BD titles than you have with doing it all manually with <em>DumpHD</em> and <em>AACSKeys</em>. In fact, <em>lxbdplayer</em> already falls over in one area (for now), and that is it has no ability to process BD+ protected discs. Attempting to watch such movies will show a partially or fully corrupted video stream.</p>
<p>I tried using <em>lxbdplayer</em> with several of my BD titles under Ubuntu 10.04, and found that it played all my older titles pretty much perfectly. It&#8217;s only newer titles, especially those featuring BD+ protection that are problematic.</p>
<p>In short, this tool will only let you play older BD titles easily, but no doubt as <em>DumpHD</em> and <em>AACSKeys</em> progress in development, we will see those improvements filter down to <em>lxbdplayer</em>. I should also point out that <em>lxbdplayer</em> does not actually play the <em>disc</em> as such &#8211; it pulls out the <em>titles</em> available on the disc and allows you to play them by choosing them from a menu. It will not actually allow you to play the menu interfaces provided on the disc.</p>
<p>Your BD optical drive will also need to have been hacked with custom firmware to ignore the Player certificate, or use an imported BD drive that already ignores the Player certificates, or <em>AACSKeys</em> will not be able to retrieve the decryption key to decrypt the disc with.</p>
<p>Anyway, to use <em>lxbdplayer</em>, you will need to download the following:</p>
<ul>
<li>The <a title="lxbdplayer for Ubuntu and Debian" href="http://sourceforge.net/projects/lxbdplayer/files/ubuntu_deb/lxbdplayer_0.2.1_all.deb"><em>lxbdplayer</em></a> itself. This package is a .deb for Ubuntu and Debian.</li>
<li>The <a title="AACSKeys Plugin for lxbdplayer" href="http://www.mediafire.com/?d1n3zyyhz2h"><em>AACSKeys</em> plugin</a> for <em>lxbdplayer</em>.</li>
<li>The <em><a title="The MakeMKV package" href="http://www.mediafire.com/?rnjoym0q1q4">MakeMKV</a></em> package (this is the 64-bit version. To get the 32-bit version, click <a title="32-bit version of MakeMKV" href="http://www.mediafire.com/?mdimv3yobwo">here</a>).</li>
<li>The <a title="The ShowKeys library package" href="http://www.mediafire.com/?yz2yj3it3il"><em>ShowKeys</em> library</a> (again, this is the 64-bit version. To get the 32-bit version, click <a title="32-bit version of ShowKeys" href="http://www.mediafire.com/?5ynetmrww21">here</a>).</li>
</ul>
<ol>
<li>Install the packages by either double-clicking on them and let the GDebi installer install them, or use a terminal as follows:
<pre><span style="color: #000080;">$ sudo dpkg -i lxbdplayer_0.2.1_all.deb lxbdaacs_0.2.1_all.deb makemkv_1.5.5b_amd64.deb libshowkeys_v1.5.5_amd64.deb</span></pre>
</li>
<li>A couple of dependencies will need to be downloaded, but otherwise the installation is small and quick.<br />
.</li>
<li>Once the install is complete, import the decryption keys needed by typing in the following command (you do not need to use sudo here):
<pre><span style="color: #000080;">$ bdkey-install</span></pre>
</li>
<li>Now you are ready to rock and/or roll.<br />
.</li>
<li>Insert your BD movie disc into your BD drive. Within seconds you should be prompted by Gnome about what to do with the disc, and you will notice that there is a new default action for BD discs to launch <em>lxbdplayer</em>. Go ahead and allow <em>lxbdplayer</em> to launch, or alternatively launch it manually from <em>Applications-&gt;Sound &amp; Video-&gt;lxBDPlayer</em>. If you manually launch, you need to tell the player where your BD title is mounted. Under Ubuntu Lucid, this will be under the <em>/media</em> directory.<br />
.</li>
<li>Once your BD disc is located, <em>lxbdplayer</em> will process the disc for a short while before presenting you with a chapter list. To play a title, simply choose it from the list and hit the Play button. Almost right away you will see the video appear on your screen.</li>
</ol>
<p>The player showing the video itself is simply <em>MPlayer</em>, and all its standard controls apply here.</p>
<p>Pat yourself on the back &#8211; and enjoy your movies. <img src='http://www.serenux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>More information about <em>lxbdplayer</em> including screenshots, can be found on the <a title="lxbdplayer Home Page" href="http://doc.ubuntu-fr.org/lxbdplayer?rev=1276774959">project&#8217;s home page</a>, but be warned, it&#8217;s all in French.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2010/06/howto-use-lxbdplayer-the-open-source-blu-ray-disc-player-for-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: Rip a Blu-ray movie using an LG GGC-H20L Blu-ray drive with Ubuntu</title>
		<link>http://www.serenux.com/2009/01/howto-rip-a-blu-ray-movie-using-an-lg-ggc-h20l-blu-ray-drive-with-ubuntu/</link>
		<comments>http://www.serenux.com/2009/01/howto-rip-a-blu-ray-movie-using-an-lg-ggc-h20l-blu-ray-drive-with-ubuntu/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 00:50:03 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Blu-ray]]></category>
		<category><![CDATA[High-Definition]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Intrepid]]></category>
		<category><![CDATA[LG]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MPlayer]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=356</guid>
		<description><![CDATA[The Blu-ray disc format has brought with it the ability to easily provide the next generation of High-Definition 1080p movie content. There&#8217;s just one problem &#8211; Ubuntu and Linux in general has no official support for Blu-ray, and its encryption scheme is vastly different to that of DVD &#8211; it&#8217;s not just a simple case [...]]]></description>
			<content:encoded><![CDATA[<p>The Blu-ray disc format has brought with it the ability to easily provide the next generation of High-Definition 1080p movie content. There&#8217;s just one problem &#8211; Ubuntu and Linux in general has no official support for Blu-ray, and its encryption scheme is vastly different to that of DVD &#8211; it&#8217;s not just a simple case of installing a library like the libdvdcss2 library for decrypting DVD&#8217;s &#8211; the protection is done both at a software and hardware level.</p>
<p>This article discusses how I used my recently purchased LG GGC-H20L Blu-ray ROM drive to successfully read and watch movies using Ubuntu Intrepid.</p>
<p><span id="more-356"></span><em>DISCLAIMER: This article describes decrypting BD titles using an Intel or AMD based PC with Ubuntu Linux. While you can use a PlayStation3&#8242;s BD drive to read and decrypt a title using <strong>known</strong> decryption keys using the PS3 version of Ubuntu, at this time of writing you <strong>cannot</strong> use Ubuntu installed on a PlayStation3 console to identify <strong>unknown</strong> decryption keys of a given BD title because the application used to derive those keys from the disc is not available for the PPC processor used by the PS3. You must use a consumer BD-ROM drive on an Intel or AMD based PC instead.<br />
</em></p>
<p>Hang on, you say &#8211; if there is no support for playback of Blu-ray movies on Linux, then why buy a Blu-ray drive if you can&#8217;t watch the movies? Well, I might not be able to watch them directly, but I can certainly rip the little buggers and watch a file version of it instead. But wait again, you say, if there&#8217;s no official Blu-ray support, and you can&#8217;t watch the discs directly, then how on earth do you rip them?? I&#8217;m glad you asked, and even if you didn&#8217;t ask, I&#8217;m about to tell you anyway. <img src='http://www.serenux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First up, a little Blu-ray 101.</p>
<p>Blu-ray movies feature Digital Rights Management (DRM). Like DVD&#8217;s before it, most Blu-ray movies are encrypted. This is to stop those naughty pirate types from making illegal backups of the movie and giving or selling it to their mates. In the case of DVD&#8217;s, however, there was only one decryption key which was eventually discovered and from then on allowed all DVD&#8217;s to be easily decrypted using a simple library (called libdvdcss2). The movie industry as a whole were not impressed by this and insisted that the next format be more difficult (preferably impossible) to decrypt, so Blu-rays (and HD-DVD&#8217;s, but I&#8217;ll concentrate on Blu-ray for this article) each have a different decryption key now. But to complicate this further, this key is kept hidden from you by an authentication mechanism to ensure that there isn&#8217;t a repeat of the De-CSS scandal that brought the DVD encryption scheme undone.</p>
<p>Each and every player out there, hardware or software, has a unique player authentication key which is passed to the Blu-ray optical drive, essentially like giving your passport to Customs at the country border, to validate whether or not you are legally authorised to  playback a movie. If the drive has not got a blacklisted record of your authentication key, and the key is accepted as a generally valid key that has been paid for, THEN the drive will give up the movie&#8217;s decryption key and movie playback can commence.</p>
<p>Blacklist?? What blacklist? Well, like DVD players, it&#8217;s not difficult to pick up a Blu-ray player&#8217;s authentication key that is used to prompt the drive for the disc&#8217;s decryption key, after all, it has to be held in memory somewhere. Once an industry authority discovers that an authentication key has been compromised, it is added to a blacklist so that it will not work anymore. This is why hardware Blu-ray players need to be firmware-upgradable, and why software players need to be upgraded to the next version periodically with patches, etc, so that new, non-blacklisted authentication keys can be provided.</p>
<p>OK, that sounds all well and good, but if the Blu-ray drive itself is doing the blacklisting, how exactly does it know when a given authentication key is no longer valid? Simple &#8211; its blacklist will get updated with the next latest-release movie you buy.</p>
<p>Say what?</p>
<p>Every Blu-ray movie you buy has a little file on the disc under the &#8220;AACS&#8221; folder called &#8220;ContentRevocation.lst&#8221;. This file contains a complete list of blacklisted authentication keys for the drive to update itself with, and &#8211; get this &#8211; you can&#8217;t stop the drive loading it. Well, actually to be more accurate this file is simply a copy of the same list that is actually hidden in a non-tamperable, non-user-readable area elsewhere on the disc for the drive to read, but basically the instant you stick that movie disc in, the hidden version of this file is read and the drive automatically updates its blacklist right away with any new blacklist data, even before the disc icon appears on your desktop. Sneaky, huh?</p>
<p>So the next time your legal (or more specifically, pirated) copy of PowerDVD or whatever tries to playback a movie, all of a sudden you&#8217;ll see an error message instead saying that your player&#8217;s authentication key has been revoked &#8211; thus the movie is now unplayable. What&#8217;s worse is that you won&#8217;t be able to watch any of your older discs that worked previously either! It&#8217;s this exact reason that many people have called for the Blu-ray (and HD-DVD) formats to be <a title="Why you should boycoot Blu-ray and HD-DVD." href="http://bluraysucks.com/" target="_blank">boycotted</a>.</p>
<p>But not all is lost. Remember, this is an encryption technology created by Man, and therefore can be broken by Man with a bit of help from the Open Source Community at large. <img src='http://www.serenux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  With a little help from a few external resources including the <a title="Ubuntu Community Documentation" href="https://help.ubuntu.com/community/RestrictedFormats/BluRayAndHDDVD" target="_blank">Ubuntu Community Documentation</a> and the <a title="Doom9 Forums" href="http://forum.doom9.org" target="_blank">Doom9 forums</a>, I discovered a plethora of projects by various people, from dumping discs to breaking the encryption and authentication.</p>
<p>On the surface are general applications to dump the movie, decrypted, to a file. One of the best projects is <a title="DumpHD on the Doom9 Forums" href="http://forum.doom9.org/showthread.php?t=123111" target="_blank">DumpHD</a> which is a Java app that provides a nice easy to use GUI that can rip a movie with a minimum of fuss (see detail about how to use it later in this article), however it requires that you already know what the decryption key for a given movie is which you can only obtain if you have authenticated with the drive. If you have the decryption key already, however, then authentication is not necessary and you can rip the movie right away without a problem, so this project is heavily supported by people posting up various decryption keys for all sorts of movie releases. The problem with this approach, however, is that different countries usually get different releases of the same movie, so for example a release of &#8220;Batman Begins&#8221; in Australia might have a completely different decryption key to the release of &#8220;Batman Begins&#8221; in America or Europe. This is not always the case of course, a good example being the Ewan McGregor movie &#8220;The Island&#8221; &#8211; the Australian release is actually the UK release, right down to the age-rating and film-office classification markings on the disc itself &#8211; only the box bears any Australian ratings markings!</p>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/BlurayMovieInserting.jpg" target="_blank"><img title="Inserting a Blu-ray movie into the LG GGC-H20L" src="http://www.serenux.com/~hyrax/snaps/BlurayMovieInserting_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (228K)</p>
<p>So, how do you find out the decryption key of your locally purchased movie then? You don&#8217;t want to keep buying a commercial player, especially one that doesn&#8217;t run under Ubuntu, just to get a valid authentication key. There&#8217;s got to be a better way! Well, there is! How about we just bypass the authentication procedure altogether? How? Again, through another great contribution on the Doom9 forums.</p>
<p>The LG GGC-H20L drive is but one of many Blu-ray/HD-DVD drives which have had their firmware reverse-engineered. Firmware is largely just a computer program that operates the drive. Since the firmware is upgradable to fix bugs and add new features to the drive, it means the program can be altered by a third party. A Doom9 contributor has provided <a title="Modified Blu-ray drive firmware" href="http://forum.doom9.org/showthread.php?t=139522" target="_blank">modified firmware</a> for various popular drives, including the GGC-H20L that effectively allow the drive to ignore the authentication procedure no matter what player authentication key is provided, blacklisted or not, thus making the drive give up the decryption key for the Blu-ray movie currently inserted every time!</p>
<p>In the case of the LG GGC-H20L that I use, the firmware is provided as a Windows Executable file. There are three ways to run this, either via a native Windows installation on your PC, a virtualised Windows installation on your PC, or via the Wine compatibility layer. I successfully upgraded my drive using the Wine option as follows:</p>
<p><em><span style="color: #ff0000;"><strong>WARNING: The following information can damage or even brick your LG Blu-ray drive if not followed correctly, or if you have a power failure during firmware update. You proceed at your own risk and I will not be held responsible for any damage incurred by your drive, or for loss of hair being torn out, by following these instructions.</strong></span></em></p>
<ol>
<li>You need a normal Wine installation. If you&#8217;ve never installed it before, then type in:
<pre><span style="color: #000080;">$ sudo apt-get install wine</span></pre>
<p>&#8230;and this will install the Ubuntu-repository version of Wine.</li>
<li>Since we&#8217;ll be modifying a physical device, only root can do that, so we will need to use sudo to execute the firmware upgrade, however Wine will not work as root until we change permissions of your Wine configuration in your Home directory, so type in the following to make root the owner of your Wine configuration:
<pre><span style="color: #000080;">$ sudo chown -R root:root ~/.wine</span></pre>
</li>
<li>Now execute the downloaded firmware file:
<pre><span style="color: #000080;">$ sudo wine GGC-H20L_1.03_VolumeID_Patch.exe</span></pre>
</li>
<li>The Upgrade GUI will appear. Click on the button to commence update and let it do its thing. After a minute or two, it will tell you that the drive firmware has been successfully updated. At this point, you will need to reboot your PC, but before you do, remember to change the owner of your Wine installation back to yourself. If your login was &#8220;jbloggs&#8221;, then you&#8217;d type in:
<pre><span style="color: #000080;">$ sudo chown -R jbloggs:jbloggs ~/.wine</span></pre>
</li>
</ol>
<p>Upon returning from restart, every time you query the drive for the inserted disc&#8217;s decryption key, the drive will now happily give it to you without question. Nice.</p>
<p>So how do we query the drive for that decryption key anyway? A simple tool to do this is <a title="AACSKeys - gets a movie's decryption key" href="http://forum.doom9.org/showthread.php?p=1320065#post1320065" target="_blank">aacskeys</a> (version 0.4.0c at this time of writing, but check further along the thread for newer releases) written by another Doom9 member, which queries the drive and tells you its Volume Unique Key and its Disc ID, which you can then copy and paste into DumpHD&#8217;s keys config file and happily begin dumping your movie.</p>
<pre><span style="color: #000080;">$ ./aacskeys /media/cdrom
aacskeys 0.3.6 by arnezami, KenD00

Volume Unique Key:              5D9BCD44522B6940F8705400DA612ED9
Unit Key File Hash (Disc ID):   837487B4D6F614D5B4D5F566387B41C2D284F393
$ </span></pre>
<p>If your drive&#8217;s firmware was not patched, instead of seeing the Volume Unique Key and Disc ID, you would get this error message instead: &#8220;The given Host Certficate / Private Key has been revoked by your drive.&#8221;.</p>
<p>We now need to take the output data and copy it to DumpHD&#8217;s &#8220;keydb.cfg&#8221; file. Each key is placed on its own line in the following format:</p>
<pre><span style="color: #000080;">DISC ID = Movie Title | D | YYYY-MM-DD | V | VOLUME UNIQUE KEY</span></pre>
<p>Thus in the example above, we would enter:</p>
<pre><span style="color: #000080;">837487B4D6F614D5B4D5F566387B41C2D284F393 = The Island | D | 2007-03-22 | V | </span><span style="color: #000080;">5D9BCD44522B6940F8705400DA612ED9
</span></pre>
<p>Now technically it appears that the date is largly irelevant, and most people just use 0000-00-00 instead of a real date (which is supposed to be the file date of the &#8220;Unit_Key_RO.inf&#8221; file in the &#8220;AACS&#8221; folder of the disc). I have tested this and I can&#8217;t see any difference in how DumpHD handles the disc.</p>
<p>Once you have finished editing the keydb.cfg file, save it.</p>
<p><em>NOTE: DumpHD (below) can now use AACSKeys directly, saving you having to edit to the keydb.cfg file manually, because DumpHD now does all the work for you. See <a title="A better way of using AACSKeys with DumpHD." href="http://www.serenux.com/2009/09/howto-deal-with-bd-copy-protection-when-ripping-blu-ray-titles-using-ubuntu/" target="_blank">this article</a> for more information.</em></p>
<p>Since DumpHD is a Java application, you will need Java installed to run it. If you haven&#8217;t already got it installed, you can install it with the following command:</p>
<pre><span style="color: #000080;">sudo apt-get install java-common</span></pre>
<p>&#8230;or more realistically you should install it as part of the ubuntu-restricted-extras package which also installs a number of other useful packages:</p>
<pre><span style="color: #000080;">sudo apt-get install ubuntu-restricted-extras</span></pre>
<p>Once that is done, launch DumpHD by simply running the &#8220;dumphd.sh&#8221; script by either double-clicking on it and select &#8220;Run&#8221; when prompted, or in a terminal, change to where you extracted the DumpHD program and type in:</p>
<pre><span style="color: #000080;">$ sh ./dumphd.sh</span></pre>
<p>When loaded, you will be presented with the following interface:</p>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/DumpHDFrontend.jpg" target="_blank"><img title="DumpHD Frontend" src="http://www.serenux.com/~hyrax/snaps/DumpHDFrontend_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (63K)</p>
<p>At the top-right of the window, there is the Source Browse button. Click on it and a new window will appear. In that window, type in or select &#8220;/media/cdrom&#8221; and then click OK. After a few seconds, the disc should be identified and you will see the window change as follows:</p>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/LoadedMovieReadyToRip.jpg" target="_blank"><img title="DumpHD Frontend" src="http://www.serenux.com/~hyrax/snaps/LoadedMovieReadyToRip_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (85K)</p>
<p>Now all you need to do is click on the Destination Browse button, specify a place to store the decrypted movie and then click the Dump button to start the whole process! Once finished, you will have every video title found on the disc dumped in its originally encoded (video-wise) format, but without DRM. You can then use MPlayer to play these files directly. Generally the movie itself is the largest file, so in the case of my example, it&#8217;s the &#8220;00000.m2ts&#8221; file. I can play it simply with:</p>
<pre><span style="color: #000080;">$ mplayer -fs 00000.m2ts</span></pre>
<p>The -fs parameter plays the movie full-screen. I can toggle audio tracks using the hash (#) key (as for some reason, English is generally not the first audio track on the disc).</p>
<p>Remember that Blu-ray movies are very large. In my example, &#8220;The Island&#8221; is a good 21GB! It&#8217;s now up to you to decide whether or not you want to provide storage for your rips of this size, or whether or not you want to compress them down to save space. In my case, I was able to compress the movie down to about 4GB with negligible quality loss at a bitrate of 1200 using the x264 codec. I&#8217;ll probably increase this bitrate and allow the filesize to go to 8GB so I can maintain as near-perfect image quality to the original Blu-ray as possible. I personally choose to preserve the audio tracks as-is without down-converting them &#8211; they really don&#8217;t eat up that much space &#8211; a few hundred megabytes only.</p>
<p>Happy ripping!</p>
<p><span style="color: #0000ff;"><em><span style="text-decoration: underline;"><strong>Woah! After I&#8217;ve ripped the movie, it plays but it&#8217;s all corrupted! What&#8217;s going on?</strong></span></em></span></p>
<p>The movie you have ripped is likely protected using BD+ protection. This is where some or much of the movie is deliberately corrupted to annoy you. I have written a guide on how to deal with this and correct the corruption <a title="Dealing with BD+ copy protection on Blu-ray discs." href="http://www.serenux.com/2009/09/howto-deal-with-bd-copy-protection-when-ripping-blu-ray-titles-using-ubuntu/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/01/howto-rip-a-blu-ray-movie-using-an-lg-ggc-h20l-blu-ray-drive-with-ubuntu/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>HowTo: Rip a DVD video title into an x264 and Ogg encoded MKV video file</title>
		<link>http://www.serenux.com/2008/12/howto-rip-a-dvd-video-title-into-an-x264-and-ogg-encoded-mkv-video-file/</link>
		<comments>http://www.serenux.com/2008/12/howto-rip-a-dvd-video-title-into-an-x264-and-ogg-encoded-mkv-video-file/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 03:27:46 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Encoding]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MEncoder]]></category>
		<category><![CDATA[MPlayer]]></category>
		<category><![CDATA[Ogg]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[x264]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=249</guid>
		<description><![CDATA[Many people like myself jumped aboard the revolution that was the DVD ten years ago (has it already been that long??) and collected a vast library of discs that now take up space on several shelves in the corner of your lounge room. In this day and age of the PVR and DVR, even I [...]]]></description>
			<content:encoded><![CDATA[<p>Many people like myself jumped aboard the revolution that was the DVD ten years ago (has it already been that long??) and collected a vast library of discs that now take up space on several shelves in the corner of your lounge room. In this day and age of the PVR and DVR, even I myself find it frustrating to go to the shelf, find the movie I want to watch, take the disc out, make sure it&#8217;s free of fingerprints, stick it in the drive, skip all the blasted &#8220;mandatory&#8221; ads and trailers before you can actually get to the movie itself. At least with YouTube and downloaded AVI and MPEG files, you can simply double-click and watch what you want, when you want, on demand, 24/7 &#8211; no mess, no fuss.</p>
<p>So here I present a guide on how to rip your DVD collection into convenient, tidy x264-encoded MKV files. You may find that you can store your entire collection of DVD&#8217;s onto a single external hard-drive to carry with you, and will certainly serve as a useful backup the day that some inconsiderate soul scratches or steals your DVD&#8217;s! This HowTo is based on <a title="The Smorgasbord guide to DVD ripping" href="http://www.smorgasbord.net/howto-rip-dvds-in-mpeg-4-avc-x264-multi-audio-subtitles-matroska/" target="_blank">The Smorgasbord</a> HowTo, but with modifications to bring it up to date with current implementations of x264 and MEncoder.</p>
<p><span id="more-249"></span><span style="text-decoration: underline;"><strong>Purpose:</strong></span></p>
<p>To rip a DVD video disc title&#8217;s components (video, audio, subtitles, etc) into a single Matroska (.mkv) file.</p>
<p><span style="text-decoration: underline;"><strong>Why a Matroska file instead of an MPG or AVI file?</strong></span></p>
<p><a title="Matroska Homepage" href="http://www.matroska.org/" target="_blank">Matroska</a> is an open-standards container format that is rapidly gaining support. It is an envelope for which there can be many audio, video and subtitles          streams, allowing the user to store a complete movie or CD in a single          file. Matroska offers many benefits including:</p>
<ul>
<li>Fast seeking in the file</li>
<li>High error recovery</li>
<li>Chapter entries</li>
<li>Selectable subtitle streams</li>
<li>Selectable audio streams</li>
<li>Modularly Extendable</li>
<li>Streamable over internet (HTTP and RTP          audio &amp; video streams)</li>
<li>Menus (like DVDs)</li>
</ul>
<p><span style="text-decoration: underline;"><strong>Pre-requisites:</strong></span></p>
<p>To rip a DVD title, you will need:</p>
<ul>
<li>A DVD video disc with a title or two to rip from (yes, sounds obvious doesn&#8217;t it?).</li>
<li>Any garden-variety DVD-ROM drive to read the disc with.</li>
<li>A reasonably powerful PC &#8211; any Core 2 Duo or better will suffice. You can use a slower machine such as a Pentium 4, but the ripping and encoding time can be a difference of several hours.</li>
<li>Suitable storage space to store your ripped video plus some working space &#8211; 8GB all up is ideal for a single title.</li>
<li>An Ubuntu Intrepid 8.10 installation (which is what this guide is based on).</li>
<li>Some patience (unless you&#8217;ve got a multi-core monolith that can work out Pi to the sixth billionth place in less than a few nanoseconds, in which case you&#8217;re laughing).</li>
</ul>
<ol>
<li>We&#8217;ll need to install some extra software tools. Start by opening a terminal and enter the following:
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">$ sudo apt-get install mplayer mencoder normalize-audio vorbis-tools mkvtoolnix gpac x264 libdvdcss2</code></span></pre>
</li>
<li>Once all that is installed, insert the DVD you wish to rip from. Now generally most DVD&#8217;s have the main feature as title number &#8220;1&#8243;, but these days we are increasingly seeing a number of trailers or advertisements starting with this title, so to find out what title is what, type in the following:
<pre><span style="color: #000080;">$ mplayer dvd://1</span></pre>
</li>
<li>This will attempt to play the first title on the disc in a new window. You will notice in the console output that it will also list some other useful information such as how many titles are on the disc, etc. If the title being played is not the feature you&#8217;re after, simply close the playback window and change the command to use <span style="color: #000080;">dvd://2</span> or <span style="color: #000080;">dvd://3</span> etc until you find the title you want. An example of this output is:
<pre><span style="color: #000080;">$ mplayer dvd://1
</span><span style="color: #000080;">MPlayer 1.0rc2-4.3.2 (C) 2000-2007 MPlayer Team</span><span style="color: #000080;">
CPU: Intel(R) Core(TM)2 Quad  CPU   Q9450  @ 2.66GHz (Family: 6, Model: 23, Stepping: 7)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Playing dvd://1

There are 3 titles on this DVD.
There are 20 chapters in this DVD title.
There are 1 angles in this DVD title.
audio stream: 0 format: ac3 (5.1) language: en aid: 128.
audio stream: 1 format: ac3 (5.1) language: es aid: 129.
audio stream: 2 format: ac3 (stereo) language: en aid: 130.
number of audio channels on disk: 3.
subtitle ( sid ): 1 language: en
subtitle ( sid ): 3 language: en
subtitle ( sid ): 5 language: es
subtitle ( sid ): 7 language: sv
subtitle ( sid ): 9 language: no
subtitle ( sid ): 11 language: da
subtitle ( sid ): 13 language: fi
subtitle ( sid ): 14 language: es
subtitle ( sid ): 15 language: sv
subtitle ( sid ): 16 language: no
subtitle ( sid ): 17 language: da
subtitle ( sid ): 18 language: fi
subtitle ( sid ): 20 language: es
number of subtitles on disk: 13</span><span style="color: #000080;">
..etc...</span></pre>
</li>
<li>In the above example, there are three titles, 20 chapters, three audio tracks and 13 subtitles for various languages. If I wanted to see what Title 3 was about, I would pass the argument <span style="color: #000080;">dvd://3</span> to the mplayer command.<br />
.</li>
<li>Now let&#8217;s start ripping that title. First up, create yourself a working directory:<span style="color: #000080;"><br />
</span></p>
<pre><span style="color: #000080;">$ mkdir mydvdrip
</span><span style="color: #000080;">$ cd mydvdrip</span></pre>
</li>
<li>Assuming Title 1 was the correct title, type in the following:<span style="color: #000080;"><code style="margin: 0px;" dir="ltr"><br />
</code></span></p>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">$ mplayer dvd://1 -v -dumpstream -dumpfile mydvdrip.vob</code></span></pre>
<p>This tells MPlayer to dump the title data to a physical file called &#8220;mydvdrip.vob&#8221; instead of displaying it to a window. The .vob file contains both the video and audio tracks of the selected title.</li>
<li>Once that is done, you can optionally rip the DVD subtitles too using:<span style="color: #000080;"><code style="margin: 0px;" dir="ltr"><br />
</code></span></p>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">$ mencoder dvd://1 -oac copy -ovc frameno -o /dev/null -slang en -vobsubout mydvdrip</code></span></pre>
<p>&#8230;which will result in the English subtitles (the &#8220;en&#8221; in the -slang argument)  files mydvdrip.idx and mydvdrip.sub being created.</li>
<li>Now, the audio can be kept in its original AC3 surround format, but can take up a lot of extra space. If you&#8217;re not fussed about proper full surround sound, you can convert the audio to plain stereo, but to do that means we need to convert the audio into PCM format as follows (<em>if you want to preserve the original AC3 surround audio, then skip to step 11 now</em>):<span style="color: #000080;"><code style="margin: 0px;" dir="ltr"><br />
</code></span></p>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">$ mplayer mydvdrip.vob -ao pcm:file=audio1.wav -vc dummy -aid 128 -vo null</code></span></pre>
<p>The &#8220;-aid 128&#8243; part refers to the audio track to rip. In this case, it&#8217;s the first audio track. If I wanted to rip the second audio track, I would use &#8220;-aid 129&#8243; instead. See the MPlayer console output when you were playing the disc for the other aid parameters to access the other audio tracks.</li>
<li>Once the audio is ripped and converted, we need to normalise it so it&#8217;s not too loud or too soft with:<span style="color: #000080;"><code style="margin: 0px;" dir="ltr"><br />
</code></span></p>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">$ normalize-audio audio1.wav</code></span></pre>
</li>
<li>&#8230;and then finally convert it into the final audio format we want to put into the final ripped product, in this case Ogg Vorbis which is a much cleaner-sounding and open format than MP3:
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">$ oggenc -q5 audio1.wav</code></span></pre>
<p>The -q5 parameter encodes at 160 kbits/s which should be very clear and crisp compared to the original audio. Change this parameter to alter the compression if you want to save space. <strong>Skip to step 12 now.</strong></li>
<li>If you didn&#8217;t want to convert the audio to stereo, and preserve the original surround audio, you can rip the AC3 audio with:<span style="color: #000080;"><code style="margin: 0px;" dir="ltr"><br />
</code></span></p>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">$ mplayer mydvdrip.vob -aid 128 -dumpaudio -dumpfile mydvdrip.ac3</code></span></pre>
</li>
<li>We have the audio and subtitles finished, so all we need now is the video itself. As you have probably noticed, many DVD titles generally have a border of black around them to some degree. We don&#8217;t want this in our rip and can save some space by omitting it, but we need to get the cropping bounds. Thankfully MPlayer does a pretty good job of detecting this by itself. Type in:
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">$ mplayer mydvdrip.vob -vf cropdetect</code></span></pre>
</li>
<li>Allow the title to play for a bit, or skip forward a bit. You will notice some data output to the terminal. This is what MPlayer believes is the optimal cropping bounds for this title where it says -vf crop=688:448:18:64 (your output will vary). Stop playback and copy the series of numbers after the equals sign to the clipboard.<br />
.</li>
<li>Now we need to setup two-pass encoding. Two passes are made for quality reasons. The first pass makes note of details about the video, such as slow and fast moving scenes, which allow MEncoder to vary the bitrate of the resulting video accordingly, providing great image quality whilst maintaining a small file size. Encoding requires two executions of MEncoder one after the other, so let&#8217;s create a shell script to do it. Create an empty script with:
<pre><span style="color: #000080;">$ gedit encodevideo.sh</span></pre>
</li>
<li>&#8230;and an empty text editor will appear. Copy &amp; paste in the following:
<pre><span style="color: #000080;"># Encoding pass #1<code style="margin: 0px;" dir="ltr">
mencoder -v mydvdrip.vob -vf pullup,softskip,crop=</code>688:448:18:64 \
-ovc x264 -x264encopts subq=4:bframes=3:b_pyramid:weight_b:\<code style="margin: 0px;" dir="ltr">
turbo=1:pass=1:psnr:bitrate=1000:threads=auto -oac copy \</code>
-of rawvideo -o mydvdrip.264<code style="margin: 0px;" dir="ltr">

# Encoding pass #2</code>
mencoder -v mydvdrip.vob -vf pullup,softskip,crop=688:448:18:64 \
 -ovc x264 -x264encopts subq=6:partitions=all:me=umh:frameref=5:\
bframes=3:b_pyramid:weight_b:pass=2:psnr:bitrate=1000:threads=auto \
-oac copy -of rawvideo -o mydvdrip.264</span></pre>
<p><strong>(Remember to substitute the &#8220;crop=&#8221; values from your own crop output)</strong></p>
<p>I won&#8217;t go through describing what all the options above do suffice that they will produce a very high quality rip of your DVD title using a modest amount of disc space (generally no higher than about 700MB for a single DVD movie), and it will make full use of any multi-CPU or multi-core processing power at your disposal (a Quad-core system will encode video roughly 3 times faster than a single core system). If the resulting file size is still too big, you can make it smaller by changing the <span style="color: #000080;">bitrate=1000</span> parameter to something slightly smaller, eg: 900, but you will begin to sacrifice image quality.</li>
<li>Save the file and quit your text editor.<br />
.</li>
<li>We&#8217;re now about to begin ripping and encoding the video data. Depending on your system, this part could take anywhere between 60 minutes to several hours. In this example, my 3.2GHz Quad-Core Q9450 based system took 32 minutes to perform just the first encoding pass at 87fps, with the second pass taking 52 minutes to complete at 54fps. Execute the script with:
<pre><span style="color: #000080;">$ sh ./encodevideo.sh</span></pre>
</li>
<li>&#8230;and go order a pizza, or wait. The video from the .vob file will be extracted, encoded using the x264 codec and the resulting raw data placed into a file called mydvdrip.264 at the end.<br />
.</li>
<li>Once the script has finished, you should now have the following files in your working directory (except the .ac3 file if you chose not to rip it):
<pre><span style="color: #000080;">-rw-r--r-- 1 hyrax hyrax   91783421 2008-12-21 19:29 audio1.ogg
-rw-r--r-- 1 hyrax hyrax 1058132012 2008-12-21 19:26 audio1.wav
-rw-r--r-- 1 hyrax hyrax   13936736 2008-12-21 23:02 divx2pass.log
-rw-r--r-- 1 hyrax hyrax  688634256 2008-12-21 23:49 mydvdrip.264
-rw-r--r-- 1 hyrax hyrax  264532992 2008-12-21 19:31 mydvdrip.ac3
-rw-r--r-- 1 hyrax hyrax      38423 2008-12-21 19:23 mydvdrip.idx
-rw-r--r-- 1 hyrax hyrax    3426304 2008-12-21 19:23 mydvdrip.sub
-rw-r--r-- 1 hyrax hyrax 4473358336 2008-12-21 19:16 mydvdrip.vob
-rw-r--r-- 1 hyrax hyrax        482 2008-12-21 22:35 encodevideo.sh</span></pre>
<p>In the above example, my original DVD title rip was some 4.4GB in size. The resulting compressed video file using x264 is only a paltry 688MB &#8211; notably smaller and the visual quality on playback looks identical to the original DVD data. The original AC3 audio consumed 264MB, but the Ogg compressed version only consumes 91MB. Put the x264 video data and converted Ogg audio data together and we have a rip that will consume a total of 779MB all up (give or take a few MB for the container that will hold them both).</li>
<li>Now we need to recombine the audio, video and subtitles into one Matroska container file. First up, the video. We need to convert the video from raw x264 data into MP4 format before we add it to the MKV container. To do this, type in:
<pre>$ <span style="color: #000080;">MP4Box -add mydvdrip.264 mydvdrip.mp4</span></pre>
</li>
<li>Now we&#8217;re ready to build the final MKV file. Type in:
<pre><span style="color: #000080;">$ mkvmerge -o mydvdrip.mkv *.mp4 *.ogg *.idx</span></pre>
<p>(replace the *.ogg with *.ac3 is you want to use the original audio instead, or include them both so they are selectable on playback! Beware this will blow out your final file size, however)</li>
<li>When the muxing is complete, your rip is complete. You can now play it in your favourite video player such as Totem or MPlayer.</li>
</ol>
<p style="text-align: center;">&#8212; o O o &#8212;</p>
<p>To recap the whole process:</p>
<ol>
<li>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">mplayer dvd://1 -v -dumpstream -dumpfile mydvdrip.vob</code></span></pre>
</li>
<li>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">mencoder dvd://1 -oac copy -ovc frameno -o /dev/null -slang en -vobsubout mydvdrip</code></span></pre>
</li>
<li>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">mplayer mydvdrip.vob -ao pcm:file=audio1.wav -vc dummy -aid 128 -vo null</code></span></pre>
</li>
<li>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">normalize-audio audio1.wav</code></span></pre>
</li>
<li>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">oggenc -q5 audio1.wav</code></span></pre>
</li>
<li>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">mplayer mydvdrip.vob -vf cropdetect</code></span></pre>
</li>
<li>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">mencoder -v mydvdrip.vob -vf pullup,softskip,crop=</code>688:448:18:64 <code style="margin: 0px;" dir="ltr">\
 -ovc x264 -x264encopts subq=4:bframes=3:b_pyramid:weight_b:\
turbo=1:pass=1:psnr:bitrate=1000:threads=auto -oac copy \</code><code style="margin: 0px;" dir="ltr">
-of rawvideo -o mydvdrip.264</code></span></pre>
</li>
<li>
<pre><span style="color: #000080;">mencoder -v mydvdrip.vob -vf pullup,softskip,crop=688:448:18:64 \
 -ovc x264 -x264encopts subq=6:partitions=all:me=umh:frameref=5:\
bframes=3:b_pyramid:weight_b:pass=2:psnr:bitrate=1000:threads=auto \
-oac copy -of rawvideo -o mydvdrip.264</span></pre>
</li>
<li>
<pre><span style="color: #000080;">MP4Box -add mydvdrip.264 mydvdrip.mp4</span></pre>
</li>
<li>
<pre><span style="color: #000080;">mkvmerge -o mydvdrip.mkv *.mp4 *.ogg *.idx</span></pre>
</li>
</ol>
<p>Or, to preserve the original AC3 surround audio track without conversion, replace steps 3 to 5 with:</p>
<pre><span style="color: #000080;"><code style="margin: 0px;" dir="ltr">mplayer mydvdrip.vob -aid 128 -dumpaudio -dumpfile mydvdrip.ac3</code></span></pre>
<p>&#8230;and replace step 10 with:</p>
<pre><span style="color: #000080;">mkvmerge -v -o mydvdrip.mkv *.mp4 *.ac3 *.idx</span></pre>
<p><span style="color: #000080;"><span style="color: #000000;">That&#8217;s it. Happy ripping!</span></span></p>
<div class='wp_likes' id='wp_likes_post-249'><a class='like' href="javascript:wp_likes.like(249);" title='' ><img src="http://www.serenux.com/wp-content/plugins/wp-likes/images/like.gif" alt='' border='0'/>Like</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(249);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2008/12/howto-rip-a-dvd-video-title-into-an-x264-and-ogg-encoded-mkv-video-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
