<?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>robert.swain &#187; ffmpeg</title>
	<atom:link href="http://rob.opendot.cl/index.php/category/ffmpeg/feed/" rel="self" type="application/rss+xml" />
	<link>http://rob.opendot.cl</link>
	<description>stuff about me, what i do and some other hopefully useful stuff</description>
	<lastBuildDate>Mon, 06 Sep 2010 06:35:09 +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>Summer of Code 2010 brings a floating point AMR-WB decoder to FFmpeg</title>
		<link>http://rob.opendot.cl/index.php/2010/09/06/summer-of-code-2010-brings-a-floating-point-amr-wb-decoder-to-ffmpeg/</link>
		<comments>http://rob.opendot.cl/index.php/2010/09/06/summer-of-code-2010-brings-a-floating-point-amr-wb-decoder-to-ffmpeg/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 06:35:09 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[AMR]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[google summer of code]]></category>
		<category><![CDATA[multimedia]]></category>

		<guid isPermaLink="false">http://rob.opendot.cl/?p=249</guid>
		<description><![CDATA[Marcelo Galvão Póvoa has been working hard all summer on a floating point AMR-WB decoder for FFmpeg, needing only a little guidance from me. It is currently in the review stages but is producing very good results that are close  &#8230; <a href="http://rob.opendot.cl/index.php/2010/09/06/summer-of-code-2010-brings-a-floating-point-amr-wb-decoder-to-ffmpeg/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Marcelo Galvão Póvoa has been working hard all summer on a floating point AMR-WB decoder for FFmpeg, needing only a little guidance from me. It is currently in the review stages but is producing very good results that are close to the reference decoder! And this is despite the fact that Google run the Summer of Code during a time when Marcelo is studying throughout. Excellent work. <img src='http://rob.opendot.cl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rob.opendot.cl/index.php/2010/09/06/summer-of-code-2010-brings-a-floating-point-amr-wb-decoder-to-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FFmpeg Google Summer of Code 2010</title>
		<link>http://rob.opendot.cl/index.php/2010/04/06/ffmpeg-google-summer-of-code-2010/</link>
		<comments>http://rob.opendot.cl/index.php/2010/04/06/ffmpeg-google-summer-of-code-2010/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 13:57:35 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[google summer of code]]></category>
		<category><![CDATA[multimedia]]></category>

		<guid isPermaLink="false">http://rob.opendot.cl/?p=231</guid>
		<description><![CDATA[Are you interested in multimedia software development such as codecs, containers and protocols? Do you have experience coding in C? Are you a student? If yes, apply to work on a Summer of Code task for FFmpeg this summer! The  &#8230; <a href="http://rob.opendot.cl/index.php/2010/04/06/ffmpeg-google-summer-of-code-2010/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Are you interested in multimedia software development such as codecs, containers and protocols? Do you have experience coding in C? Are you a student? If yes, apply to work on a Summer of Code task for FFmpeg this summer! The deadline is <strong>the 9th of April!</strong> So act fast!</p>
<p>We will require a qualification task as well that must be completed by about the 19th of April at the latest, you can <a href="http://socghop.appspot.com/gsoc/org/show/google/gsoc2010/ffmpeg">find all the details here</a>. Good luck! <img src='http://rob.opendot.cl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rob.opendot.cl/index.php/2010/04/06/ffmpeg-google-summer-of-code-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A wedding, OpenKvarken, ffmpeg-mt, Collabora</title>
		<link>http://rob.opendot.cl/index.php/2009/10/13/a-wedding-openkvarken-ffmpeg-mt-collabora/</link>
		<comments>http://rob.opendot.cl/index.php/2009/10/13/a-wedding-openkvarken-ffmpeg-mt-collabora/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 18:34:41 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[AAC]]></category>
		<category><![CDATA[Collabora]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://rob.opendot.cl/?p=207</guid>
		<description><![CDATA[Well, I&#8217;ve been quite busy over the past months, despite my lack of blog posts.
My brother got married.
FFmpeg finally has channel layout support for AAC and Vorbis. I&#8217;ve published my work-in-progress HE AAC v1 (Spectral Band Replication) code in FFmpeg&#8217;s  &#8230; <a href="http://rob.opendot.cl/index.php/2009/10/13/a-wedding-openkvarken-ffmpeg-mt-collabora/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Well, I&#8217;ve been quite busy over the past months, despite my lack of blog posts.</p>
<p>My brother got married.</p>
<p>FFmpeg finally has channel layout support for AAC and Vorbis. I&#8217;ve published my work-in-progress HE AAC v1 (Spectral Band Replication) code in FFmpeg&#8217;s Summer of Code repository (though it has nothing to do with Google SoC).</p>
<p>A collaboration focused on open source software between two universities in <a href="http://ucoss.se/">Umeå, Sweden</a> and <a href="http://vcoss.fi/">Vaasa, Finland</a> called <a href="http://openkvarken.fi/">OpenKvarken</a> held a <a href="http://openkvarken.fi/?q=content/seminar-5">seminar</a> about VoIP and related technologies. I did two talks there titled: <em>An Open Standard IPTV Implementation in MythTV</em> and <em>Improving FFmpeg for High Definition Video Conferencing</em>.</p>
<p>The latter refers to <a href="http://gitorious.org/ffmpeg/ffmpeg-mt">ffmpeg-mt</a> &#8211; multi-threaded decoding for macroblock-based codecs as developed by Alexander Strange. OpenKvarken should be funding the merge of this code into FFmpeg trunk.</p>
<p>I should be getting a new job with <a href="http://www.collabora.co.uk/">Collabora</a> working to improve the quality of open source multimedia on the whole. It&#8217;s a very exciting venture for me and it may lead to more regular blog posts. <img src='http://rob.opendot.cl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rob.opendot.cl/index.php/2009/10/13/a-wedding-openkvarken-ffmpeg-mt-collabora/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chrome and Theora/H.264</title>
		<link>http://rob.opendot.cl/index.php/2009/06/16/chrome-and-theorah-264/</link>
		<comments>http://rob.opendot.cl/index.php/2009/06/16/chrome-and-theorah-264/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 09:28:46 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[opinions]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[x264]]></category>

		<guid isPermaLink="false">http://rob.opendot.cl/?p=198</guid>
		<description><![CDATA[There&#8217;s been a lot of noise recently about Google Chrome shipping with H.264 decoder support. They&#8217;re actually using FFmpeg for this and a few other things. &#60;disclaimer&#62;These comments on my blog do not necessarily represent the views of all FFmpeg  &#8230; <a href="http://rob.opendot.cl/index.php/2009/06/16/chrome-and-theorah-264/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been a lot of noise recently about Google Chrome shipping with H.264 decoder support. They&#8217;re actually using FFmpeg for this and a few other things. &lt;disclaimer&gt;These comments on my blog do not necessarily represent the views of all FFmpeg project members.&lt;/disclaimer&gt; Personally, I&#8217;m glad they&#8217;re shipping with H.264 support.</p>
<p>Theora was obsolete when it was published and its authors (Monty from Xiph) agreed with this. The encoder implementations are crap, though getting better and, the most annoying noise for me coming from the outside world is that Theora is as good as or better than H.264. <strong>Theora is NOT as good as or better than H.264!</strong> Specification-wise, Theora cannot compete with H.264. Implementation-wise, in terms of FOSS, Theora (current or Thusnelda) does not compete with x264. There are no non-FOSS Theora implementations and x264 is one of the best H.264 encoders in the world and has few rivals.</p>
<p>I&#8217;m all for digital media that is free (in all senses) to create, distribute and consume. I don&#8217;t think Theora is the answer.</p>
]]></content:encoded>
			<wfw:commentRss>http://rob.opendot.cl/index.php/2009/06/16/chrome-and-theorah-264/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bit rate, file size, quality misunderstandings</title>
		<link>http://rob.opendot.cl/index.php/2009/05/01/bit-rate-file-size-quality-misunderstandings/</link>
		<comments>http://rob.opendot.cl/index.php/2009/05/01/bit-rate-file-size-quality-misunderstandings/#comments</comments>
		<pubDate>Fri, 01 May 2009 15:14:30 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[x264]]></category>

		<guid isPermaLink="false">http://rob.opendot.cl/?p=164</guid>
		<description><![CDATA[It seems quite a few people have been confusing how bit rate, file size and quality are inter-related. A number of people have been using the -sameq option from the ffmpeg CLI and expecting it to output a file of  &#8230; <a href="http://rob.opendot.cl/index.php/2009/05/01/bit-rate-file-size-quality-misunderstandings/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It seems quite a few people have been confusing how bit rate, file size and quality are inter-related. A number of people have been using the <code>-sameq</code> option from the <code>ffmpeg</code> CLI and expecting it to output a file of the same size and quality as the original, but they observe it creates files that are much larger. So, what do the terms mean and what&#8217;s going on?</p>
<p>When specifying the <code>-b &lt;bit rate in bits per second&gt;</code> option to <code>ffmpeg</code>, one is requesting that the video encoder target the specified bit rate as an average over the entire video stream. If you have some audio or video file, playing it back takes some amount of time i.e. it has a duration. The file also has a size in bytes. The overall average bit rate is simply the number of bits per second averaged over the duration of the entire file. So:</p>
<p><code>overall average bit rate = file size in bytes * bits per byte / duration in seconds</code></p>
<p>It should be noted that the file may contain, for example, an audio stream and a video stream. So in fact we observe something more like:</p>
<p><code>overall average bit rate = average audio bit rate + average video bit rate + average overhead bit rate = file size in bytes * bits per byte / duration in seconds</code></p>
<p>The audio and video bit rates being constituents of the overall average should be clear, but what is this overhead? Metadata tags (like the artist, album and title of a music file) could contribute to this, but they are a fixed size regardless of the duration of the file.</p>
<p>The rest of the overhead, beyond metadata and header information about the streams within the file, consists of various information that is part of the container format the file is using. These are things to note where one section of data begins, the time at which it should be displayed/presented to the user and other bits and pieces of information. This normally does not contribute a large amount to the overall average bit rate, but it&#8217;s worth being aware of to avoid confusion later.</p>
<p>Bit rate need not be the overall average however. The term bit rate simply refers to an amount of data with a corresponding duration for transmission/playback or so.</p>
<p>So, now we know how the bit rate and file size (if producing a file) are related, but where does quality come into the equations? There are two main ways to affect the quality of, for example, a video that one wishes to encode.</p>
<p>Most video encoders have a plethora of options that affect this thing called &#8216;quality&#8217;. Quality is subjective and that makes it difficult to quantify. The options that are supposed to improve quality, usually make the encoding process slower. This leads to a speed/quality trade off. That is, you have to consider the relation between two questions:</p>
<ul>
<li>How long am I willing to wait to encode this file?</li>
<li>How good do I need the quality to be?</li>
</ul>
<p>Normally the answer to the second question is &#8220;as good as it can be&#8221; within the constraints of the answer to the first question. More simply, people want the best quality from whatever amount of encoding time they deem reasonable for their job.</p>
<p>The other way that one can affect the perceived quality of the resulting video is to affect the bit rate used to encode it. If you try to encode 1080p video at 200 kilobits per second, it will look awful no matter what encoder and options you use. If you try to encode 1080p video at 200 megabits per second, it will probably look good no matter what encoder and options you use.</p>
<p>How should one approach making the decisions about what encoding options to use? Normally bit rate/file size are the most major consideration, whether streaming with an upper bound on the bandwidth available when transmitting the stream or creating a file that needs to fit on a 700MB CD. This will impose your first constraint, unless you have some terabytes of storage and don&#8217;t really care about the size too much.</p>
<p>After that you need to consider how long you&#8217;re willing to wait to encode something as this will impact on the options you use with your encoder of choice to obtain the best quality within your more major constraints. If the quality is not good enough within your constraints, you may need more powerful hardware or to re-evaluate the available bandwidth/storage space.</p>
<p>Finally we come to the <code>-sameq</code> option in <code>ffmpeg</code>. There are a number of different ways to control how the bits are allocated throughout the video. Normally one wants to observe constant quality throughout a video stream. If some frames are good and some bad, it is actually more noticeable and annoying than if all frames do not look quite as good but are consistent.</p>
<p>Some frames are more difficult to compress than others and so need more bits to maintain that consistent level of perceived quality. Conversely, some are easier to compress and so need less bits.</p>
<p>If one conducts two passes when encoding a video stream, this benefits the encoder because it already has a log of the relative complexity of each frame so it can better predict how to allocate the bits.</p>
<p>Traditionally, if conducting only one pass with a variable bit rate, the encoder has to try to guess based on whatever information it can from frames that have already been encoded. There are some ideas around to try to improve the bit allocation when doing one pass but I won&#8217;t discuss those here.</p>
<p>MPEG, and other, video codecs use a method called quantisation. This topic is also a bit too complex to discuss here. The quantiser values used in MPEG-1/-2/-4 ASP are 1, 2, &#8230;, 31 and for H.264 they are 1, 2, &#8230;, 51. Quantisers are how the encoder controls the allocation of bits to frames and parts of frames. The method of quantisation used in H.264 is different to the older codecs.</p>
<p>Confused? Don&#8217;t be. A frame compressed using a high quantiser will use less bits and have lower perceived quality than a frame compressed using a low quantiser. One can encode using a constant quantiser in <code>ffmpeg</code> by using the <code>-qscale &lt;quantiser&gt;</code> option. For MPEG-4 ASP (<code>-vcodec mpeg4</code>) using a value somewhere in the region of 3-5 for <code>-qscale</code> should produce good quality. For H.264 (<code>-vcodec libx264</code>) a value somewhere around the late teens to mid 20s should suffice.</p>
<p>So what does the <code>-sameq</code> option do? It uses the quantisers used in the source video stream to encode the output video stream. If converting from MPEG-4 ASP (e.g. Xvid or DivX) to H.264 (e.g. x264) this will inflate the file size considerably because of the different way these formats conduct quantisation.</p>
<p>Regardless, I would pretty much <strong>never</strong> recommend the use of <code>-sameq</code>. It does not mean &#8220;encode at the same quality as the source file&#8221;, nor does it mean &#8220;encode resulting in a file of similar size to the source file&#8221;. It just means &#8220;encode using the same quantisers&#8221; and the resulting video size and quality will likely be very unpredictable.</p>
<p>The conclusion: use <code>-b</code> with one or two passes. Or, if you&#8217;re using libx264 and you&#8217;re more concerned about quality than file size/bit rate and only want to do one pass, try <code>-crf</code> which uses an intelligent way of maintaining constant quality while using only one pass.</p>
]]></content:encoded>
			<wfw:commentRss>http://rob.opendot.cl/index.php/2009/05/01/bit-rate-file-size-quality-misunderstandings/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
