<?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; Video</title>
	<atom:link href="http://www.serenux.com/tag/video/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.serenux.com</link>
	<description>Life, the Universe and Ubuntu.</description>
	<lastBuildDate>Mon, 21 Jun 2010 10:45:51 +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>
<div class='wp_likes' id='wp_likes_post-738'><a class='like' href="javascript:wp_likes.like(738);" 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(738);">Unlike</a></div>
</div>
]]></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: Deal with BD+ copy protection when ripping Blu-ray titles using Ubuntu</title>
		<link>http://www.serenux.com/2009/09/howto-deal-with-bd-copy-protection-when-ripping-blu-ray-titles-using-ubuntu/</link>
		<comments>http://www.serenux.com/2009/09/howto-deal-with-bd-copy-protection-when-ripping-blu-ray-titles-using-ubuntu/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 23:18:25 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Blu-ray]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[High-Definition]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Jaunty]]></category>
		<category><![CDATA[LG]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=568</guid>
		<description><![CDATA[A fair while back now, I wrote an article detailing how to decode Blu-ray titles using Ubuntu and an LG GGC-H20L Blu-ray optical drive. This article detailed how to decrypt just about every movie under the sun except for a newer type of protection called &#8220;BD+&#8221; which I never got around to supplementing my original [...]]]></description>
			<content:encoded><![CDATA[<p>A fair while back now, I wrote an article detailing <a title="HowTo: Rip a Blu-ray movie using an LG GGC-H20L Blu-ray drive with Ubuntu" href="http://www.serenux.com/2009/01/howto-rip-a-blu-ray-movie-using-an-lg-ggc-h20l-blu-ray-drive-with-ubuntu/" target="_blank">how to decode Blu-ray titles using Ubuntu and an LG GGC-H20L Blu-ray optical drive</a>.</p>
<p>This article detailed how to decrypt just about every movie under the sun except for a newer type of protection called &#8220;BD+&#8221; which I never got around to supplementing my original article with.</p>
<p>What is &#8220;BD+&#8221; protection? Well in short, it&#8217;s the deliberate corruption of random parts of the video track of the movie (well, OK &#8211; that is a highly simplified definition as BD+ protection can do a lot more than that, but the end result is the same &#8211; to prevent unauthorised playback which includes ripping). The idea BD+ is that when you rip the title, you can still watch the movie, but with some or all of the screen corrupt at various stages in the movie which well and truely ruins the movie-watching experience, especially since you paid good money for it and should not be forced to buy a dedicated consumer Blu-ray player when you&#8217;ve got a perfectly good PC that can do the same task.</p>
<p>But hang on, if the movie is deliberately corrupt, then how come it plays fine in a stand-alone consumer Blu-ray player or PlayStation3 console?</p>
<p>Well, let me tell you about that and how to get around it yourself.</p>
<p><span id="more-568"></span>I have to give credit to the movie studios for this one. It&#8217;s a simple, and annoying, method of protection. But as with anything, it was eventually reverse-engineered and broken, and neat little tools were developed to allow us consumer types to backup, or watch in our preferred way, our movies bought with our hard-earned cash.</p>
<p>So what&#8217;s this BD+ thing all about? Basically after the movie is mastered and just before being pressed to discs, an extra step is taken where by random parts of the movie data stream are deliberately exchanged with random data or removed altogether, thus corrupting the video stream. A record is kept, however, of what parts of the movie have been changed &#8211; a table listing where, when and what data needs to be put back into the movie stream in order to watch the movie back in its original uncorrupted format. This table is called a &#8220;conversion table&#8221;, and it is processed by your Blu-ray player while you watch the movie, with the correct data substituted back into the video stream before the image hits your screen, thus resulting in a proper uncorrupted picture.</p>
<p style="text-align: center;">
<div id="attachment_575" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.serenux.com/wp-content/uploads/2009/09/BDCorruptStream.jpg"><img class="size-medium wp-image-575" title="BD Corrupt Stream" src="http://www.serenux.com/wp-content/uploads/2009/09/BDCorruptStream-300x168.jpg" alt="An example of a corrupted video stream. Click for full size." width="300" height="168" /></a><p class="wp-caption-text">An example of a corrupted video stream showing the BD+ Protection in full effect. Click for full size.</p></div>
<div id="attachment_576" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.serenux.com/wp-content/uploads/2009/09/BDNotCorruptStream.jpg"><img class="size-medium wp-image-576" title="BD Not Corrupt Stream" src="http://www.serenux.com/wp-content/uploads/2009/09/BDNotCorruptStream-300x168.jpg" alt="An example of the repaired video stream. Click for full size." width="300" height="168" /></a><p class="wp-caption-text">An example of the repaired video stream using the Conversion Table. Click for full size.</p></div>
<p>So how do we get around BD+? Well, all we have to do is follow this conversion table ourselves and correct the corrupted data as the title is decrypted.</p>
<p>As I showed in my previous article, the DumpHD application is brilliant and it has been extended by the author KenD00 to allow the &#8220;plugging in&#8221; of another program called the &#8220;BD VM Debugger&#8221;. What this program does is simple &#8211; it executes the Java Virtual Machine that runs the conversion table in concert with the normal decrypting process which happens when the disc is played in your normal BD player, patching up the stream as it goes. The end result is a clean decryption with no corrupt video stream.</p>
<p>This tutorial was written using Ubuntu Jaunty but should work with Intrepid and should definitely work with Karmic and beyond as well.</p>
<p><em>DISCLAIMER: This article describes decrypting BD titles using an Intel or AMD based PC with Ubuntu Linux. At this time of writing you <strong>cannot</strong> use Ubuntu installed on a PlayStation3 console to deal with BD+ copy protection because the BD VM Debugger and AACS Keys applications are not available for the PPC processor used by the PS3.</em></p>
<p>So let&#8217;s set this up, but first &#8211; since my last article, <a title="The DumpHD homepage on the Doom9 forums" href="http://forum.doom9.org/showthread.php?t=123111" target="_blank">DumpHD</a> has been updated to 0.61 so let&#8217;s upgrade this first. <a title="Download the DumpHD app" href="http://rapidshare.com/files/240557737/dumphd-0.61.tar.gz" target="_blank">Go and download yourself a copy</a>.</p>
<ol>
<li>Extract the archive out by either double-clicking on it or via the terminal. You should get a &#8220;dumphd-0.61&#8243; directory.<br />
.</li>
<li>If you are upgrading from an older version of DumpHD, copy over the &#8220;KEYDB.cfg&#8221; file, overwriting the archive copy. No point losing your collection of keys accumulated thus far. <img src='http://www.serenux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
.</li>
<li>You&#8217;re done for this bit.</li>
</ol>
<p>The AACSKeys program (which extracts the decryption key for the Blu-ray title and can automatically update your &#8220;KEYDB.cfg&#8221; file for you when you insert a new Blu-ray title) has also been updated to 0.4.0c since my last article, so <a title="Download the AACSKeys app" href="http://rapidshare.com/files/273476005/aacskeys-0.4.0c.tar.gz" target="_blank">go download yourself a copy of that as well</a>.</p>
<ol>
<li>Extract the archive out by either double-clicking on it or via a terminal. You should get a &#8220;aacskeys-0.4.0c&#8221;.<br />
.</li>
<li>Copy the &#8220;ProcessingDeviceKeysSimple.txt&#8221; and &#8220;HostKeyCertificate.txt&#8221; into the &#8220;dumphd-0.61&#8243; directory.<br />
.</li>
<li>Copy over the &#8220;libaacskeys.so&#8221; file located in the &#8220;/lib/linux32/&#8221; OR &#8220;/lib/linux64/&#8221; directories (depending on which architecture you&#8217;re using) to the &#8220;dumphd-0.61&#8243; directory. Do NOT copy or create the &#8220;/lib/linux32&#8243; or &#8220;/lib/linux64&#8243; directories themselves. Copy the library file only.<br />
.</li>
<li>You&#8217;re done for this bit.</li>
</ol>
<p>Right, let&#8217;s get the BD VM Debugger installed. As of this writing, the current version is 0.1.5. <a title="Download the BD VM Debugger" href="http://uploaded.to/?id=xcco6l" target="_blank">Go and download yourself a copy</a>.</p>
<ol>
<li>This archive is provided as a 7zip file. Ubuntu does not have out-of-the-box support for this archive format, so install it first with:
<pre><span style="color: #000080;">$ sudo apt-get install p7zip-full</span></pre>
<p>.</li>
<li>Once installed, extract the archive either by double-clicking on it like any normal archive, or via the terminal as follows:
<pre><span style="color: #000080;">$ 7z e bdvmdbg-0.1.5.7z</span></pre>
<p>.</li>
<li>Copy over the everything into the &#8220;dumphd-0.61&#8243; directory except the &#8220;changelog.txt&#8221;, &#8220;readme.txt&#8221; and &#8220;debugger.sh&#8221; files since you don&#8217;t really need them, but there&#8217;s no harm copying them anyway.<br />
.</li>
<li>That&#8217;s it!</li>
</ol>
<p>You should now have a total of at least of 17 files and two directories inside the &#8220;dumphd-0.61&#8243; directory (if you are setting up these tools for the first time, you will only have 15 files instead, as two of them  &#8211; <em>conv_tab.bin</em> &amp; <em>hash_db.bin</em> &#8211; are generated by DumpHD in conjunction with the BD VM Debugger).</p>
<p style="text-align: center;">
<div id="attachment_579" class="wp-caption aligncenter" style="width: 404px"><a href="http://www.serenux.com/wp-content/uploads/2009/09/DumpHD061Folder.jpg"><img class="size-full wp-image-579" title="DumpHD-0.61 Folder" src="http://www.serenux.com/wp-content/uploads/2009/09/DumpHD061Folder.jpg" alt="The prepared DumpHD folder with the tools we need. Click for full size." width="394" height="359" /></a><p class="wp-caption-text">The prepared DumpHD folder with the tools we need. Click for full size.</p></div>
<p>Now let&#8217;s try decrypting a BD+ protected Blu-ray title. In this example, I will use the Australian release of &#8220;Day Watch&#8221;, the sequel to the Russian epic &#8220;Night Watch&#8221;.</p>
<p style="text-align: center;">
<div id="attachment_574" class="wp-caption aligncenter" style="width: 378px"><a href="http://www.serenux.com/wp-content/uploads/2009/09/DayWatchBox.jpg"><img class="size-large wp-image-574" title="Day Watch Blu-ray Title" src="http://www.serenux.com/wp-content/uploads/2009/09/DayWatchBox-1024x768.jpg" alt="The BD+ Protected &quot;Day Watch&quot; Blu-ray title I am ripping. Click for full size." width="368" height="277" /></a><p class="wp-caption-text">The BD+ Protected &quot;Day Watch&quot; Blu-ray title I am ripping. Click for full size.</p></div>
<p><em>NOTE: Your ability to decrypt a given Blu-ray title, BD+ protected or not, will ultimately depend on the MKB version of the disc. As of this writing, DumpHD can only decrypt up to MKB version 10. Newer discs using version 11 or later can only be decrypted once suitable decryption keys are uncovered and added to the &#8220;ProcessingDeviceKeysSimple.txt&#8221; file in the &#8220;dumphd-0.61&#8243; directory.</em></p>
<p><em>The obtaining of the decryption key of the Blu-ray title also requires the player authentication mechanism of your Blu-ray drive to be bypassed, or through use of a drive that deliberately does not have this feature such as some imported drives from China. In the case of my LG GGC-H20L drive, I used a <a title="My first review of ripping a Blu-ray title with this drive contains information about applying modified firmware." href="http://www.serenux.com/2009/01/howto-rip-a-blu-ray-movie-using-an-lg-ggc-h20l-blu-ray-drive-with-ubuntu/" target="_blank">modified firmware</a> so that the drive always gave up the disc&#8217;s decryption key regardless of what player certificate I used &#8211; blacklisted or not.</em></p>
<ol>
<li>Start the DumpHD program by double-clicking on the &#8220;dumphd.sh&#8221; icon. You will be asked if you want to run the script file. Click on the &#8220;Run&#8221; button.<br />
.</p>
<div id="attachment_583" class="wp-caption aligncenter" style="width: 312px"><a href="http://www.serenux.com/wp-content/uploads/2009/09/StartingDumpHD.jpg"><img class="size-full wp-image-583" title="Starting DumpHD" src="http://www.serenux.com/wp-content/uploads/2009/09/StartingDumpHD.jpg" alt="Starting DumpHD" width="302" height="110" /></a><p class="wp-caption-text">Starting the DumpHD application. Click for full size.</p></div></li>
<li>When the DumpHD GUI appears, make a note of the messages in the bottom pane to ensure that AACSKeys and the BD VM Debugger was found and loaded OK. You should see the following information:
<pre><span style="color: #000080;">DumpHD 0.61 by KenD00

Opening Key Data File... OK
Initializing AACS... OK
Loading aacskeys library... OK
aacskeys library 0.4.0 by arnezami, KenD00
Loading BDVM... OK
BDVM 0.1.5</span></pre>
<p><div id="attachment_582" class="wp-caption aligncenter" style="width: 490px"><a href="http://www.serenux.com/wp-content/uploads/2009/09/DumpHDStarted.jpg"><img class="size-full wp-image-582" title="DumpHD Started" src="http://www.serenux.com/wp-content/uploads/2009/09/DumpHDStarted.jpg" alt="DumpHD Started" width="480" height="360" /></a><p class="wp-caption-text">The DumpHD Interface. Click for full size.</p></div>
<p style="text-align: center;">.</p>
</li>
<li>Insert the Blu-ray title into your Blu-ray drive.<br />
.</li>
<li>Next to the &#8220;Source&#8221; section at the top-right of the DumpHD window is a &#8220;Browse&#8221; button. Click on it.<br />
.</li>
<li>Navigate to the path of your Blu-ray drive (generally &#8220;/media/cdrom&#8221; will work fine). and hit the OK button.
<div id="attachment_580" class="wp-caption aligncenter" style="width: 272px"><a href="http://www.serenux.com/wp-content/uploads/2009/09/DumpHDBrowseSource.jpg"><img class="size-full wp-image-580" title="DumpHD Browse Source" src="http://www.serenux.com/wp-content/uploads/2009/09/DumpHDBrowseSource.jpg" alt="DumpHD Browse Source" width="262" height="271" /></a><p class="wp-caption-text">Choosing a source to rip from. Click for full size.</p></div></li>
<li>DumpHD will read the disc and will pass it through AACSKeys to identify the title&#8217;s descryption key. If it is successful, it will output some data about the disc in the lower pane. In the case of my <em>Day Watch</em> title, it shows the following:
<pre><span style="color: #000080;">Initializing source...
Disc type found: Blu-Ray BDMV
Collecting input files...
Source initialized
Identifying disc... OK
DiscID : 73886D08811073F45AD8C75012689097E17EBD3C
Searching disc in key database...
Disc found in key database</span></pre>
<p><div id="attachment_581" class="wp-caption aligncenter" style="width: 490px"><a href="http://www.serenux.com/wp-content/uploads/2009/09/DumpHDDiscIdentified.jpg"><img class="size-full wp-image-581" title="DumpHD Disc Identified" src="http://www.serenux.com/wp-content/uploads/2009/09/DumpHDDiscIdentified.jpg" alt="DumpHD Disc Identified" width="480" height="360" /></a><p class="wp-caption-text">Identifying the disc and getting the decryption keys to rip with. Click for full size.</p></div>
<p style="text-align: center;">.</p>
</li>
<li>This is good. We can decrypt this. If the title is not one you have ripped before, you have the option to click on the &#8220;Title&#8221; button at the top-left of the DumpHD window to give the movie a name in your Key Database.<br />
.</li>
<li>In the &#8220;Destination&#8221; section on the right, click on the &#8220;Browse&#8221; button.<br />
.</li>
<li>Choose a place to dump the decrypted disc to. Note that most titles will dump at least 20GB worth of data and in some cases 50GB. Ensure that you have enough hard-drive space in the location you choose to dump to.<br />
.</li>
<li>We&#8217;re ready to rock and/or roll. Click on the &#8220;Dump&#8221; button and decryption will begin, automatically executing the BD VM and applying the Conversion Table to correct the deliberate corruption in the video stream. Here&#8217;s a small extract of what you will see in the lower pane of the DumpHD window:
<pre><span style="color: #000080;">AACS data processed
Initializing the BDVM... OK
Executing the BDVM... OK
Parsing the Conversion Table... OK
Processing: BDMV/BACKUP/CLIPINF/00000.clpi
Processing: BDMV/BACKUP/CLIPINF/00001.clpi
Processing: BDMV/BACKUP/CLIPINF/00002.clpi
etc...</span></pre>
<div id="attachment_578" class="wp-caption aligncenter" style="width: 490px"><a href="http://www.serenux.com/wp-content/uploads/2009/09/BDRipStart.jpg"><img class="size-full wp-image-578" title="BD Rip Start" src="http://www.serenux.com/wp-content/uploads/2009/09/BDRipStart.jpg" alt="BD Rip Start" width="480" height="341" /></a><p class="wp-caption-text">Beginning the ripping process. Click for full size.</p></div>
<p style="text-align: center;">.</p>
</li>
<li>And after awhile it will finish with something like:
<pre><span style="color: #000080;">Processing: BDMV/STREAM/00211.m2ts
Searching CPS Unit Key... #1
0x0000000000 Decryption enabled
Processing: BDMV/STREAM/00212.m2ts
Searching CPS Unit Key... #1
0x0000000000 Decryption enabled
Processing: BDMV/index.bdmv
Disc set processed</span></pre>
<div id="attachment_577" class="wp-caption aligncenter" style="width: 490px"><a href="http://www.serenux.com/wp-content/uploads/2009/09/BDRipDone.jpg"><img class="size-full wp-image-577" title="BD Rip Done" src="http://www.serenux.com/wp-content/uploads/2009/09/BDRipDone.jpg" alt="BD Rip Done" width="480" height="341" /></a><p class="wp-caption-text">Finished decrypting the Blu-ray title. Click for full size.</p></div>
<p style="text-align: center;">.</p>
</li>
<li>That&#8217;s it! You&#8217;ve successfully decrypted the disc and fixed up the corrupted video track. Identify and playback the actual movie M2TS file using a player like MPlayer or VLC, and you should now find that it contains no corruption whatsoever. In the case of <em>Day Watch</em>, the movie file was under <em>BDMV/STREAM/00012.m2ts</em> identifiable simply because it was the largest file in the directory. Using MPlayer, you can play this file with:
<pre><span style="color: #000080;">$ mplayer -fs BDMV/STREAM/00012.mt2s</span></pre>
<p>Thankfully this title does not have the movie broken up into multiple files (I&#8217;ll be writing another article soon showing you how to deal with multi-part movies).</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/09/howto-deal-with-bd-copy-protection-when-ripping-blu-ray-titles-using-ubuntu/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>HowTo: Build a MythTV box from scratch using Ubuntu Jaunty 9.04</title>
		<link>http://www.serenux.com/2009/06/howto-build-a-mythtv-box-from-scratch-using-ubuntu-jaunty-904/</link>
		<comments>http://www.serenux.com/2009/06/howto-build-a-mythtv-box-from-scratch-using-ubuntu-jaunty-904/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 15:26:01 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[High-Definition]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Jaunty]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=492</guid>
		<description><![CDATA[MythTV is a project that brings analogue and digital television to your Ubuntu-powered PC. It primarily functions as your television and personal video recorder (PVR), but can be made to do many other things (refer to the official MythTV site for more information), however one thing that can catch people is actually building a MythTV [...]]]></description>
			<content:encoded><![CDATA[<p>MythTV is a project that brings analogue and digital television to your Ubuntu-powered PC. It primarily functions as your television and personal video recorder (PVR), but can be made to do many other things (refer to the official MythTV site for more information), however one thing that can catch people is actually building a MythTV box from scratch. Over the years, MythTV has been one of the largest causes of baldness in users who have torn out their hair in frustration.</p>
<p>Nowadays, tailored distributions such as Mythbuntu make the task pretty much trivial, but not everyone likes to use the tailor-made distributions. For one, Mythbuntu has a lot of its own branding across it which I personally don&#8217;t really like, and I&#8217;d prefer not to have it install all of that plus XFCE as the default desktop and then have to undo it all just to get back to a regular Ubuntu desktop.</p>
<p>Since I recently built a MythTV server for my folks, and on top of that connected it to their aging CRT television rather than the latest in visual technology, this makes for a perfect tutorial on how to take a vanilla Ubuntu Jaunty 9.04 installation and turn it into a simple, functional MythTV server without all the branding. We are going to just install only the components required to get MythTV up and running. Anything else you add is purely up to you.</p>
<p><span id="more-492"></span><em><strong>Note: This tutorial covers installation of MythTV 0.21 as supplied with Ubuntu Jauty 9.04. It does not apply to the forthcoming 0.22 release which will sport a vastly different interface. It is not known yet whether Ubuntu Karmic 9.10 will still have 0.21 supplied or if 0.22 will be ready for release by then.</strong></em></p>
<p>The system I built for my folks comprised of the following hardware:</p>
<ul>
<li>Silverstone LC17 case (just to match the lounge gear, but you can use pretty much any case)</li>
<li>Gigabyte 500w PSU</li>
<li>2GB of Kingston DDR2/800 RAM (should have bought two sticks instead of a single stick, so I could run it in dual-channel mode &#8211; ah well, it&#8217;s not really a performance killer for MythTV)</li>
<li>A Gigabyte S-Series EG41M-S2H motherboard (which has built-in optical out and HDMI based on an Intel gfx chipset)</li>
<li>An MSI NX8400GS (NVidia GeForce 8400GS) PCI-E graphics card (because it&#8217;s passively cooled for no noise and has Composite/S-Video output as well as VGA and DVI)</li>
<li>An Intel E5300 Pentium Dual-Core CPU</li>
<li>A Seagate 1TB hard-drive</li>
<li>LG SATA DVD-RW optical drive (for playing DVD movie discs)</li>
<li>Two Asus MyCinema-U3100-Mini DVB-T digital-only TV tuners</li>
<li>Digitech &#8220;generic&#8221; Windows Media Centre Compatible remote control and USB infra-red receiver (cheaper than the real thing and doesn&#8217;t have any Windows or Microsoft branding on it)</li>
</ul>
<p>I won&#8217;t detail the hardware build process since it&#8217;s an ordinary PC at the end of the day, but here is how it looks in my folks&#8217; AV cabinet (it&#8217;s on the bottom shelf):</p>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/pics/MythTV/FinishedMythTVServer.jpg" target="_blank"><img title="Finished MythTV combined Backend &amp; Frontend server" src="http://www.serenux.com/~hyrax/pics/MythTV/FinishedMythTVServer_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (126K)</p>
<p>I performed a vanilla Ubuntu Jaunty 9.04 with the following partition layout:</p>
<ul>
<li>100MB for /boot formatted as EXT2</li>
<li>1GB for swap formatted as SWAP</li>
<li>8GB for / (root) formatted as EXT4</li>
<li>Remainder of drive for /home formatted as EXT4</li>
</ul>
<p>Since I also installed a UPS, I do not foresee any issues with the EXT4 file system and power-loss-related data corruption. I used EXT2 for /boot because, frankly, it doesn&#8217;t need journalling there. You&#8217;ll only ever write to that partition when you do a kernal update and having as a separate partition will make any future system recovery easier.</p>
<p>My folks are still using an old standard-definition widescreen CRT television. It comes equipped with SCART inputs which can accept Composite, S-Video and Amiga-style RGB signals, but not Component ability. I elected to connect the PC using S-Video, and it looks pretty sharp for what it is &#8211; certainly far more readable than Composite.</p>
<p>I came across a strange issue when I started the Ubuntu installation process &#8211; it couldn&#8217;t start X. Basically put, it cannot detect the &#8220;monitor&#8221; and thus cannot setup a suitable screenmode. I decided to do the initial installation via a traditional VGA monitor and once the NVidia drivers were installed, I&#8217;d switch back to the TV only.</p>
<p>I configured the primary login account, password and machine name to all be &#8220;htpc&#8221; and set it to auto-login. Once installation was complete and rebooted for the first time, I quickly installed the NVidia Binary driver and updated the system with any outstanding general system updates.</p>
<p><span style="color: #0000ff;"><em><span style="text-decoration: underline;"><strong>Setting up the TV</strong></span></em></span></p>
<p>Once rebooted for the second time, I physically disconnected the VGA monitor and left only the TV connected. Ubuntu appeared quite cheerfully, though annoyingly it had switched to NTSC 60Hz mode, and I wanted PAL in 50Hz.</p>
<p>I opened up the xorg.conf configuration file into GEdit as follows:</p>
<pre><span style="color: #000080;">$ sudo gedit /etc/X11/xorg.conf</span></pre>
<p>&#8230;and located the &#8220;Screen&#8221; section which describes what the X screen to be used is. It looks something like this:</p>
<pre><span style="color: #000080;">Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "TwinViewXineramaInfoOrder" "TV-0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection</span></pre>
<p>I added the following two lines into that section:</p>
<pre><span style="color: #000080;">    Option         "TVOutFormat" "SVIDEO"
</span><span style="color: #000080;">    Option         "TVStandard" "PAL-B"</span></pre>
<p>&#8230;so now the Screen section looked like this:</p>
<pre><span style="color: #000080;">Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "TwinViewXineramaInfoOrder" "TV-0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    Option         "TVOutFormat" "SVIDEO"
    Option         "TVStandard" "PAL-B"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection</span></pre>
<p>This ultimately outputted a 1024&#215;768 display on the TV, stretched horizontally (a 4:3 screenmode stretched to fit a physical 16:9 display). If your Ubuntu desktop is larger than the screen, just adjust your TV&#8217;s picture size until everything fits in. In my case, only the top and bottom panels got slightly chopped off which was fixed with a minor vertical size adjustment on the TV.</p>
<p><em><span style="text-decoration: underline;"><strong><span style="color: #0000ff;">Installing MythTV</span></strong></span></em></p>
<p>First we need to enable the system to access the Multiverse repository. Do this by going to <em>System-&gt;Administration-&gt;Software Sources</em> and place a check mark against all five boxes, click OK and acknowledge the prompt to reload your package lists.</p>
<p>We now set about installing the extra software I required to turn this box into a MythTV server (which was going to run both Backend and Frontend):</p>
<pre><span style="color: #000080;">$ sudo apt-get install mythtv</span></pre>
<p>That&#8217;s all you need to get the main MythTV stuff working &#8211; the &#8220;mythtv&#8221; metapackage installs the MythTV Frontend, MythTV Backend, MySQL Server, MySQL Client, MythTV database configuration, all the default MythTV themes, etc. In my case, however I also installed the following for extra video/audio codecs (such as MP3 for listening to music files or watching movie rips), Java, Flash, the Microsoft Fonts, the Compiz Configuration manager for doing desktop eye-candy, the SSH server daemon to remote control the box when my folks call for help, and finally the MythWeb add-on that allows you to look at the MythTV server&#8217;s TV guide and schedule programs to record using a web browser interface:</p>
<pre><span style="color: #000080;">$ sudo apt-get install mythtv ubuntu-restricted-extras compizconfig-settings-manager ssh mythweb</span></pre>
<p>&#8230;and from the <a title="Medibuntu Home Page" href="http://www.medibuntu.org" target="_blank">Medibuntu repository</a>, I installed the following for extra codecs and DVD decrypting/playback:</p>
<pre><span style="color: #000080;">$ sudo apt-get install non-free-codecs libdvdcss2 mplayer mencoder</span></pre>
<p><em>Note: I did not need to install lirc for the remote control because the Digitech remote is actually a USB keyboard in disguise, not a &#8220;proper&#8221; infra-red remote.</em></p>
<p>During the installation of these packages, you will be prompted for a few things, namely:</p>
<ol>
<li>Create a password for the root MySQL account. If this MythTV installation is purely for in-house use only, then just go with something simple like &#8220;password&#8221;. Many suggest leaving it blank, but I&#8217;ve personally seen this create authentication problems later on.</li>
<li>Create the MySQL database. When prompted for the MythTV server address, change the default &#8220;localhost&#8221; to the IP address of the PC you are installing the Backend on. If the Backend Server has an IP address of 192.168.0.10, then type in 192.168.0.10 in place of &#8220;localhost&#8221;. If you only intend to run one machine only for everything, then you can leave &#8220;localhost&#8221; as is.</li>
<li>When prompted for the name of the MySQL database, leave it as the default &#8220;mythconverg&#8221;.</li>
<li>Make note of the password generated for the MythTV database. You will need this to configure your MythTV Frontend.</li>
<li>Indicate whether or not you intend to have more than one Frontend client connect to your Backend server.</li>
<li>If you elected to install MythWeb, then you will be asked a question as to whether or not you want your MythWeb site password protected.</li>
<li>Acknowledge other prompts that tell you about creating the &#8220;MythTV&#8221; groups etc.</li>
<li>Your PC now has a user and Home directory called /home/mythtv and we need to ensure that the &#8220;mythtv&#8221; group can write to it as well as the owner, so at a terminal, type in:
<pre><span style="color: #000080;">$ sudo chmod -R g+w /home/mythtv</span></pre>
<p>&#8230;and hit Enter.</li>
<li>Finally, if you intend more than one Frontend to access your Backend machine, we need to tell MySQL to allow other PC&#8217;s on your network to access the database, or those Frontends (other than the one on the Backend server) will not be able to start. To do this, type the following at the $ prompt. Everyone else can skip to Step 12.
<pre><span style="color: #000080;">$ mysql mythconverg -u root -p</span></pre>
</li>
<li>When prompted, enter in the root MySQL password you specified earlier.</li>
<li>You will then be shown a MySQL prompt. If your local network&#8217;s IP topology is 192.168.0.x, and the password that was generated for MythTV&#8217;s database was &#8220;8tSpxGiM&#8221; then type the following to grant access to all PC&#8217;s on your local network to the MythTV MySQL database, at the &#8220;mysql&gt;&#8221; prompt:
<pre><span style="color: #000080;">mysql&gt; grant all on mythconverg.* to mythtv@"192.168.0.%" identified by "8tSpxGiM";
mysql&gt; flush privileges;
mysql&gt; quit
</span></pre>
<p>&#8230;this will allow all PC&#8217;s with IP addresses starting with 192.168.0.x to access the MythTV database. If you are paranoid and only want to allow specific PC&#8217;s to access the database, then simply issue the &#8220;grant all&#8221; line for all explicit IP addresses only, by replacing the &#8220;%&#8221; wildcard character with the explicit IP address you want to allow, ie: to allow just 192.168.0.67 in, replace &#8220;192.168.0.%&#8221; with &#8220;192.168.0.67&#8243;. Repeat for all specific IP&#8217;s to allow. You only have to issue the &#8220;flush&#8221; command once at the end to make your changes take effect.</li>
<li>Confirm that you can access the MythTV database as the MythTV user at the $ terminal prompt. If you are only using one machine, do this on the Backend server. If you are using multiple Frontends, test this on the remote PC&#8217;s that will be running the Frontend software (obviously replace the IP address with the actual IP address your Backend machine is using):
<pre><span style="color: #000080;">$ mysql mythconverg -h 192.168.0.10 -u mythtv -p</span></pre>
<p>&#8230;when prompted, enter the MythTV password that was generated earlier. If successful, you should be looking at a &#8220;mysql&gt;&#8221; prompt. If not, you will get an error, probably along the lines of &#8220;access denied&#8221;.<em> NOTE: If you configured &#8220;localhost&#8221; to be the Backend Server in Step 2, then you <span style="text-decoration: underline;">must</span> use the name &#8220;localhost&#8221; to connect to MySQL. Using &#8220;127.0.0.1&#8243; instead will not work because you have not configured &#8220;127.0.0.1&#8243; to have access to the mythconverg database. If you wanted these permissions, you would modify Step 11 to be the following commands:<br />
</em></p>
<pre><span style="color: #000080;">mysql&gt; grant all on mythconverg.* to mythtv@"192.168.0.%" identified by "8tSpxGiM";
mysql&gt; grant all on mythconverg.* to mythtv@"127.0.0.1" identified by "8tSpxGiM";
mysql&gt; grant all on mythconverg.* to mythtv@"localhost" identified by "8tSpxGiM";
mysql&gt; flush privileges;
mysql&gt; quit
</span></pre>
<p>&#8230;which will allow the &#8220;mythtv&#8221; user to connect from any IP on the 192.168.0.x network, from 127.0.0.1 and any host called &#8220;localhost&#8221;, all using the specified password.</p>
<pre><span style="color: #000080;"> </span></pre>
</li>
<li>Quit the MySQL client by typing &#8220;quit&#8221; at the &#8220;mysql&gt;&#8221; prompt:
<pre><span style="color: #000080;">mysql&gt; quit</span></pre>
</li>
</ol>
<p><span style="text-decoration: underline;"><span style="color: #0000ff;"><em><strong>Configuring MythTV &#8211; the Backend</strong></em></span></span></p>
<p>At this point, make sure your TV tuners are connected. In my case, the Asus U3100&#8242;s are connected into two free USB ports at the rear of the PC and have automatically been detected as Ubuntu carries full support for the U3100 already.</p>
<p>Now we need to start MythTV Backend Setup for the first time. Go to System-&gt;Administration-&gt;MythTV Backend Setup. When you do so, it will prompt you that your user (in my case &#8220;htpc&#8221;) needs to be added to the &#8220;mythtv&#8221; group. Acknowledge this and then accept being logged out for the change to take effect. Log yourself back in. Once logged back in, restart the MythTV Backend Setup again. You will be reminded that the MythTV Backend needs to be stopped before you can continue. Click OK.</p>
<p>You are presented with several options. Choose &#8220;General&#8221; (if you are using a remote, you should find the basic Up/Down and OK buttons work here already).</p>
<ol>
<li>Change the &#8220;Local backend&#8221; and &#8220;Master backend&#8221; addresses to be &#8220;localhost&#8221; (in lower case and one word). Leave all the &#8220;port&#8221; numerical figures alone.</li>
<li>Click on &#8220;Next&#8221;. If you&#8217;re only using a keyboard, then press ALT + N to proceed. The screen content will change.</li>
<li>Change the &#8220;TV format&#8221; to suit your local country. In my case, this is &#8220;PAL&#8221;. If you are in America or Japan, you&#8217;ll use &#8220;NTSC&#8221;. Check your local TV standards if you are not sure.</li>
<li>Change the channel frequency table option to your local country. In my case, this is &#8220;australia&#8221;.</li>
<li>The timezone for your guide XML data will ultimately depend on how you get your guide data. In my case, I just use Auto.</li>
<li>Click on &#8220;Next&#8221; or ALT + N on the keyboard.</li>
<li>We don&#8217;t need to change anything on this screen or the five screens that follow it, so click on &#8220;Next&#8221; again until you get to the last page where the button now says &#8220;Finish&#8221;.</li>
<li>Click on the &#8220;Finish&#8221; button or press ALT + F on the keyboard. You will be returned back to the main menu.</li>
</ol>
<p>Now choose the &#8220;Capture cards&#8221; option.</p>
<ol>
<li>Choose the &#8220;New capture card&#8221; option from the list.</li>
<li>What you choose here will be dependent on what your tuner hardware is. In my case, I change the &#8220;Card type&#8221; until it says &#8220;DVB DTV Capture Card (v3.x)&#8221; and you will see that the &#8220;Frontend ID&#8221; will show &#8220;DiBcom 7000PC&#8221; and the &#8220;Subtype&#8221; will be &#8220;DVB-T&#8221; indicating a &#8220;Digital Video Broadcast &#8211; Terrestrial&#8221; device was found.</li>
<li>Click on the &#8220;Recording Options&#8221; button and ensure that the &#8220;Max recordings&#8221; option is set to &#8220;2&#8243; (most digital tuners can record two channels at once from the same network, thus two physical tuners effectively become four usable tuners within MythTV).</li>
<li>Go back to the previous screen by clicking on Finish and then click on Finish again. You will be returned to the Capture card list and you will now see a new line for the card you just setup.</li>
<li>Since I have two tuners, I repeat this whole process again &#8211; the system will pick up the second tuner and label it accordingly &#8211; you can&#8217;t setup a card more than once accidentally. In my case now I have two cards called <em>DVB:0</em> and <em>DVB:1</em> listed.</li>
<li>Press ESC to return back to the main menu.</li>
</ol>
<p>Now choose the &#8220;Video sources&#8221; option.</p>
<ol>
<li>Choose the &#8220;New video source&#8221; option from the list.</li>
<li>Give your video source a name, eg: &#8220;Digital Free-to-Air&#8221;. This can be anything you want.</li>
<li>For your Settings Grabber, just choose the &#8220;Transmitted guide only (EIT)&#8221; or &#8220;No grabber&#8221; option for now. If you already have a preferred grabber, then choose it here now.</li>
<li>Click on Finish.</li>
<li>We only need one source for both tuners, so we&#8217;re done here. Press ESC to return back to the main menu.</li>
</ol>
<p>Now choose the &#8220;Input Connections&#8221; option. This is where we tie our source to the tuners.</p>
<ol>
<li>Choose the first tuner in your list. In my case I have &#8220;DVB: 0 (DVBInput) -&gt; (None)&#8221;.</li>
<li>Change the &#8220;Display Name (optional)&#8221; to be something that describes the tuner, eg: &#8220;Digital tuner 1&#8243;. This can be anything you want and will serve to highlight what tuner you are using to watch or record a particular show.</li>
<li>Change &#8220;Video source&#8221; to the one you created in the &#8220;Video sources&#8221; earlier. In my case, I choose the only option I have &#8211; &#8220;Digital Free-to-Air&#8221;.</li>
<li>Now press the &#8220;Scan for channels&#8221; button.</li>
<li>Ensure that &#8220;Scan Type&#8221; is set to &#8220;Full Scan&#8221; and that your Country is correct.</li>
<li>Make sure that your TV aerial is securely connected to your TV tuner and then click on &#8220;Next&#8221;. The tuner will begin looking for TV channels. This can take several minutes to complete. Do not interrupt the process, even if it looks like it has gotten stuck &#8211; it will finish eventually. Any channels found will be listed in the status window at the back.</li>
<li>Once finished, press &#8220;Finish&#8221;.</li>
<li>Now press &#8220;Next&#8221;. Don&#8217;t change anything here.</li>
<li>Press &#8220;Finish&#8221;. You will be returned to the &#8220;Input Connections&#8221; list.</li>
<li>Repeat steps 1 to 3 only for any additional tuners you have (in my case, I had to repeat for the second tuner). We don&#8217;t need to re-scan for channels because the tuners are using the same source and we&#8217;ve already populated it with channels in the first run. In this instance, once you have done steps 1 to 3, just click on &#8220;Next&#8221; and then &#8220;Finish&#8221;.</li>
<li>Press ESC to return back to the main menu.</li>
</ol>
<p>Now choose the &#8220;Channel Editor&#8221; option and review all the channels that were picked up in the scan. Optionally, you may also have MythTV automatically download what it believes are the correct network icons for those channels from the Internet using the &#8220;Download icons&#8221; button. Delete any channels you don&#8217;t want to review. Eg: in my case, I also picked up some digital radio channels. I&#8217;m not interested in those, so I could delete those if I so choose.</p>
<p>Press ESC to go back to the main menu.</p>
<p>Now choose the &#8220;Storage Directories&#8221; option. This is where we tell MythTV where to put all our TV recordings.</p>
<ol>
<li>Choose &#8220;Default&#8221; from the list.</li>
<li>Choose the &#8220;/var/lib/mythtv/recordings&#8221; path already defined and change it to &#8220;/home/mythtv&#8221; (or whatever you prefer).</li>
<li>Click the &#8220;OK&#8221; button.</li>
<li>If you want to add more directories from other devices such as secondary hard-disks or network drives, just &#8220;Add directory&#8221; and specify them accordingly.</li>
<li>Once done, press ESC to return back to the main menu.</li>
</ol>
<p>We&#8217;re now done configuring the Backend, so press ESC again to close the MythTV Backend Setup application. If you get an error, review it and see if you can fix it based on the information provided. In particular, if it tells you that it couldn&#8217;t write a &#8220;.test&#8221; file to /home/mythtv, then you did not grant the &#8220;mythtv&#8221; group writer permissions to &#8220;/home/mythtv&#8221; (See Step 8 in &#8220;Installing MythTV&#8221; earlier in this article).</p>
<p>Upon exiting, after a couple of seconds a dialog box will appear asking if you wish to run &#8220;mythfilldatabase&#8221;. Say YES. Once this is done, the MythTV Backend should automatically restart in the background briefly and then its output window should disappear.</p>
<p><span style="text-decoration: underline;"><span style="color: #0000ff;"><em><strong>Configuring MythTV &#8211; the Frontend</strong></em></span></span></p>
<p>We&#8217;re nearly there! Now to configure the Frontend! Go to Applications-&gt;Sound &amp; Video-&gt;MythTV Frontend. After a brief delay, you will see the default MythTV menu.</p>
<ol>
<li>Choose &#8220;Utilities/Setup&#8221; from the menu.</li>
<li>Now choose &#8220;Setup&#8221; in the next menu.</li>
<li>Now choose &#8220;General&#8221; in the next menu.</li>
<li>If the PC you are on now is the Backend server, then this should already show that the&#8221;Database Server Settings&#8221; hostname is &#8220;localhost&#8221;. If you are installing a laptop/desktop that is NOT the Frontend, then you need to have the IP or hostname of the Backend machine here instead so that Frontend client knows who to talk to. In the case of your installation example, I&#8217;m using 192.168.0.10.</li>
<li>The port number can be left empty. It will use the MythTV default automatically.</li>
<li>The database name should already be &#8220;mythconverg&#8221;.</li>
<li>The user name should already be &#8220;mythtv&#8221;.</li>
<li>The password should already be the one that was randomly generated during the installation process.</li>
<li>Press &#8220;Next&#8221;.</li>
<li>Nothing to change on this screen, so press &#8220;Next&#8221; again.</li>
<li>Change the audio settings to suit your own configuration. If you are using an ordinary stereo setup, you can leave pretty much all of this unchanged, however I&#8217;d recommend adjusting the &#8220;Master Mixer Volume&#8221; to 100 and the &#8220;PCM Mixer Volume&#8221; to 80 or 90 (don&#8217;t set PCM to 100 as some motherboards will output scratchy/distorted audio depending on the quality of your on-board sound hardware).</li>
<li>Press &#8220;Next&#8221; through the next four screens.</li>
<li>Press &#8220;Finish&#8221;. You will be returned to the Setup menu.</li>
</ol>
<p><em>Special setup: Configuring your MythTV Frontend to output digital audio via SP/DIF on the PC&#8217;s motherboard.</em></p>
<ol>
<li>By default, motherboards with on-board SP/DIF out generally have their output muted, and as a result you will not see any laser light from any toslink cable connected to the motherboard. Unless you&#8217;re lucky, 9 times out of 10, the SP/DIF controls will <em>not</em> appear in the graphical Volume Control applet. To get around this, open a terminal.<br />
.</li>
<li>Now type in &#8220;alsamixer&#8221; and you will be presented with a terminal version of the Volume Control applet.<a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/AlsaMixer1.jpg" target="_blank"><br />
<img title="Alsa Mixer initial screen" src="http://www.serenux.com/~hyrax/snaps/AlsaMixer1_thumb.jpg" alt="Click for full size" /><br />
</a>Click for full size (56K)<a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/AlsaMixer1.jpg" target="_blank"><br />
</a>.<a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/AlsaMixer1.jpg" target="_blank"></a></li>
<li>Now press the right-arrow key until you come across any &#8220;IEC958&#8243; related options. There will generally be two or three entries. You will probably find they have &#8220;MM&#8221; above them which means they are Muted.<br />
<a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/AlsaMixer2.jpg" target="_blank"><img title="Alsa Mixer - SPDIF output muted" src="http://www.serenux.com/~hyrax/snaps/AlsaMixer2_thumb.jpg" alt="Click for full size" /><br />
</a> Click for full size (50K)<a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/AlsaMixer2.jpg" target="_blank"><br />
</a>.<a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/AlsaMixer2.jpg" target="_blank"><br />
</a></li>
<li>Press the M key on your keyboard to toggle the Mute status of that option so that it now shows &#8220;OO&#8221; instead. This means it is no longer muted.<br />
<a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/AlsaMixer3.jpg" target="_blank"><img title="Alsa Mixer - SPDIF output unmuted" src="http://www.serenux.com/~hyrax/snaps/AlsaMixer3_thumb.jpg" alt="Click for full size" /><br />
</a> Click for full size (51K)<a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/AlsaMixer3.jpg" target="_blank"><br />
</a>.</li>
<li>If you&#8217;re looking at your toslink cable, you should now see the fibre optic line in it light up with red laser light as you unmute it. You&#8217;re done, so press ESC to close the Alsa Mixer interface.</li>
<p style="text-align: center;">
</ol>
<p>Now choose &#8220;Appearance&#8221; from the menu.</p>
<ol>
<li>You can now choose a different theme from here which makes the interface look more attractive than the default theme. My personal favourite is &#8220;Blootube&#8221; and &#8220;Blootube Wide&#8221;.</li>
<li>If you are using 3D-enabled video drivers such as the NVidia binary drivers, you can elect to change the Paint Engine to OpenGL which will do nice crossfade transitions from one menu to another (note that there are <em>no</em> 3D transitions).</li>
<li>I also change the &#8220;Menu theme&#8221; here to &#8220;classic&#8221; as I believe it provides a more intuitive menu tree within MythTV. I encourage you to explore these options and choose what works best for you.</li>
<li>Page the &#8220;Next&#8221; button until you get to the end and then click &#8220;Finish&#8221;.</li>
<li>If you&#8217;ve chosen a new theme, it will now be scaled appropriately for your display and switched over.</li>
</ol>
<p>You are now ready to begin watching TV, but you may want to quickly duck back into Setup-&gt;Playback OSD and change the theme there to &#8220;Blootube&#8221; or whatever you prefer as well as the On-Screen-Display when watching TV has a separate theme setting to the menus.</p>
<p>To watch TV, simply choose &#8220;TV&#8221; and then &#8220;Watch TV&#8221; from the MythTV menu. Use the up and down arrow keys and Enter to change channels.</p>
<p>Examples of the Blootube-themed main menu and TV OSD (on a full high definition display):</p>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/MythTVInterface1.jpg" target="_blank"><img title="The main MythTV menu for watching TV, using the Blootube theme" src="http://www.serenux.com/~hyrax/snaps/MythTVInterface1_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (135K)</p>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/MythTVInterface2.jpg" target="_blank"><img title="The Blootube theme OSD watching live HDTV" src="http://www.serenux.com/~hyrax/snaps/MythTVInterface2_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (384K)</p>
<p><span style="color: #0000ff;"><em><strong><span style="text-decoration: underline;">Using MythWeb</span></strong></em></span></p>
<p>MythWeb is completely automatically configured. Using our installation example Backend host IP of 192.168.0.10, you can access it by opening your web browser and surfing over to <em>http://192.168.0.10/mythweb</em> and you will be presented with the main menu of MythWeb.</p>
<p>Being a web site, MythWeb is obscenely easy and self-explanatory to get around, so I won&#8217;t detail any of its most common functions here. I encourage you to explore the interface.</p>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/MythWebWelcome.jpg" target="_blank"><img title="The MythWeb home page" src="http://www.serenux.com/~hyrax/snaps/MythWebWelcome_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (99K)</p>
<p>One particularly useful feature of MythWeb is in getting the Digitech generic remote to work. Out of the box, I only found the direction and OK buttons to work right away. All the other buttons generate keyboard presses that do not coincide with MythTV&#8217;s default keys. For example, the Play/Pause key on the remote generates &#8220;CTRL + P&#8221; instead of just &#8220;P&#8221;, hence MythTV doesn&#8217;t act on the button press.</p>
<ol>
<li>To reconfigure key binds, all you have to do is click on the &#8220;Settings&#8221; option on the main menu.<br />
.</li>
<li>Now click on &#8220;Key Bindings&#8221; in the presented options.</li>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/MythKeybinds1.jpg" target="_blank"><img title="MythWeb Key Bindings menu option" src="http://www.serenux.com/~hyrax/snaps/MythKeybinds1_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (116K)<br />
.</p>
<li>You are presented with all the available keybinds for various areas of MythTV. Scroll down the list until you find the keys pertaining to &#8220;TV Frontend&#8221; (first column).<br />
.</li>
<li>Now locate the key bind related to &#8220;PLAYBACK &#8211; Play Program&#8221; (second and third columns). You will notice that the key assigned (in the fourth column) already is &#8220;P&#8221;.</li>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/MythKeybinds2.jpg" target="_blank"><img title="Locating and changing a key binding for MythTV" src="http://www.serenux.com/~hyrax/snaps/MythKeybinds2_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (135K)<br />
.</p>
<li>To add the CTRL + P key combination without erasing the original &#8220;P&#8221; key, simply change the text box to read &#8220;P, Ctrl+P&#8221;. This binds both the P and CTRL + P key combinations to the Playback command.</li>
<li>Change all the other keys you need to change or add.</li>
<li>When done, scroll right to the very bottom of the key binds page and click on the &#8220;Save&#8221; button.</li>
<li>Restart the Frontend to read in your new changes and test the remote.</li>
</ol>
<p>This is what the Digitech generic MCE remote looks like:</p>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/pics/MythTV/DigitechRemote.jpg" target="_blank"><img title="The Digital Generic MCE remote control and USB receiver" src="http://www.serenux.com/~hyrax/pics/MythTV/DigitechRemote_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (116K)</p>
<p><span style="color: #0000ff;"><span style="text-decoration: underline;"><em><strong>OPTIONAL: Setting up the Shepherd Electronic Program Guide (EPG)<br />
</strong></em></span></span></p>
<p>Shepherd is an amazing Perl script that enhances and keeps your EPG data up to date in Myth, always providing better information about programs than the networks themselves do. A typical example of a poor network-supplied program description might be <em>&#8220;Late Movie: 10:30pm &#8211; Pirates of the Carribean starring Johnny Depp&#8221;</em> and&#8230; that&#8217;s it. How boring! Shepherd will use a grading system as well as sourcing categories of data from different sites in order to provide you a comprehensive description of all your programs instead. In the case of the above example, it would go to the IMDB and get the official movie blurb to use instead.</p>
<p><em><strong>NOTE: Shepherd is geared towards Australian MythTV users only. This is due to long-running (and petty) legal disputes over EPG supply and copyright in this country. If you are outside of Australia, you most likely already have a proper EPG provided for you and you should use that instead.</strong></em></p>
<p>Setting up Shepherd is trivial (Shepherd was up to version 1.3.39 at the time of this writing &#8211; refer to the <a title="Official Shepherd Installation Page" href="http://svn.whuffy.com/index.cgi/wiki/Installation" target="_blank">official installation page</a> for any changes made to the installation process since).</p>
<ol>
<li>Open a terminal and type in the following:
<pre><span style="color: #000080;">$ wget http://www.whuffy.com/shepherd/shepherd</span></pre>
<p>&#8230;and press Enter. This will grab the latest version of the Shepherd Perl script.<br />
.</li>
<li>Before we run it, we need to install some dependencies:
<pre><span style="color: #000080;">$ sudo apt-get install xmltv libxml-simple-perl libjavascript-perl \
libalgorithm-diff-perl libgetopt-mixed-perl libcompress-zlib-perl \
libdata-dumper-simple-perl libdate-manip-perl liblist-compare-perl \
libdatetime-format-strptime-perl libhtml-parser-perl libxml-dom-perl \
libgd-gd2-perl libdigest-sha1-perl libarchive-zip-perl \
libio-string-perl libdbi-perl</span></pre>
<p>&#8230;and hit Enter.<br />
.</li>
<li>Once all that is installed, now run the Shepherd setup script with the command:
<pre><span style="color: #000080;">$ perl shepherd</span></pre>
<p>&#8230;and hit Enter.<br />
.</li>
<li>Shepherd will initially re-install itself into the &#8220;mythtv&#8221; user&#8217;s home directory, ie: /home/mythtv, and re-run itself.</li>
<li>Shepherd will then begin checking itself to ensure all its data grabbers are the latest versions and download any that are missing. It will then prompt you through the rest of the installation process, which is generally straight forward, but we&#8217;ll step through it here:</li>
<li>First you are asked for a region code and are shown a giant list. Type in the number relevant to you and hit Enter. Eg: if you lived in Melbourne, Victoria, you would type in &#8220;94&#8243; as the code associated with that region. If you were in Sydney, you&#8217;d type in &#8220;73&#8243; instead.</li>
<li>Next you are asked if you would like Guided Channel Selection. Say YES (or just hit Enter as the default response is yes anyway).</li>
<li>You will then be asked if you have High-Definition TV. If you do use HDTV channels, you should say YES to this.</li>
<li>You are then asked if you have PayTV. If you are only configuring MythTV for Free-to-Air TV, say NO to this.</li>
<li>Now MythTV will ask you to match the known channels for your region to the channels that are setup in your MythTV installation. It will prompt you for each channel one by one. Simply enter the number corresponding to the guide data source you believe belongs to the currently displayed channel, eg: in some country areas, Channel Nine is known as WIN, so any references to &#8220;Channel Nine&#8221; you would tell Shepherd to use guide data provided by WIN. Repeat this until all channels have been prompted for. You may come across some doubled-up channels. This is normal.</li>
<li>When finished, Shepherd will list all your selections so you can verify them. When you are happy, respond YES.</li>
<li>You will then be asked about transitioning from an old grabber. Since this is a fresh installation, choose the zero (&#8220;do not transition&#8221;) option.</li>
<li>You will be given one more review and will then be asked if you&#8217;d like Shepherd to create a configuration file and update MythTV. Say YES.</li>
<li>When prompted about allowing Shepherd to auto-configure MythTV, say YES.</li>
<li>When prompted for Shepherd to create a symbolic link, say YES.</li>
<li>When prompted about the cron job Shepherd sets up, say YES.</li>
<li>Respond YES to the review question.</li>
<li>Shepherd will then begin testing its components and will eventually ask if you would like to install channel icons. This is not necessary (though you can complete it if you really like), so say NO to this.</li>
<li>Shepherd will finish.</li>
<li>Now we need to populate the EPG using Shepherd for the first time. Note that the initial run can take potentially an hour or more to run depending on your connection and quantity of channels in MythTV to find data for. Once finished, however, each subsequent run (once per hour, 24 hours) should be much faster. To run it for the first time manually, simply type in:
<pre><span style="color: #000080;">$ mythfilldatabase</span></pre>
<p>&#8230;and hit Enter.<br />
.</li>
<li>Depending on the minute that Shepherd setup for the cron job, you may find that as you try to run it manually, Shepherd advises that &#8220;another instance is running&#8221; and will abort itself. That&#8217;s fine &#8211; the job&#8217;s already started then automatically.</li>
<li>When Shepherd has completed its run, you will find that your EPG within MythTV is now nicely populated with highly descriptive blurbs and will remain so for at least 7-8 days ahead as long as the PC has a connection to the Internet.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/06/howto-build-a-mythtv-box-from-scratch-using-ubuntu-jaunty-904/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>HowTo: Fix MythTV&#8217;s Frontend not going full-screen in Ubuntu Jaunty.</title>
		<link>http://www.serenux.com/2009/04/howto-fix-mythtvs-frontend-not-going-full-screen-in-ubuntu-jaunty/</link>
		<comments>http://www.serenux.com/2009/04/howto-fix-mythtvs-frontend-not-going-full-screen-in-ubuntu-jaunty/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 11:36:43 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Display]]></category>
		<category><![CDATA[Jaunty]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=485</guid>
		<description><![CDATA[The next version of Ubuntu is here &#8211; 9.04 aka &#8220;Jaunty Jackalope&#8221;. Along with a wealth of new features comes a wealth of new minor bugs to fix. Not enough to be show-stoppers, but enough to annoy the heck out of you, and here&#8217;s a doozy. If, like most people, you have Compiz enabled and [...]]]></description>
			<content:encoded><![CDATA[<p>The next version of Ubuntu is here &#8211; 9.04 aka &#8220;Jaunty Jackalope&#8221;. Along with a wealth of new features comes a wealth of new minor bugs to fix. Not enough to be show-stoppers, but enough to annoy the heck out of you, and here&#8217;s a doozy.</p>
<p>If, like most people, you have Compiz enabled and you start the MythTV Frontend, you will notice that rather than go full-screen, Myth will start as a window, essentially, even if your settings within Myth say to go full-screen.</p>
<p>In a single-screen scenario, the MythTV window will start just underneath the upper Gnome panel and the lower Gnome panel will sit over the top of the Myth window, obscuring part of the display. Proof that it&#8217;s a window can be found by holding down the ALT key and then dragging the MythTV display around with your mouse.</p>
<p>If you&#8217;re like me and use two displays with Myth being run on the second screen, you will see a gap at the top of the screen that is the same height as the upper Gnome panel and you will see your wallpaper showing through there, as shown in the illustration below.</p>
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/MythTVJauntyCompizGap.jpg" target="_blank"><img title="Gap in the MythTV display" src="http://www.serenux.com/~hyrax/snaps/MythTVJauntyCompizGap_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (520K)</p>
<p>Here&#8217;s how to fix this problem.</p>
<p><em><strong>EDIT June 2010: This problem still plagues Ubuntu 9.10 and 10.04, and  this fix will work for those releases as well.</strong></em></p>
<p><span id="more-485"></span></p>
<p>The simplest fix is to disable Compiz altogether and MythTV will suddenly go full-screen, but that&#8217;s not really a solution &#8211; you want to keep your eye-candy! So follow the next few steps instead:</p>
<ol>
<li>Go to System-&gt;Preferences-&gt;CompizConfig Settings Manager. If you do not have this option in your Preferences, then you need to add it. Quickly jump into a terminal and type in at the $ prompt:
<pre><span style="color: #000080;">$ sudo apt-get install compizconfig-settings-manager</span></pre>
<p>&#8230;and hit Enter. Once installed, go back into the Preferences menu and bring it up.</li>
<li>Scroll down until you get to the &#8220;Utility&#8221; section and then click on &#8220;Workarounds&#8221;. It should alredy be selected as enabled, but if not, also make sure the checkbox next to it is enabled too.
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/CompizWorkaroundSettings1.jpg" target="_blank"><img title="Compiz Workarounds" src="http://www.serenux.com/~hyrax/snaps/CompizWorkaroundSettings1_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (81K)<br />
.</p>
</li>
<li>The window changes to show you the Workaround options. The very first option is &#8220;Legacy Fullscreen Support&#8221;. This is unchecked by default. Click on the checkbox so that it IS checked, and then click on the Back button, then close the window.
<p style="text-align: center;"><a title="Click for full size" href="http://www.serenux.com/~hyrax/snaps/CompizWorkaroundSettings2.jpg" target="_blank"><img title="Compiz Workarounds" src="http://www.serenux.com/~hyrax/snaps/CompizWorkaroundSettings2_thumb.jpg" alt="Click for full size" /></a><br />
Click for full size (71K)<br />
.</p>
</li>
<li>Quit the MythTV Frontend if you had it open already and then restart it. You will now find that the gap has disappeared, and that the MythTV display is now appearing full-screen properly instead of just being a window.<br />
.</li>
<li>Pat yourself on the back.</li>
</ol>
<p>Happy viewing! <img src='http://www.serenux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em>Please note: This workaround is just that &#8211; a workaround. One minor problem that arises with it is that you may get occasional screen &#8220;flashing&#8221; or a flash of the background wallpaper appearing when a DBus message is displayed, or if you scroll a window or terminal on the same or other screen in a multi-screen setup. This does not occur often, however, and so may not bother you at all! The bug has been reported, and no doubt will be fixed in due course. When it is fixed, this workaround should be reversed.<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/04/howto-fix-mythtvs-frontend-not-going-full-screen-in-ubuntu-jaunty/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>HowTo: Encode a Blu-ray rip into a smaller format without losing quality</title>
		<link>http://www.serenux.com/2009/02/howto-encode-a-blu-ray-rip-into-a-smaller-format-without-losing-quality/</link>
		<comments>http://www.serenux.com/2009/02/howto-encode-a-blu-ray-rip-into-a-smaller-format-without-losing-quality/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 05:39:29 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Blu-ray]]></category>
		<category><![CDATA[High-Definition]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=420</guid>
		<description><![CDATA[Those of you who archive or backup their Blu-ray movie media to hard-drive will already be aware that the average movie comes out at a good 25GB. Some of the bigger titles top out at around 40GB or more. This eats up an awful lot of disk space. Blu-ray titles are already compressed down using [...]]]></description>
			<content:encoded><![CDATA[<p>Those of you who archive or backup their Blu-ray movie media to hard-drive will already be aware that the average movie comes out at a good 25GB. Some of the bigger titles top out at around 40GB or more. This eats up an awful lot of disk space.</p>
<p>Blu-ray titles are already compressed down using the MPEG2 codec, and quality pundits will abhor the idea of re-compressing the title again for fear of losing image and audio quality. Certainly if you go down the Xvid route, you will definitely lose image quality, but as per my previous DVD HowTo, you can do excellent rips with virtually indistinguishable quality to the original using the x264 codec, and have a significantly smaller footprint to go with it.</p>
<p>The process of encoding a Blu-ray rip isn&#8217;t quite the same as doing a DVD, however, so here&#8217;s a quick guide on how to take your decrypted .m2ts file and finish up with a much smaller, but 99% perfect copy in a Matroska .mkv file.</p>
<p><span id="more-420"></span><span style="text-decoration: underline;"><strong></strong></span></p>
<p><span style="text-decoration: underline;"><strong>Pre-requisites:</strong></span></p>
<ul>
<li>A pre-decoded Blu-ray movie file (.m2ts file).</li>
<li>Approximately the same amount of free disk space as the size of the movie file. Eg: If you have a 25GB movie file, then you should have another 25GB free space to work with. You can have less, since the final resulting file will be much smaller than the original movie anyway, but since this process can take a number of hours to complete, you don&#8217;t exactly want to discover you ran out of disk space and have to start over, do you?</li>
<li>A nice powerful CPU. I use a Intel quad-core Q9450 CPU at 2.66GHz. It takes my machine roughly 9-12 hours to process just <em>one</em> movie using four threads. A dual-core will take longer.</li>
<li>Time to let the PC do its work, eg: overnight.</li>
</ul>
<p>This guide was written using Ubuntu 8.10 Intrepid Ibex 64-bit, but will work quite happily in 32-bit and should also work with most previous versions of Ubuntu.</p>
<ol>
<li>You will need some extra software installed if you haven&#8217;t already got it. Open a terminal and type in the following at the $ prompt:
<pre><span style="color: #000080;">$ sudo apt-get install mencoder mplayer gpac x264 mkvtoolnix</span></pre>
<p>(Don&#8217;t worry if you&#8217;ve already got some of those apps installed, Ubuntu will skip over them if they already exist on your system)</li>
<li>Create a new text file somewhere using your favourite text editor, eg:
<pre><span style="color: #000080;">$ gedit ~/encodevideo.sh</span></pre>
<p>&#8230;will create a new text file called &#8220;encodevideo.sh&#8221; in the root of your Home directory using the GEdit text editor.</li>
<li>Now copy and paste the following script into it:
<pre><span style="color: #000080;">#! /bin/bash

# =====================================================================
# Blu-ray encoding script by HyRax February 2009 http://www.serenux.com
</span><span style="color: #000080;"># <span style="color: #000080;">=====================================================================
</span></span><span style="color: #000080;">
# Make sure the user has specified what to work on.
if [ -z "$1" ]; then
  echo "\nBlu-ray movie encoding script\n-----------------------------"
  echo "Written by HyRax February 2009\nhttp://www.serenux.com"
  echo "\nUsage: $0 &lt;m2ts file without extension&gt;"
  echo "\nExample: If your movie file is called TheDarkKnight.m2ts then\nyour usage will be: $0 TheDarkKnight\n"
  exit
fi
</span>
<span style="color: #000080;"># The crf=21 option controls encoding quality, and indirectly the final
# filesize. The higher the value, the more compression and thus smaller
# file size. Reduce the value and file size will go up. A value of 21
# should produce a file of approximately 4GB in size for a typical movie.

# Encode the video using x264, ignore the audio for now.
mencoder $1.m2ts \
-ovc x264 -x264encopts crf=21:frameref=3:bframes=3:b_pyramid=normal:direct_pred=auto:weight_b:partitions=all:8x8dct:me=umh:mixed_refs:trellis=1:nopsnr:nossim:subq=6:level_idc=41:threads=4 \
-nosound \
-of rawvideo \
-o $1.x264

# Dump the first original audio track (should be the English track) but
# don't re-encode it. Ignore the video.
mplayer $1.m2ts -dumpaudio -dumpfile $1.ac3

# Copy the raw x264 encoded video into an MP4 container so we can set
# the correct framerate (generally 23.976 - adjust it if MPlayer or
# MEncoder report something different)
MP4Box -add $1.x264 $1.mp4 -fps 23.976

# Finally, merge everything into a single MKV file
mkvmerge -o $1.mkv $1.mp4 --track-name 0:Eng $1.ac3

# Remove the hash in front of the next command to have the script delete
# your working files when encoding is complete.
# rm $1.m2ts $1.x264 $1.ac3

# Tell the user we're done.
echo "All done! Your final movie file is called $1.mkv - enjoy!"
</span></pre>
</li>
<li>Save and exit your text editor.<br />
.</li>
<li>Change directory to where you have your original .m2ts file, eg:
<pre><span style="color: #000080;">$ cd ~/Videos/BDRips/MyMovie</span></pre>
</li>
<li>Let&#8217;s say your movie file is called <em>TheIsland.m2ts</em>. To begin encoding it, you will use the following command:
<pre><span style="color: #000080;">$ sh ~/encodevideo.sh TheIsland</span></pre>
<p>(Notice that we don&#8217;t specify the file extension &#8211; the script assumes .m2ts on the end already)</li>
<li>Hit enter and the encoding process will begin. The script does the following in order:
<ol>
<li>Extract the video component only and encode it in a single pass to a raw x264 video file called <em>TheIsland.x264</em> (in this example).</li>
<li>When that has finished, go back and extract the first audio track only and save it to a file called <em>TheIsland.ac3</em> without any re-encoding.</li>
<li>When that has finished, take the raw x264 video data and put it into an MPEG4 container so we can fix the framerate at 23.976 frames per second, typical of most Blu-ray movies. If you don&#8217;t do this step, then the video will play faster than the audio in the final product.</li>
<li>Finally we create a new Matroska container called <em>TheIsland.mkv</em> and in it we place the framerate-adjusted MPEG4 video track and the unmodified audio track, producing our final product.</li>
</ol>
<p>.</li>
<li>When the script has finished some 9-12 hours later, you will have a file called <em>TheIsland.mkv</em> ready for playback in Totem, MPlayer, VLC, or whatever your favourite player is. You will notice that the filesize is significantly smaller than the original but when you play it back, the image quality will look pretty much 100% identical to the original. About the only compression artefacts you may notice is around the edges of some text titles such as opening credits, but you&#8217;d really have to look hard to spot them.<br />
.</li>
<li>We&#8217;ve finished with the working files now, so you can delete the .m2ts, .x264 and .ac3 files now to reclaim the disk space and enjoy your new .mkv file.<br />
.</li>
</ol>
<p>Enjoy! <img src='http://www.serenux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em><strong>NOTES:</strong></em></p>
<ul>
<li>While not covered by this HowTo (I&#8217;ll add to this later), you can optionally extract other audio tracks from the .m2ts file such as other languages or the commentary track, and add them to the .mkv file at any time. You can also download subtitles and add them to the .mkv file at a later date also, all without needing to re-encode the entire video again because all you&#8217;re doing is adding tracks to the existing Matroska container. see the man pages for the mkvmerge utility for more information.<br />
.</li>
</ul>
<ul>
<li>A high-definition x264-encoded movie takes a fairly reasonable amount of CPU power to decode. Since Ubuntu Intrepid and previous versions do not make any direct use of on-board video decoding hardware such as that found on NVidia and ATi based video cards, you may find certain busy scenes in your movie may stutter or even skip altogether during playback &#8211; this does NOT mean you are missing data from your movie file &#8211; it&#8217;s just that your PC is having trouble decoding AND displaying the movie all at once because the CPU is doing everything, especially those with slower CPU&#8217;s. Indeed you will notice that your CPU usage will probably be quite high in the 80-90% region. Ubuntu Jaunty will bring forth with it VDPAU support for NVidia-based video cards (restricted NVidia driver v180 and above). Using a patched version of MPlayer with VDPAU support, all the decoding work is passed completely to the video card, freeing up your CPU considerably to concentrate on other tasks, and dropping utilisation rates down to about 3%. This makes busy movies that much more watchable. If you can&#8217;t wait for Jaunty, there are some backported VDPAU modified versions of mencoder, mplayer and even MythTV available <a title="Backported VDPAU support for Ubuntu Intrepid and earlier." href="http://www.avenard.org/media/Home.html" target="_blank">here</a>, however you try them at your own risk. If you are an ATi video card user, you&#8217;re out in the dark for the moment. Go buy yourself an NVidia card &#8211; they are much better supported under Ubuntu than ATi are.<br />
.</li>
<li>If you are using only a dual-core processor, you should modify the <em>threads=4</em> section of the mencoder line in the script to read either <em>threads=2</em> or <em>threads=3</em>. If you are using a single-core processor, change this to <em>threads=1</em> or <em>threads=2</em> depending on how your CPU performs (and while you&#8217;re at it, seriously consider an upgrade!).<br />
.</li>
<li>If you wish to modify the quality of the encoded video to make the resulting file larger or smaller, re-edit the <em>encodevideo.sh</em> script and change the <em>crf=21</em> value in the mencoder line to a different value. There is no definitive filesize that the resulting encode will have. This value simply adjusts the <em>quality</em> of the encode. With some trial and error, I have found that the average 1080p movie encode ends up roughly 8GB in size when using a value of 21 and provides excellent image quality. If you make the value larger, this will apply greater compression and will reduce the final file size at the expense of losing some image quality. If you reduce the value, then your final file size will increase, however your image quality will also go up. As a guide, animated movies such as those made by Pixar and Dreamworks and visually dark movies such as Underworld, compress <em>very</em> well. In one instance, the final product was only 3.5GB in size. Visually complex movies such as Transformers blew out to 12GB in size using the same encoding script, so you can see that there is no exact science to this. There are mencoder options to specifically set bitrate and target filesize, but I chose to ignore those options for this HowTo as I&#8217;m a bit of a quality freak, not a size freak. I store all my movies on a MythTV server at home and backup to an external drive as I&#8217;m not a fan of doubling up my movie purchases on the shelf with a second disc containing the compressed version of the same movie!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/02/howto-encode-a-blu-ray-rip-into-a-smaller-format-without-losing-quality/feed/</wfw:commentRss>
		<slash:comments>39</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>
		<item>
		<title>HowTo: Eliminate the Green Bar on video playback in Totem (and other media players)</title>
		<link>http://www.serenux.com/2008/12/howto-eliminate-the-green-bar-on-video-playback-in-totem-and-other-media-players/</link>
		<comments>http://www.serenux.com/2008/12/howto-eliminate-the-green-bar-on-video-playback-in-totem-and-other-media-players/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 23:01:48 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[GStreamer]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Totem]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=256</guid>
		<description><![CDATA[Some people, including myself, have experienced an annoying issue whereby some videos you playback, particularly those encoded with the Xvid codec, have an apparent corruption of video represented by a thick Green Bar(TM) somewhere on the image. Generally the colours are askew as well and sometimes sections of the image are blurred. You might assume [...]]]></description>
			<content:encoded><![CDATA[<p>Some people, including myself, have experienced an annoying issue whereby some videos you playback, particularly those encoded with the Xvid codec, have an apparent corruption of video represented by a thick Green Bar(TM) somewhere on the image. Generally the colours are askew as well and sometimes sections of the image are blurred. You might assume that the original video is corrupt in some way, but this is not the case as the video will typically run fine through media players on other platforms.</p>
<p><span id="more-256"></span>The Green Bar(TM) and general video corruption looks similar to this:</p>
<p><img class="aligncenter size-full wp-image-260" title="Totem featuring the Green Bar(TM)" src="http://www.serenux.com/wp-content/uploads/2008/12/totem_greenbar.jpg" alt="Totem featuring the Green Bar(TM)" width="502" height="355" /></p>
<p>The issue is that the XVideo extension of X Windows (aka <em>Xv</em>) is having trouble dealing with the decoded video data when using your video card to scale the video to fit the window. There is a fix, however, at a minor cost of some CPU time &#8211; instead of getting your video card to do the scaling, get the CPU to do it instead.</p>
<ol>
<li>Press ALT+F2 to bring up the Run Application dialog (or just open a terminal) and type in <em>gstreamer-properties</em> and hit Enter.
<p><img class="aligncenter size-full wp-image-259" title="Run the GStreamer Properties app" src="http://www.serenux.com/wp-content/uploads/2008/12/gstreamersettings_runapp.jpg" alt="Run the GStreamer Properties app" width="580" height="188" />.</li>
<li>You will be presented with the GStreamer properties app. Click on the <em>Video</em> tab and you will see the following:
<p><img class="aligncenter size-full wp-image-262" title="GStreamer's default settings" src="http://www.serenux.com/wp-content/uploads/2008/12/gstreamersettings_default.jpg" alt="GStreamer's default settings" width="418" height="436" />.</li>
<li>Change the <strong>Default Output Plugin</strong> from <em>Autodetect</em> to <em>X Window System (No Xv)</em> and then close the application.
<p><img class="aligncenter size-full wp-image-258" title="Modify the GStreamer settings to &quot;NoXV&quot;" src="http://www.serenux.com/wp-content/uploads/2008/12/gstreamersettings_noxv.jpg" alt="Modify the GStreamer settings to &quot;NoXV&quot;" width="418" height="436" />.</li>
<li>Now re-run your video file through Totem and the Green Bar(TM) should now be gone. Scaling of the video to fit the window is now being done by the CPU. The impact should be negligible. Should you experience playback slowdown with other videos that never had the Green Bar(TM) issue previously, you should go back into GStreamer&#8217;s properties and re-enable Xv as required.
<p><img class="aligncenter size-full wp-image-261" title="Totem no longer featuring the Green Bar(TM)" src="http://www.serenux.com/wp-content/uploads/2008/12/totem_greenbar_fixed.jpg" alt="Totem no longer featuring the Green Bar(TM)" width="502" height="355" />.</li>
<li>Retrieve popcorn and enjoy movie.</li>
</ol>
<div class='wp_likes' id='wp_likes_post-256'><a class='like' href="javascript:wp_likes.like(256);" 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(256);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2008/12/howto-eliminate-the-green-bar-on-video-playback-in-totem-and-other-media-players/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: Create your own subtitles to display on video in Totem</title>
		<link>http://www.serenux.com/2008/11/howto-create-your-own-subtitles-to-display-on-video-in-totem/</link>
		<comments>http://www.serenux.com/2008/11/howto-create-your-own-subtitles-to-display-on-video-in-totem/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 03:11:45 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Subtitles]]></category>
		<category><![CDATA[Totem]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=155</guid>
		<description><![CDATA[Subtitles &#8211; a simple, but effective means of communication for speakers of non native languages and the hard-of-hearing. We see subtitles in DVD&#8217;s and on TV in various forms. It would be good to utilise subtitles for a home video that you have encoded to give to your parents or grandparents, both of whom are [...]]]></description>
			<content:encoded><![CDATA[<p>Subtitles &#8211; a simple, but effective means of communication for speakers of non native languages and the hard-of-hearing. We see subtitles in DVD&#8217;s and on TV in various forms.</p>
<p>It would be good to utilise subtitles for a home video that you have encoded to give to your parents or grandparents, both of whom are a little hard-of-hearing, but it&#8217;s an effort to add subtitles to a video, encode it again and it will ultimately bother those people who don&#8217;t need to view the subtitles.</p>
<p>You don&#8217;t have to encode the subtitles as part of the physical video, however. Most media players, including Ubuntu&#8217;s Totem have the ability to overlay subtitles on top of the video being played back. This allows you to create your own custom subtitles and be able to modify them as required without any need to re-encode the video.</p>
<p><span id="more-155"></span></p>
<p>So how do you create subtitles? Well, first up you need a transcript of the video you are subtitling. In this example, I&#8217;m going to use an old news story I have recorded from TV. The file is called GasLeak.mpg and is located in my ~/videos directory. To subtitle it, you need to create a text file with the same name as the video in the same directory, thus:</p>
<pre><span style="color: #000080;">gedit ~/videos/GasLeak.srt</span></pre>
<p>(note the .srt extension replaces the .mpg extension. This marks it as a subtitle file)</p>
<p>Your text editor will now appear with a clean slate. Move this window aside, but don&#8217;t close it.</p>
<p>Now fire up your video in Totem and let it play. As people speak, type what they say into GEdit. Use one line per sentence, thus in my case:</p>
<pre><span style="color: #000080;">Help at last for victims of the HIH collapse.
A gas leak brings a section of the city to a standstill.
And angry protests as our new Catholic Archbishop takes the reigns.</span></pre>
<p>&#8230;etc. Do this for the entire video. You may have to pause and rewind the video several times to keep up with transcribing.</p>
<p>Once you have the raw text down, now it&#8217;s time to format it so that Totem recognises it and knows when to display each line.</p>
<p>Each subtitle has to have a sequential number to identify it, plus a start and end time to display as follows:</p>
<pre><span style="color: #000080;">1
00:00:10,000 --&gt; 00:00:14,000
Help at last for victims of the HIH collapse.

2
00:00:14,000 --&gt; 00:00:18,000
A gas leak brings a section of the city to a standstill.

3
00:00:18,000 --&gt; 00:00:23,000
And angry protests as our new Catholic Archbishop takes the reigns.</span></pre>
<p>So above we have three subtitles numbered 1 through 3. After each number, we have the time period that each subtitle will appear for. The left-most numbers are the start-time for the subtitle in the form of HH:MM:SS,FFF (where HH is hours, MM is minutes, SS is seconds and FFF is hundredths of one second between 000 and 999), and the right-most numbers is the finish time for the subtitle in the same format.</p>
<p>The time given is the time of the video stream itself, so if you have an hour-long video, your subtitles will sequentially count in from from 00:00:00,000 all the way through to 01:00:00,000. In the above example, the first subtitle will appear 10 seconds into the video and will disappear at the 14 second mark (thus making the subtitle appear for a total of four seconds).</p>
<p>The second subtitle appears immediately after the first at 14 seconds and disappears at 18 seconds, and the third subtitle appears at 18 seconds and disappears at 23 seconds.</p>
<p>Save the file and fire up your video in Totem to see how what you&#8217;ve done so far looks.</p>
<div id="attachment_156" class="wp-caption alignnone" style="width: 160px"><a href="http://www.serenux.com/wp-content/uploads/2008/11/subtitlenoformat.jpg"><img class="size-thumbnail wp-image-156" title="Subtitle example with no formatting" src="http://www.serenux.com/wp-content/uploads/2008/11/subtitlenoformat.jpg" alt="Our simple subtitle in all its glory" width="150" height="138" /></a><p class="wp-caption-text">Our simple subtitle in all its glory</p></div>
<p>If you cannot see the subtitles, it is possible that the feature is not enabled &#8211; go to Edit-&gt;Preferences and make sure the &#8220;Automatically load subtitle files when movie is loaded&#8221; at the middle-bottom of the window is checked in the General tab, then close Totem and re-open your movie.</p>
<div id="attachment_161" class="wp-caption alignnone" style="width: 148px"><a href="http://www.serenux.com/wp-content/uploads/2008/11/totemsubtitleprefs.jpg"><img class="size-thumbnail wp-image-161" title="Totem Preferences - Subtitles" src="http://www.serenux.com/wp-content/uploads/2008/11/totemsubtitleprefs.jpg" alt="Totem Preferences showing Subtitle display options" width="138" height="150" /></a><p class="wp-caption-text">Totem Preferences showing Subtitle display options</p></div>
<p>Great! We now have working subtitles, but the timing is out. This is where you have to fine-tune the timings to the video and will require you to watch the video again, keeping an eye on the timer as you go. Just jot down the approximate whole seconds for when each subtitle should appear and go back and update the subtitle file accordingly.</p>
<p>Save and re-open your video. To further fine-tune the appearance of the subtitles, you can now edit the hundredths-of-a-second value to allow subtitles to appear at half a second instead of the whole second, etc. In my case, my tuned subtitle file now looks like:</p>
<pre><span style="color: #000080;">1
</span><span style="color: #000080;">00:00:10,500 --&gt; 00:00:14,000</span><span style="color: #000080;">
Help at last for victims of the HIH collapse.

2
00:00:14,500 --&gt; 00:00:18,000
A gas leak brings a section of the city to a standstill.

3
00:00:18,400 --&gt; 00:00:23,000
And angry protests as our new Catholic Archbishop takes the reigns.</span></pre>
<p>I tweaked the first subtitle to appear at 10.5 seconds, terminating at 14 seconds. The second title appears at 14.5 seconds and finishes at 18 seconds, and the third subtitle appears at almost 18.5 seconds and finishes at 23 seconds.</p>
<p>It may take some time, but once done, you will have a perfectly subtitled home video.</p>
<p>But wait, there&#8217;s more! You can enhance the subtitles a bit with italic and underline tags!</p>
<p>By enclosing your subtitle text in &lt;i&gt; and &lt;/i&gt; for italics and &lt;u&gt; and &lt;/u&gt; for underline, you can format the text a bit to highlight aspects of it, for example italics are generally used to subtitle a voice off-camera such as a narrator. As an example:</p>
<pre><span style="color: #000080;">1
</span><span style="color: #000080;">00:00:10,500 --&gt; 00:00:14,000</span><span style="color: #000080;">
&lt;i&gt;Help &lt;u&gt;at last&lt;/u&gt; for victims of the HIH collapse.&lt;/i&gt;
</span></pre>
<p><span style="color: #000000;">Which will italicise the entire subtitle, and underline just the words &#8220;at last&#8221;.</span></p>
<div id="attachment_159" class="wp-caption alignnone" style="width: 160px"><a href="http://www.serenux.com/wp-content/uploads/2008/11/medressubtitle.jpg"><img class="size-thumbnail wp-image-159" title="Subtitles on a 384x288 size video" src="http://www.serenux.com/wp-content/uploads/2008/11/medressubtitle.jpg" alt="Formatted subtitle with italic and underline" width="150" height="138" /></a><p class="wp-caption-text">Formatted subtitle with italic and underline</p></div>
<p>Now this is all well and good, but the subtitles still look kinda small. Can we make them bigger? Well, the actual font size is determined by Totem&#8217;s font size setting under Edit-&gt;Preferences-&gt;General (by default it&#8217;s 20 points), but generally the resolution of the source video will ultimately govern how that font physically appears. Here&#8217;s an example of the same video clip in low, medium and high resolutions using the same subtitle file:</p>
<div class="mceTemp">
<table border="0">
<tbody>
<tr>
<td>
<div id="attachment_158" class="wp-caption alignnone" style="width: 160px"><a href="http://www.serenux.com/wp-content/uploads/2008/11/lowressubtitle.jpg"><img class="size-thumbnail wp-image-158" title="Subtitles on a 192x144 size video" src="http://www.serenux.com/wp-content/uploads/2008/11/lowressubtitle.jpg" alt="Subtitles on a 192x144 size video" width="150" height="138" /></a><p class="wp-caption-text">Subtitles on a 192x144 size video</p></div></td>
<td>
<p><div id="attachment_159" class="wp-caption alignnone" style="width: 160px"><a href="http://www.serenux.com/wp-content/uploads/2008/11/medressubtitle.jpg"><img class="size-thumbnail wp-image-159" title="Subtitles on a 384x288 size video" src="http://www.serenux.com/wp-content/uploads/2008/11/medressubtitle.jpg" alt="Subtitles on a 384x288 size video" width="150" height="138" /></a><p class="wp-caption-text">Subtitles on a 384x288 size video</p></div></td>
<td>
<p><div id="attachment_157" class="wp-caption alignnone" style="width: 160px"><a href="http://www.serenux.com/wp-content/uploads/2008/11/dvdressubtitle.jpg"><img class="size-thumbnail wp-image-157" title="Subtitles on a 720x576 size video" src="http://www.serenux.com/wp-content/uploads/2008/11/dvdressubtitle.jpg" alt="Subtitles on a 720x576 size video" width="150" height="138" /></a><p class="wp-caption-text">Subtitles on a 720x576 size video</p></div></td>
</tr>
</tbody>
</table>
</div>
<p>As you&#8217;ve already noticed, Totem will word-wrap long subtitles, but sometimes this can result in orphaned words. You can make your subtitles even more readable by breaking them up into multiple lines, eg:</p>
<pre><span style="color: #000080;">1
</span><span style="color: #000080;">00:00:10,500 --&gt; 00:00:14,000</span><span style="color: #000080;">
&lt;i&gt;Help &lt;u&gt;at last&lt;/u&gt; for
 victims of the HIH collapse.&lt;/i&gt;</span></pre>
<p>Will make the subtitle appear as follows:</p>
<p><div id="attachment_160" class="wp-caption alignnone" style="width: 160px"><a href="http://www.serenux.com/wp-content/uploads/2008/11/subtitlemultiline.jpg"><img class="size-thumbnail wp-image-160" title="Subtitle broken into multiple lines" src="http://www.serenux.com/wp-content/uploads/2008/11/subtitlemultiline.jpg" alt="Subtitle broken into multiple lines" width="150" height="143" /></a><p class="wp-caption-text">Subtitle broken into multiple lines</p></div>
<p>&#8230;which looks much nicer.</p>
<p>That&#8217;s basically it! Now when you email/post the video to your folks, make sure the .srt file accompanies it in the same directory and Totem will automagically open it and utilise the subtitles. Should you want to turn the subtitles off without deleting the .srt file, simply go to View-&gt;Subtitles-&gt;None while the video is playing in Totem.</p>
<div class='wp_likes' id='wp_likes_post-155'><a class='like' href="javascript:wp_likes.like(155);" 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(155);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2008/11/howto-create-your-own-subtitles-to-display-on-video-in-totem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
