<?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>Penguin Dreams &#187; nvidia</title>
	<atom:link href="http://penguindreams.org/tag/nvidia/feed/" rel="self" type="application/rss+xml" />
	<link>http://penguindreams.org</link>
	<description></description>
	<lastBuildDate>Thu, 24 Jun 2010 19:50:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>nVidia&#8217;s Hardware H.264 (1080p) codec for Linux</title>
		<link>http://penguindreams.org/blog/nvidias-hardware-h264-1080p-codec-in-linux/</link>
		<comments>http://penguindreams.org/blog/nvidias-hardware-h264-1080p-codec-in-linux/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 19:25:32 +0000</pubDate>
		<dc:creator>sumdog</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[1080p]]></category>
		<category><![CDATA[hd]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[vdpau]]></category>

		<guid isPermaLink="false">http://penguindreams.org/?p=201</guid>
		<description><![CDATA[I spent a couple of hours getting a proprietary software H.264 codec working in Linux and even published a writeup to help others. A day later I learned from one of the people I sourced in my article that nVidia started releasing Linux drivers last November for the hardware high definition decoders found on the [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a couple of hours getting a proprietary software <span class="caps">H.264 </span>codec working in Linux and even published a <a href="/blog/1080-video-in-linux-with-coreavc/">writeup</a> to help others. A day later I learned from one of the people I sourced in my article that nVidia started releasing Linux drivers last November for the hardware high definition decoders found on the 8xxx series of video cards as well as a customized version of mplayer to support the new drivers. </p>

<p>A mixture of emotions came across as I realized I wasted an entire day on a software decoder when a hardware solution was available for $30 to $40. The software solution was fairly disappointing, so I decided to try one of these new cards, an nVidia GeForce 8500 <span class="caps">GT, </span>to see if it provided a better solution. It took some work with my setup, but the results were worth it.  </p>

<p><span id="more-201"></span></p>

<p>The new interface from nVidia for hardware video decoding on Linux is known as the <em>Video Decode and Presentation <span class="caps">API </span>for <span class="caps">UNIX</span></em> or <span class="caps">VDPAU.</span> It&#8217;s been available officially since the release of the 180.22 nVidia Linux drivers in January of 2009, but has been available in beta drives since last November starting with 180.06. Drivers which support <span class="caps">VDPAU </span>will install special header files in <code>/usr/include/vdpau/</code> which are required to compile media players with <span class="caps">VDPAU </span>support.</p>

<p>The installation process is fairly straightforward. The patches for mplayer can be found on the <a href="ftp://download.nvidia.com/XFree86/vdpau/">nVidia <span class="caps">FTP </span>site</a>. The tarball contains not only the patch sets, but also a build script named <code>checkout-patch-build.sh</code>. As the name suggestes, the script checks out all the appropriate revisions of mplayer and its dependencies (libavcodec, libdvdread, etc) from a subversion repository, applies nVidia specific patches and compiles mplayer. The <code>README.txt</code> file in the package also suggests several free sample videos that can be used to test the new mplayer build.</p>

<p>To prevent conflicts with the copy of mplayer that may come with the Linux distribution and that is typically controlled by a package manager, I suggest manually installing the <span class="caps">VDPAU </span>version of mplayer by itself with its own name. The following are the commands I ran for both compiling and installation. Be sure to replace the tarball with the latest version available on the <a href="ftp://download.nvidia.com/XFree86/vdpau/">ftp site</a>.</p>



<pre class="sh_sourceCode sh_sh">
wget ftp://download.nvidia.com/XFree86/vdpau/mplayer-vdpau-3402051.tar.bz2
tar xvfj mplayer-vdpau-3402051.tar.bz2
cd mplayer-vdpau-3402051
./checkout-patch-build.sh
su 
cp ./mplayer /usr/local/bin/mplayer-vdpau
</pre>



<p>As stated earlier, the <code>README.txt</code> providers several sample files available to download to test out the decoder. I&#8217;d also suggest the following options when playing <span class="caps">H.264 </span>files:</p>



<pre class="sh_sourceCode sh_sh">
mplayer-vdpau -vo vdpau -vc ffh264vdpau -framedrop -nocorrect-pts &lt;filename&gt;
</pre>



<p>Both the <code>-framedrop</code> and <code>-nocorrect-pts</code> will help provider for smoother playback and may be helpful on older <span class="caps">CPU</span>s. On machines that can handle the playback, they shouldn&#8217;t degrade the video quality.</p>

<p>You may get an error such as the following along with no video window being displayed: </p>



<pre class="sh_sourceCode sh_sh">
Cannot find codec matching selected -vo and video format 0x31637661
</pre>



<p>This is most likely the result of having a <code>~/.mplayer/codecs.conf</code>. Current versions of mplayer do not require a <code>codecs.conf</code> as one is compiled into the player itself. A stray configuration file will override the built-in defaults and remove the nVidia provided codecs. You may see this error if you had followed my <a href="http://penguindreams.org/blog/1080-video-in-linux-with-coreavc/">previous tutorial</a> on implementing software <span class="caps">H.264 </span>decoding.</p>

<p>Fixing this issue involves either deleting the file, renaming the file or combining the <code>codecs.conf</code> in your home directory with the patched one located in nVidia&#8217;s <code>mplayer-vdpau</code> build directory.</p>

<p>Another issue can arise if you have a multi-seat system; that is a system with multiple X servers each with their own monitor, keyboard and mouse configuration. In such an environment, it is essential that the X server you want to use the <span class="caps">VDPAU </span>card with comes up first. The video card does not need to be in the first <span class="caps">PCI</span>-E slot. Mine resides in the second:</p>



<pre class="sh_sourceCode sh_sh">
 # lspci | grep nVidia
01:00.0 VGA compatible controller: nVidia Corporation NV42 [GeForce 6800 XT] (rev a2)
02:00.0 VGA compatible controller: nVidia Corporation GeForce 8500 GT (rev a1)
</pre>



<p>However in the greeter configuration file, the server that holds the GeForce 8500 card I want to use for decoding must be listed first. In my case, I use gdm on Gentoo Linux which uses <code>/etc/X11/gdm/custom.conf</code> to define server startup:</p>



<pre class="sh_sourceCode">
[servers]
0=Plasma
1=Console

[server-Plasma]
name=Plasma server
command=/usr/X11R6/bin/X -layout Plasma -novtswitch -sharevts -isolateDevice PCI:2:0:0
flexiable=true

[server-Console]
name=Console server
command=/usr/X11R6/bin/X  -layout Console -novtswitch -sharevts -isolateDevice PCI:1:0:0
flexiable=true
</pre>



<p>When I got the <span class="caps">VDPAU </span>mplayer up and running, I was very impressed by the results. Some video still jumped and sputtered in placed, but nothing too distracting from the video considering the high bitrates and quality. There was also occasional screen tearing where one frame partially overlapped a previous one. I&#8217;ve read turning off the X composite extension may help alleviate this problem although I haven&#8217;t tried this yet. </p>

<p>I&#8217;m glad nVidia is realizing the importance of capitalizing on the Linux market. <span class="caps">ATI </span>is trying to catch up with their own <a href="http://blog.mymediasystem.net/avchd/radeon-hd-video-driver/">RadeonHD</a> drivers. Linux support will be essential as it&#8217;s an ideal platform for embedded systems such as <a href="http://www.nvidia.com/object/sff_ion.html">nVidia&#8217;s Ion</a>. It could open up an entire realm of possibilities for small, affordable, set-top box and media PC solutions. </p>]]></content:encoded>
			<wfw:commentRss>http://penguindreams.org/blog/nvidias-hardware-h264-1080p-codec-in-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
