<?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>SpinOneSolutions &#187; Video</title>
	<atom:link href="http://www.spinonesolutions.com/tag/video/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.spinonesolutions.com</link>
	<description>I waste my time so that you don't have to...</description>
	<lastBuildDate>Mon, 16 May 2011 17:01:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PS3 H264/AAC 5.1 Encoding with FFmpeg</title>
		<link>http://www.spinonesolutions.com/2010/04/ps3-h264aac-5-1-encoding-with-ffmpeg/</link>
		<comments>http://www.spinonesolutions.com/2010/04/ps3-h264aac-5-1-encoding-with-ffmpeg/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 17:00:06 +0000</pubDate>
		<dc:creator>Will Wright</dc:creator>
				<category><![CDATA[Audio/Video]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[PS3]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.spinonesolutions.com/?p=434</guid>
		<description><![CDATA[The Problem: You want to encode video for playback on a PS3 using FFmpeg. The Solution: I&#8217;ve got a working command line option for you right here.  This is a solution, not the only solution. My Setup: Ubuntu 9.10 (Karmic) libx264 (for encoding H264) libfaac (for encoding AAC) mkvtoolnix ffmpeg fuppes I&#8217;m also going to [...]]]></description>
			<content:encoded><![CDATA[<h3>The Problem:</h3>
<p>You want to encode video for playback on a PS3 using FFmpeg.</p>
<h3>The Solution:</h3>
<p>I&#8217;ve got a working command line option for you right here.  This is <em>a</em> solution, not the <em>only</em> solution.</p>
<p>My Setup:<br />
Ubuntu 9.10 (Karmic)<br />
libx264 (for encoding H264)<br />
libfaac (for encoding AAC)<br />
mkvtoolnix<br />
ffmpeg<br />
fuppes</p>
<p>I&#8217;m also going to assume that your input file is a .mkv containing an H264 video track and an AC-3 audio track.  Most of the time this is fair assumption however, it won&#8217;t be correct 100% of the time.</p>
<p>To start, you&#8217;re going to need a current build of FFmpeg. It&#8217;s been a while since I did the build but I <em>think</em> these were my configuration options.</p>
<pre class="xml" name="code">#cd ~/ffmpeg #make distclean
#svn update #sudo ./configure \
--enable-gpl \
--enable-nonfree \
--enable-postproc \
--enable-pthreads \
--enable-x11grab \
--enable-runtime-cpudetect \
--enable-libdc1394 \
--enable-libfaac \
--enable-libfaad \
--enable-libgsm \
--enable-libmp3lame \
--enable-libtheora \
--enable-libvorbis \
--enable-libx264 \
--enable-libxvid \
--arch=x86_64
#make #sudo checkinstall \
--ftrans=no \
--install=yes \
--pkgname=ffmpeg \
--pkversion "4:0.5.svn'date + %Y%m%d'-12ubuntu3" \
--default</pre>
<p>On to what you REALLY wanted to know, here&#8217;s my command sequence.</p>
<pre class="xml" name="code">#mkvextract tracks {input-file}.mkv 1:video.h264
#mkvextract tracks {input-file}.mkv 2:audio.ac3
#ffmpeg -i video.h264 -i audio.ac3 \
-vcodec copy \
-acodec libfaac -ab 320k -ac 6 \
-threads 0 -f mp4 \
{output-file-name}.mp4</pre>
<p>Let&#8217;s break it down line by line so that you can modify it to your needs:<br />
<strong>mkvextract tracks {input-file}.mkv 1:video.h264</strong></p>
<p>Extract track 1 to &#8220;video.h264&#8243;</p>
<p><strong><strong>mkvextract tracks {input-file}.mkv 2:audio.ac3</strong></strong></p>
<p>Extract track 2 to &#8220;audio.ac3&#8243;</p>
<p><strong>ffmpeg -i video.h264 -i audio.ac3</strong></p>
<p>Input video.h264<br />
Input audio.ac3</p>
<p><strong>-vcodec copy</strong></p>
<p>Copy the video track as is.</p>
<p><strong>-acodec libfaac -ab 320k -ac 6</strong></p>
<p>Transform audio track to AAC using libfaac<br />
Set Audio Bitrate to 320k<br />
Set Audio Channels to 6 (5.1)</p>
<p><strong>-threads 0 -f mp4</strong></p>
<p>Let ffmpeg decide how many threads to use<br />
Set the container format to mp4</p>
<p><strong>{output-file-name}.mp4</strong></p>
<p>Output the file as specified</p>
<p>Checkout the ffmpeg <a title="ffmpeg documentation" href="http://ffmpeg.org/ffmpeg-doc.html">documentation</a> for more information about general options.</p>
<p>I donno about you, but I got tired of typing out three commands for every file I wanted to encode, plus all those options&#8230; forget about it!  So I wrote a stupid little shell script to do it for me.</p>
<p>You can download it here: <a href="http://www.spinonesolutions.com/wp-content/uploads/2010/04/ps3encode.gz">ps3encode</a>.  Just plop it somewhere in your filesystem and then make sure it&#8217;s included in your PATH variable and that it has execute permissions.</p>
<p>Usage:</p>
<pre class="xml" name="code">#ps3encode {input-file}.mkv {output-file}.mp4</pre>
<p class="xml">Questions and comments welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spinonesolutions.com/2010/04/ps3-h264aac-5-1-encoding-with-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

