{"id":111,"date":"2009-01-24T12:13:00","date_gmt":"2009-01-24T02:13:00","guid":{"rendered":"https:\/\/www.serenux.com\/?p=111"},"modified":"2021-01-14T13:34:35","modified_gmt":"2021-01-14T03:34:35","slug":"howto-rip-a-blu-ray-movie-using-an-lg-ggc-h20l-blu-ray-drive-with-ubuntu","status":"publish","type":"post","link":"https:\/\/www.serenux.com\/index.php\/2009\/01\/24\/howto-rip-a-blu-ray-movie-using-an-lg-ggc-h20l-blu-ray-drive-with-ubuntu\/","title":{"rendered":"HowTo: Rip a Blu-ray movie using an LG GGC-H20L Blu-ray drive with Ubuntu"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Blu-ray disc format has brought with it the ability to easily provide the next generation of High-Definition 1080p movie content. There\u2019s just one problem \u2013 Ubuntu and Linux in general has no official support for Blu-ray, and its encryption scheme is vastly different to that of DVD \u2013 it\u2019s not just a simple case of installing a library like the libdvdcss2 library for decrypting DVD\u2019s \u2013 the protection is done both at a software and hardware level.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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>\n\n\n\n<p class=\"wp-block-paragraph\"><em>DISCLAIMER: This article describes decrypting BD titles using an Intel or AMD based PC with Ubuntu Linux. While you can use a PlayStation3\u2019s BD drive to read and decrypt a title using&nbsp;<strong>known<\/strong>&nbsp;decryption keys using the PS3 version of Ubuntu, at this time of writing you&nbsp;<strong>cannot<\/strong>&nbsp;use Ubuntu installed on a PlayStation3 console to identify&nbsp;<strong>unknown<\/strong>&nbsp;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.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hang on, you say \u2013 if there is no support for playback of Blu-ray movies on Linux, then why buy a Blu-ray drive if you can\u2019t 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\u2019s no official Blu-ray support, and you can\u2019t watch the discs directly, then how on earth do you rip them?? I\u2019m glad you asked, and even if you didn\u2019t ask, I\u2019m about to tell you anyway.&nbsp;<img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160306135851im_\/http:\/\/www.serenux.com\/wp-content\/themes\/grey-opaque\/images\/smilies\/icon_smile.gif\" alt=\"Smilie: :)\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First up, a little Blu-ray 101.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Blu-ray movies feature Digital Rights Management (DRM). Like DVD\u2019s 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\u2019s, however, there was only one decryption key which was eventually discovered and from then on allowed all DVD\u2019s 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\u2019s, but I\u2019ll 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\u2019t a repeat of the De-CSS scandal that brought the DVD encryption scheme undone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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&nbsp; 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\u2019s decryption key and movie playback can commence.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Blacklist?? What blacklist? Well, like DVD players, it\u2019s not difficult to pick up a Blu-ray player\u2019s authentication key that is used to prompt the drive for the disc\u2019s 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>\n\n\n\n<p class=\"wp-block-paragraph\">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 \u2013 its blacklist will get updated with the next latest-release movie you buy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Say what?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every Blu-ray movie you buy has a little file on the disc under the \u201cAACS\u201d folder called \u201cContentRevocation.lst\u201d. This file contains a complete list of blacklisted authentication keys for the drive to update itself with, and \u2013 get this \u2013 you can\u2019t 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>\n\n\n\n<p class=\"wp-block-paragraph\">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\u2019ll see an error message instead saying that your player\u2019s authentication key has been revoked \u2013 thus the movie is now unplayable. What\u2019s worse is that you won\u2019t be able to watch any of your older discs that worked previously either! It\u2019s this exact reason that many people have called for the Blu-ray (and HD-DVD) formats to be&nbsp;<a href=\"https:\/\/web.archive.org\/web\/20160306135851\/http:\/\/bluraysucks.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">boycotted<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.&nbsp;<img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160306135851im_\/http:\/\/www.serenux.com\/wp-content\/themes\/grey-opaque\/plugins\/lazy-load\/images\/1x1.trans.gif\" alt=\"Smilie: :)\">&nbsp;With a little help from a few external resources including the&nbsp;<a href=\"https:\/\/web.archive.org\/web\/20160306135851\/https:\/\/help.ubuntu.com\/community\/RestrictedFormats\/BluRayAndHDDVD\" target=\"_blank\" rel=\"noreferrer noopener\">Ubuntu Community Documentation<\/a>&nbsp;and the&nbsp;<a href=\"https:\/\/web.archive.org\/web\/20160306135851\/http:\/\/forum.doom9.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Doom9 forums<\/a>, I discovered a plethora of projects by various people, from dumping discs to breaking the encryption and authentication.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the surface are general applications to dump the movie, decrypted, to a file. One of the best projects is&nbsp;<a href=\"https:\/\/web.archive.org\/web\/20160306135851\/http:\/\/forum.doom9.org\/showthread.php?t=123111\" target=\"_blank\" rel=\"noreferrer noopener\">DumpHD<\/a>&nbsp;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 \u201cBatman Begins\u201d in Australia might have a completely different decryption key to the release of \u201cBatman Begins\u201d in America or Europe. This is not always the case of course, a good example being the Ewan McGregor movie \u201cThe Island\u201d \u2013 the Australian release is actually the UK release, right down to the age-rating and film-office classification markings on the disc itself \u2013 only the box bears any Australian ratings markings!<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122500if_\/http:\/\/www.serenux.com\/~hyrax\/snaps\/BlurayMovieInserting.jpg\" alt=\"\"\/><figcaption>The UK\/AU release of &#8220;The Island&#8221; on Blu-Ray<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">So, how do you find out the decryption key of your locally purchased movie then? You don\u2019t want to keep buying a commercial player, especially one that doesn\u2019t run under Ubuntu, just to get a valid authentication key. There\u2019s 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>\n\n\n\n<p class=\"wp-block-paragraph\">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&nbsp;<a href=\"https:\/\/web.archive.org\/web\/20160306135851\/http:\/\/forum.doom9.org\/showthread.php?t=139522\" target=\"_blank\" rel=\"noreferrer noopener\">modified firmware<\/a>&nbsp;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>\n\n\n\n<p class=\"wp-block-paragraph\">EDIT 10th Jan 2012: It appears the firmware is no longer available from the Doom9 forums as it has not been updated in quite some time.&nbsp;<a href=\"https:\/\/web.archive.org\/web\/20160306135851\/http:\/\/www.serenux.com\/~hyrax\/lg_ggc-h20l\/GGC-H20L_1.03_VolumeID_Patch.exe\">Here is a mirror of the v1.03 modified firmware<\/a>&nbsp;to suit the LG GGC-H20L only.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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>\n\n\n\n<p class=\"wp-block-paragraph\"><em><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><\/em><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>You need a normal Wine installation. If you\u2019ve never installed it before, then type in:<br><br><code>$ sudo apt-get install wine<\/code><br><br>\u2026and this will install the Ubuntu-repository version of Wine.<br><\/li><li>Since we\u2019ll 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:<br><br><code>$ sudo chown -R root:root ~\/.wine<\/code><br><\/li><li>Now execute the downloaded firmware file:<br><br><code>$ sudo wine GGC-H20L_1.03_VolumeID_Patch.exe<\/code><br><\/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 \u201cjbloggs\u201d, then you\u2019d type in:<br><br><code>$ sudo chown -R jbloggs:jbloggs ~\/.wine<\/code><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Upon returning from restart, every time you query the drive for the inserted disc\u2019s decryption key, the drive will now happily give it to you without question. <em>Nice.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So how do we query the drive for that decryption key anyway? A simple tool to do this is&nbsp;<a href=\"https:\/\/web.archive.org\/web\/20160306135851\/http:\/\/forum.doom9.org\/showthread.php?p=1320065#post1320065\" target=\"_blank\" rel=\"noreferrer noopener\">aacskeys<\/a>&nbsp;(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\u2019s keys config file and happily begin dumping your movie.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ .\/aacskeys \/media\/cdrom aacskeys 0.3.6 by arnezami, KenD00 Volume Unique Key:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5D9BCD44522B6940F8705400DA612ED9 Unit Key File Hash (Disc ID):&nbsp;&nbsp; 837487B4D6F614D5B4D5F566387B41C2D284F393 $ <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If your drive\u2019s firmware was not patched, instead of seeing the Volume Unique Key and Disc ID, you would get this error message instead: \u201cThe given Host Certficate \/ Private Key has been revoked by your drive.\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We now need to take the output data and copy it to DumpHD\u2019s \u201ckeydb.cfg\u201d file. Each key is placed on its own line in the following format:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">DISC ID = Movie Title | D | YYYY-MM-DD | V | VOLUME UNIQUE KEY<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Thus in the example above, we would enter:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">837487B4D6F614D5B4D5F566387B41C2D284F393 = The Island | D | 2007-03-22 | V | 5D9BCD44522B6940F8705400DA612ED9 <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">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 \u201cUnit_Key_RO.inf\u201d file in the \u201cAACS\u201d folder of the disc). I have tested this and I can\u2019t see any difference in how DumpHD handles the disc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have finished editing the keydb.cfg file, save it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><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&nbsp;<a href=\"https:\/\/web.archive.org\/web\/20160306135851\/http:\/\/www.serenux.com\/2009\/09\/howto-deal-with-bd-copy-protection-when-ripping-blu-ray-titles-using-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">this article<\/a>&nbsp;for more information.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since DumpHD is a Java application, you will need Java installed to run it. If you haven\u2019t already got it installed, you can install it with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install java-common<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u2026or more realistically you should install it as part of the ubuntu-restricted-extras package which also installs a number of other useful packages:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install ubuntu-restricted-extras<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once that is done, launch DumpHD by simply running the \u201cdumphd.sh\u201d script by either double-clicking on it and select \u201cRun\u201d when prompted, or in a terminal, change to where you extracted the DumpHD program and type in:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sh .\/dumphd.sh<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When loaded, you will be presented with the following interface:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122520if_\/http:\/\/www.serenux.com\/~hyrax\/snaps\/DumpHDFrontend.jpg\" alt=\"\"\/><figcaption>The DumpHD user interface<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">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 \u201c\/media\/cdrom\u201d and then click OK. After a few seconds, the disc should be identified and you will see the window change as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20160315122524if_\/http:\/\/www.serenux.com\/~hyrax\/snaps\/LoadedMovieReadyToRip.jpg\" alt=\"\"\/><figcaption>Identifying the BD-ROM content<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">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\u2019s the \u201c00000.m2ts\u201d file. I can play it simply with:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ mplayer -fs 00000.m2ts<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">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>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that Blu-ray movies are very large. In my example, \u201cThe Island\u201d is a good 21GB! It\u2019s 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\u2019ll 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 \u2013 they really don\u2019t eat up that much space \u2013 a few hundred megabytes only.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happy ripping!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>Woah! After I\u2019ve ripped the movie, it plays but it\u2019s all corrupted! What\u2019s going on?<\/strong><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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&nbsp;<a href=\"https:\/\/web.archive.org\/web\/20160306135851\/http:\/\/www.serenux.com\/2009\/09\/howto-deal-with-bd-copy-protection-when-ripping-blu-ray-titles-using-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<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\u2019s just one problem \u2013 Ubuntu and Linux in general has no official support for Blu-ray, and its encryption scheme is vastly different to that of DVD \u2013 it\u2019s not just a simple case [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":1,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":112,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/111\/revisions\/112"}],"wp:attachment":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}