<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Flash Video Technology and Optimizations</title>
	<atom:link href="http://sonnati.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sonnati.wordpress.com</link>
	<description>Fabio Sonnati on video delivery and encoding</description>
	<lastBuildDate>Mon, 30 Jan 2012 08:44:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sonnati.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/619463ae8426760968e108a18d5c1157?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Flash Video Technology and Optimizations</title>
		<link>http://sonnati.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sonnati.wordpress.com/osd.xml" title="Flash Video Technology and Optimizations" />
	<atom:link rel='hub' href='http://sonnati.wordpress.com/?pushpress=hub'/>
		<item>
		<title>What about the future of Flash ?</title>
		<link>http://sonnati.wordpress.com/2012/01/16/what-about-the-future-of-flash/</link>
		<comments>http://sonnati.wordpress.com/2012/01/16/what-about-the-future-of-flash/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 19:43:07 +0000</pubDate>
		<dc:creator>sonnati</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://sonnati.wordpress.com/?p=860</guid>
		<description><![CDATA[A long time passed since my last post on this blog. I have been very busy in an important video streaming project but this is not the only reason for my absence. I have also wanted to wait and take all the necessary time to analyze, ponder and &#8220;digest&#8221; the infamous Flash affair. I will not hide my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=860&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A long time passed since my last post on this blog. I have been very busy in an important video streaming project but this is not the only reason for my absence. I have also wanted to wait and take all the necessary time to analyze, ponder and &#8220;digest&#8221; the infamous Flash affair.<br />
I will not hide my bitterness about the fact, but I&#8217;m also more optimitic now, after I have seen the real consequences and have had the time to elaborate on the future scenario. I&#8217;ts not all a bed of roses but I&#8217;m somewhat optimistic.</p>
<p>First of all, fortunately, I&#8217;m not limited to Flash technology in my consultancies. I work with .net technologies for many years and I have designed and deployed successful streaming services in HLS with both Wowza Server and FMS 4.5</p>
<p>You also know that I&#8217;m an encoding expert with important success cases and a deep knowledge of commercial and open source encoders like Ffmpeg, x264, Flip Factory, Telestream Vantage, Atheme KFE, Rozhet CarbonCoder, Digital Rapids to name a few.</p>
<p>I have created encoding pipelines and optimized existing ones for delivery platforms based on HLS, Flash HDS, MS Silverlight and ipTV and designed decoding and delivery optimizations for Flash and Silverlight.</p>
<p>So when I talk about my bitterness, it is not driven by the fear for the future but by the awareness of the big mistake that Adobe has done stabbing Flash in the back. I want to focus this post on the future prospectives for Flash and not on the disastrous announcement of Adobe (a masterpiece of masochism, at least from a PR point of view), however a brief summary of my thoughts on the topic is a good thing. I do two short considerations:</p>
<p>1. Adobe may also have had good, long term stategic reasons for dropping Flash for mobile browser, but they could choose modes and terms with much less collateral damages. Why not reduce progressively the commitments and the investments across the lifespan of FP11 to avoid harming the Flash Community ? After all, FP11 has been released for Android and QNX and it has brought important improvements in performance and stability. I know that Flash for mobile browsing has a lot of problems and those problems are due tot the excessive use of bad Flash coding that has been done over  time especially for advertising. Obviously if you have a page with 5-6 Flash banners that can kill an old desktop computer, how can be able a tablet to handle this ?<br />
A simple solution could be to put every swf  of a page in an idle mode, with a clickable poster image that activates the swf  only when touched. Simple, clear and always better than have no Flash support in mobile browsing.</p>
<p>2. Adobe just does not realize that is killing the goose that lays golden eggs. Have you even thought about the fact that Flash is used every day by 2 billion people! It&#8217;s probably the most pervasive peace of sofware after MS Windows. Giants like Steve Jobs would have exploited such competitive advantage in ways that the current Adobe management are not even able to imagine. Yet it is not difficult to imagine for example a marketplace of Flash and AIR apps on the model of the MacOS AppStore (but with 20 times more potential customers). What it is worth this kind of power ? Evidently near t0 zero for Adobe.</p>
<p>But now the damage is done and it worth nothing to complain, and so there will be some short, medium and long term consequences. The short term consequences are paradoxically positive for experienced Flash developers. This is because new developers, creative shops and consultancy firms are focusing interest to HTML5 because of the bad medium and long term outlook for the Flash technology and because of  marketing reasons. But the demand for Flash technology is not decrasing as fast as the offer and so there is a burst in the amount of work available for skilled developers.</p>
<p>In a medium term I see an higher convergence between the demand and offer for Flash-based projects in general. Flash will mainain or increase it&#8217;s penetration in web gaming thanks to 3D (remember that the casual game market on Internet is completely Flash-centric today, how forget that every day 200+ million people play some Flash games in Facebook ?) and probably will remain the reference for video streaming, but in the RIA market and creative market HTML5 will definitely gain it&#8217;s momentum (in real terms, not like now where only a few important creative, video or gaming projects has migrated from Flash to HTML5).</p>
<p>Flash in the mobile market, as a cross platform mobile development technology, has not, in my opinion a clear outlook for the future.  The sudden drop of Flash for mobile browser and the drastic reduction of commitment for Flex has been percepited as a treachery of Adobe from the point of view of the loyal base of sustainers and developers and as a definitive change in the wind from the point of view of customers and stake holders. How to blame them ? the lack of support from its own creator is a mortal stub for a technology and the message from Adobe is clear: in the long term we&#8217;ll substitute Flash with HTML5. Not only, we will focus more on tools than technologies (Flex docet).</p>
<p>No place for developers in the future of Adobe ? I don&#8217;t know but the long term perspective of Flash, Flex and other Flash related technology (FMS?) has been heavely perturbated by the infamous move. Flex is now an Apache baked project but is it a guarantee of evolution and support ? Who will invest time and credibility among customers in a technology for mobile development that has not a clear commitment from its creator and controller ?</p>
<p>Concluding, what I intends to do as a Flash developer ? In the short term I have to do a lot of Flash related projects, so no problem. In the medium term I think to continue using Flash/AIR for Mobile development. This is a clear path for me, I can capitalize on my AS3,Flash and Flex platform skills to develop desktop, browser and mobile apps. Now the level of features for Android and iOS has become good enough to be able to develop any kind of apps without the need for adding Java and Objective C to your skill portfolio (in my opinion, the recent support for notifications, in app purchase and HLS have cleared the top three entries of the most wanted and needed features list).</p>
<p>And in the long-term ? I dont&#8217; have an answer, I think I&#8217;ll simply wait and see.</p>
<p>PS: Very interesting article about &#8220;migrating&#8221; from Flex to JS (Thanks to Anna Karim) &#8211; <a href="https://plus.google.com/109047477151984864676/posts/CVGJKLMMehs" target="_blank">https://plus.google.com/109047477151984864676/posts/CVGJKLMMehs</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sonnati.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sonnati.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sonnati.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sonnati.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sonnati.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sonnati.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sonnati.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sonnati.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sonnati.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sonnati.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sonnati.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sonnati.wordpress.com/860/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sonnati.wordpress.com/860/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sonnati.wordpress.com/860/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=860&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sonnati.wordpress.com/2012/01/16/what-about-the-future-of-flash/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64695556c64a28845a3eb5004c9f8609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sonnati</media:title>
		</media:content>
	</item>
		<item>
		<title>My presentation at MAX2011 is available on Adobe TV</title>
		<link>http://sonnati.wordpress.com/2011/10/10/my-presentation-at-max2011-is-available-on-adobe-tv/</link>
		<comments>http://sonnati.wordpress.com/2011/10/10/my-presentation-at-max2011-is-available-on-adobe-tv/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 11:22:11 +0000</pubDate>
		<dc:creator>sonnati</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[FMS]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://sonnati.wordpress.com/?p=853</guid>
		<description><![CDATA[Finally the recording of my presentation at MAX2011 (Encoding for performance on multiple devices) is available on Adobe TV. You can also download the pdf version here. My using of FFmpeg for repurposing the streams of FMS has attracted quite a lot of interest and attention. I&#8217;m planning to extend the series of article dedicated [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=853&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Finally the recording of my presentation at MAX2011 (Encoding for performance on multiple devices) is <a href="http://tv.adobe.com/watch/max-2011-develop/encoding-for-performance-on-multiple-devices/" target="_blank">available on Adobe TV</a>.</p>
<p>You can also <a href="http://bit.ly/oPSM5g" target="_blank">download the pdf version here</a>. My using of FFmpeg for repurposing the streams of FMS has attracted quite a lot of interest and attention. I&#8217;m planning to extend the series of article dedicated to FFmpeg and also to transform it in a permanent knowledge-base on FFmpeg and related best-practices.</p>
<p><a href="http://bit.ly/oPSM5g"><img class="aligncenter size-full wp-image-854" title="final2011" src="http://sonnati.files.wordpress.com/2011/10/final2011.jpg?w=600&#038;h=449" alt="" width="600" height="449" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sonnati.wordpress.com/853/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sonnati.wordpress.com/853/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sonnati.wordpress.com/853/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sonnati.wordpress.com/853/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sonnati.wordpress.com/853/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sonnati.wordpress.com/853/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sonnati.wordpress.com/853/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sonnati.wordpress.com/853/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sonnati.wordpress.com/853/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sonnati.wordpress.com/853/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sonnati.wordpress.com/853/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sonnati.wordpress.com/853/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sonnati.wordpress.com/853/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sonnati.wordpress.com/853/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=853&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sonnati.wordpress.com/2011/10/10/my-presentation-at-max2011-is-available-on-adobe-tv/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64695556c64a28845a3eb5004c9f8609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sonnati</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/10/final2011.jpg" medium="image">
			<media:title type="html">final2011</media:title>
		</media:content>
	</item>
		<item>
		<title>New apps for Playbook: Virgin, RMC and 105 Radio XL and TV</title>
		<link>http://sonnati.wordpress.com/2011/10/02/new-apps-for-playbook-virgin-rmc-and-105-radio-xl-and-tv/</link>
		<comments>http://sonnati.wordpress.com/2011/10/02/new-apps-for-playbook-virgin-rmc-and-105-radio-xl-and-tv/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 17:23:33 +0000</pubDate>
		<dc:creator>sonnati</dc:creator>
				<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://sonnati.wordpress.com/?p=844</guid>
		<description><![CDATA[Finally the applications I have developed with Flex and AIR for Playbook are officially in the RIM AppWorld market. They are 6 media apps developed for Finelco, the owner of the biggest radio network in Italy. The first 3 are dedicated to 5 music web TV channels (app names : Radio 105 TV, Radio Monte Carlo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=844&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Finally the applications I have developed with Flex and AIR for Playbook are officially in the RIM AppWorld market.<br />
They are 6 media apps developed for Finelco, the owner of the biggest radio network in Italy.</p>
<p>The first 3 are dedicated to 5 music web TV channels (app names : <a href="http://appworld.blackberry.com/webstore/content/48953?lang=en" target="_blank">Radio 105 TV</a>, <a href="http://appworld.blackberry.com/webstore/content/49048?lang=en" target="_blank">Radio Monte Carlo TV</a>, <a href="http://appworld.blackberry.com/webstore/content/49050?lang=en" target="_blank">Virgin Radio TV</a>).  <br />
The other 3 offer a complete multimedia experience with:</p>
<p>- A selection of thematic web radio plus the live broadcast of the main radio channel<br />
- A selection of podcasts (MP3) from the main programs of the radio<br />
- The charts/playlist created by the sound designers or voted by the users<br />
- A multi-touch photo gallery<br />
- A selection of VOD contents like video clips, interviews, concerts</p>
<p>(App names: <a href="http://appworld.blackberry.com/webstore/content/49850?lang=en" target="_blank">Radio 105 XL</a>, <a href="http://appworld.blackberry.com/webstore/content/49734?lang=en" target="_blank">Radio Monte Carlo XL</a>, <a href="http://appworld.blackberry.com/webstore/content/49856?lang=en" target="_blank">Virgin Radio XL</a>).</p>
<p>I&#8217;m very proud because the apps are collecting a lot of 5 starts reviews. Flex and AIR can assure an excellent UX, especially for multimedia (live audio, live video, vod and so on), and a easy customization.</p>
<p>Pictures from the Virgin Radio app:</p>
<p><a href="http://sonnati.files.wordpress.com/2011/07/screenshot_1.png"><img title="screenshot_1" src="http://sonnati.files.wordpress.com/2011/07/screenshot_1.png?w=600&#038;h=351" alt="" width="600" height="351" /></a></p>
<p><a href="http://sonnati.files.wordpress.com/2011/07/screenshot_2.png"><img title="screenshot_2" src="http://sonnati.files.wordpress.com/2011/07/screenshot_2.png?w=600&#038;h=351" alt="" width="600" height="351" /></a></p>
<p><a href="http://sonnati.files.wordpress.com/2011/07/screenshot_3.png"><img title="screenshot_3" src="http://sonnati.files.wordpress.com/2011/07/screenshot_3.png?w=600&#038;h=351" alt="" width="600" height="351" /></a></p>
<p><a href="http://sonnati.files.wordpress.com/2011/07/screenshot_4.png"><img title="screenshot_4" src="http://sonnati.files.wordpress.com/2011/07/screenshot_4.png?w=600&#038;h=351" alt="" width="600" height="351" /></a></p>
<p>If you have not a Playbook, take a look at the UX in this video:</p>
<span style="text-align:center; display: block;"><a href="http://sonnati.wordpress.com/2011/10/02/new-apps-for-playbook-virgin-rmc-and-105-radio-xl-and-tv/"><img src="http://img.youtube.com/vi/pszBnHrga58/2.jpg" alt="" /></a></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sonnati.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sonnati.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sonnati.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sonnati.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sonnati.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sonnati.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sonnati.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sonnati.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sonnati.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sonnati.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sonnati.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sonnati.wordpress.com/844/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sonnati.wordpress.com/844/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sonnati.wordpress.com/844/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=844&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sonnati.wordpress.com/2011/10/02/new-apps-for-playbook-virgin-rmc-and-105-radio-xl-and-tv/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64695556c64a28845a3eb5004c9f8609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sonnati</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/07/screenshot_1.png" medium="image">
			<media:title type="html">screenshot_1</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/07/screenshot_2.png" medium="image">
			<media:title type="html">screenshot_2</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/07/screenshot_3.png" medium="image">
			<media:title type="html">screenshot_3</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/07/screenshot_4.png" medium="image">
			<media:title type="html">screenshot_4</media:title>
		</media:content>
	</item>
		<item>
		<title>Be quick! 5 promo codes to save 200$ for a MAX 2011 full conference pass</title>
		<link>http://sonnati.wordpress.com/2011/09/22/be-quick-5-promo-codes-to-save-200-for-a-max-2011-full-conference-pass/</link>
		<comments>http://sonnati.wordpress.com/2011/09/22/be-quick-5-promo-codes-to-save-200-for-a-max-2011-full-conference-pass/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 20:43:20 +0000</pubDate>
		<dc:creator>sonnati</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sonnati.wordpress.com/?p=715</guid>
		<description><![CDATA[I&#8217;m happy to offer to 5 of my readers the opportunity to obtain a discount of $200 for a full conference pass at Adobe MAX 2011. The first 5 of you that will use the promo code ESSONNATI while registering at the conference (max.adobe.com) will obtain the discounted rate of $1,095 instead of $1,295. Be quick! Max [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=715&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m happy to offer to 5 of my readers the opportunity to obtain a discount of $200 for a full conference pass at Adobe MAX 2011. The first 5 of you that will use the promo code ESSONNATI while registering at the conference (<a href="http://max.adobe.com" target="_blank">max.adobe.com</a>) will obtain the discounted rate of $1,095 instead of $1,295. Be quick! Max is approaching fast!</p>
<p>It you get in, remember to attend my presentation: &#8220;Encoding for performance on multiple device&#8221;<br />
<a href="http://bit.ly/qvKjP0">http://bit.ly/qvKjP0</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sonnati.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sonnati.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sonnati.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sonnati.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sonnati.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sonnati.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sonnati.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sonnati.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sonnati.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sonnati.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sonnati.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sonnati.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sonnati.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sonnati.wordpress.com/715/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=715&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sonnati.wordpress.com/2011/09/22/be-quick-5-promo-codes-to-save-200-for-a-max-2011-full-conference-pass/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64695556c64a28845a3eb5004c9f8609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sonnati</media:title>
		</media:content>
	</item>
		<item>
		<title>Bandwidth is running out. Let&#8217;s save the bandwidth</title>
		<link>http://sonnati.wordpress.com/2011/09/15/bandwidth-is-running-out-lets-save-the-bandwidth/</link>
		<comments>http://sonnati.wordpress.com/2011/09/15/bandwidth-is-running-out-lets-save-the-bandwidth/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 14:20:18 +0000</pubDate>
		<dc:creator>sonnati</dc:creator>
				<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://sonnati.wordpress.com/?p=592</guid>
		<description><![CDATA[The global bandwidth consumption is growing every day and one of the main causes is the explosion of bandwidth hungry Internet services based on Video On Demand (VOD)  or live streaming. Youtube is accounted for a considerable portion of the whole Internet bandwidth usage, but also Hulu and NetFlix are first class consumers. One of the cause of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=592&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The global bandwidth consumption is growing every day and one of the main causes is the explosion of bandwidth hungry Internet services based on Video On Demand (VOD)  or live streaming. Youtube is accounted for a considerable portion of the whole Internet bandwidth usage, but also Hulu and NetFlix are first class consumers.</p>
<p>One of the cause of this abnormal consumption (apart from the high popularity) is the low level of optimization used in video encoding: for example Youtube encodes 480p video @1Mbit/s, 720p @2.1Mbit/s and 1080p @3.5Mbit/s which are rather high values. But also NetFlix, BBC and Hulu use conservatives settings. You may observe that NetFlix and Hulu use adaptive streaming to offer different quality levels depending by network conditions but such techniques are aimed at improving the QoS and not reduce the bandwidth consumption, so it&#8217;s very important to offer a quality/bitrate ratio as high as possible and not underestimate all the consequences of an un-optimized encoding.</p>
<p>The main consequence of a not optimized video is an high overall bandwidth consumption and therefore an high CDN bill. But for those giants this is not always a problem because, thanks to very high volumes, they can negotiate a very low cost per GByte.</p>
<p>However it is not only a matter of pure bandwith cost. There are many other hidden &#8220;costs&#8221;. For example at peek hours may be difficult to stream HD videos from Youtube without frequent, and annoying, rebuffering. Furthermore a lot of users nowadays use mobile connections for their laptop/tablet and rarely such connections offer more than 1-2 Mbit/s of real average bandwidth. If the video streaming service, differently from YouTube, uses dynamic streaming (like Hulu, NetFlix, EpicHD, etc&#8230;) the user is still able to see the video without re-buffering but it is very likely that he will obtain one of the lower quality versions of the stream in this bandwidth constrained scenarios and not the high quality one.</p>
<p>Infact, the use of dynamic streaming is today very often used as an alibi for poorly optimized encoding workflows&#8230;</p>
<p>This state of insufficient bandwidth is more frequent in less developed countries. But even highly developed countries can have problems if we think at the recent data trasfer restrictions introduced in Canada or in USA  by some network providers (AT&amp;T &#8211; 150GB/month, for example).</p>
<p>These limits are established especially because at peak hours the strong video streaming consumption can saturate the infrastructure, even of an entire nation as was happening in 2008-2009 in UK after the launch and the consequent extraordinary success of BBC&#8217;s iPlayer.</p>
<p>So dynamic streaming can help but must not to be used as an excuse to poorly optimized encodings and it is absurd to advertise a streaming service as HD when it requires to have 3-4Mbit/s+ of average bandwidth to stream the higher quality bitrate while in USA the average is around 2.9Mbit/s (meaning that more than 50% of users will stream a lower quality stream and not the HD one).</p>
<p>How many customers are really able to see an HD stream from start to end in a real scenario with this kind of bitrates ?</p>
<p><strong>The solution is : invest in video optimization</strong></p>
<p>Fortunately today every first class video provider uses H.264 for their video and H.264 offers still much room for improvement.<br />
In the past I have shown several examples of optimized encodings. They were often experiments to explore the limit of H.264, or the possibilities of further quality improvements that the Flash Player can provide to a video streaming service (take a look at my <a href="http://sonnati.wordpress.com/best-of-blog/" target="_blank">&#8220;best articles&#8221;</a> area).</p>
<p>In such experiments I have usually tried to encode a 720p video at a very low bitrate like 500Kbit/s. 500Kbit/s is more than a psycological threshold because at this level of bitrate it is really-really complex to achieve a satisfactory level of quality in 720p. Therefore my first experiments used to be accomplished on not too much complex contents.</p>
<p>But in these last 3 years I have improved considerably my skills and the knowledge of the inner principles of H.264. I have worked for first class media companies and contributed to the creation of advanced video platforms capable to offer excellent video quality for desktop (Flash, Silverlight, Widevine), mobile (Flash, HLS, native) and STB (vbr or cbr .ts).</p>
<p>So now I&#8217;m able to show you some examples of complex content encoded with very good quality/bitrate ratios in a real world scenario.</p>
<p><strong>I&#8217;m not afraid</strong></p>
<p>To show you this new level of optimization of H.264 I have choosen one of the most watched video in Youtube: <strong><a href="http://www.youtube.com/watch?v=j5-yKhDd64s" target="_blank">Not afraid by Eminem</a>.</strong><br />
This is a complex clip with a lot of movements, dark scenes, some transparencies, lens flares and a lot of fine details on artist&#8217;s face.</p>
<p>Youtube offers the video in these 4 versions (plus a 240p):</p>
<p>1080p @ 3.5Mbit/s<br />
720p @ 2.1Mbit/s<br />
480p @ 1Mbit/s<br />
360p @ 0.5Mbit/s</p>
<p>Starting from this &#8220;state of art&#8221;, I have tryed to show what can be obtained with a little bit of optimization.<br />
Why not try to offer the quality of the first three stream options but at half the bitrate ? Let&#8217;s say:</p>
<p>1080p @ 1.7Mbit/s<br />
720p @ 1Mbit/s<br />
576p @ 0.5Mbit/s</p>
<p>A such replacement would lead to two consequences:</p>
<p><strong>A. Total bandwidth consumption reduced approximately by  2.</strong><br />
<strong>B. Much more users would be able to watch high quality video</strong>, even in low speed scenarios (mobile, capped connections, peak hours and developing countries).</p>
<p>But first of all, let&#8217;s take a look at the final result. <a href="http://www.progettosinergia.com/flashvideo/comparison2011_A.htm" target="_blank">Here you find a comparison page</a>. On the left you have the YouTube video, on the right the optimized set of encodings. It is not simple to compare two 1080p or 720p videos (follow the instructions in the comparison page), so I have extracted some screenshots to compare the original Youtube version with the optimized encoding.</p>
<p><strong>1. Youtube 1080p @ 3.5Mbit/s vs Optimized 1080p @ 1.7Mbit/s<br />
</strong><br />
<a href="http://sonnati.files.wordpress.com/2011/09/eminem720p_9.jpg" target="_blank"><img class="aligncenter size-full wp-image-807" title="eminem720p_9" src="http://sonnati.files.wordpress.com/2011/09/eminem720p_9.jpg?w=600&#038;h=268" alt="" width="600" height="268" /></a></p>
<p>Notice the skin details and imperfections. The optimized encoding offers virtually the same quality at half the bitrate. <strong>Consequently, the quality of 1080p at 15% less bitrate than the 720p version of Youtube.</strong></p>
<p><strong>2. Youtube 720p @ 2Mbit/s vs optimized 720p @ 1Mbit/s</strong></p>
<p><a href="http://sonnati.files.wordpress.com/2011/09/eminem720p_11.jpg" target="_blank"><img class="aligncenter size-full wp-image-799" title="eminem720p_1" src="http://sonnati.files.wordpress.com/2011/09/eminem720p_11.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p><a href="http://sonnati.files.wordpress.com/2011/09/eminem720p_21.jpg" target="_blank"><img class="aligncenter size-full wp-image-800" title="eminem720p_2" src="http://sonnati.files.wordpress.com/2011/09/eminem720p_21.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p><a href="http://sonnati.files.wordpress.com/2011/09/eminem720p_5.jpg" target="_blank"><img class="aligncenter size-full wp-image-803" title="eminem720p_5" src="http://sonnati.files.wordpress.com/2011/09/eminem720p_5.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p>Again virtually the same quality at half the bitrate. Consequently 720p video can be offered instead of 480p which has the same bitrate:</p>
<p><strong>3. Youtube 480p @ 1Mbit/s vs 720p @ 1Mbit/s</strong></p>
<p><a href="http://sonnati.files.wordpress.com/2011/09/eminem720p_4.jpg" target="_blank"><img class="aligncenter size-full wp-image-802" title="eminem720p_4" src="http://sonnati.files.wordpress.com/2011/09/eminem720p_4.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p><a href="http://sonnati.files.wordpress.com/2011/09/eminem720p_6.jpg" target="_blank"><img class="aligncenter size-full wp-image-804" title="eminem720p_6" src="http://sonnati.files.wordpress.com/2011/09/eminem720p_6.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p>Optimized 720p offers higher quality (details, grain, spatial resolution) at the same bitrate.</p>
<p><strong>4. Youtube 480p @ 1Mbit/s vs optimized 576p@ 500Kbit/s</strong></p>
<p><a href="http://sonnati.files.wordpress.com/2011/09/eminem720p_7.jpg" target="_blank"><img class="aligncenter size-full wp-image-805" title="eminem720p_7" src="http://sonnati.files.wordpress.com/2011/09/eminem720p_7.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p><a href="http://sonnati.files.wordpress.com/2011/09/eminem720p_8.jpg" target="_blank"><img class="aligncenter size-full wp-image-806" title="eminem720p_8" src="http://sonnati.files.wordpress.com/2011/09/eminem720p_8.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p>Instead of using a 854&#215;480 @ 500Kbit/s resolution I have preferred to use a 1024&#215;576 (576p). I have also tryed to encode in 720p @ 600-700Kbit/s with very good results but I liked the factor 2 reduction in bitrate, so in the end, I opted for 576p which offered more stable results across the whole video. In this case the quality, details level and spatial resolution is higher than the original but at half the bitrate.</p>
<p><strong>5. Youtube 360p @ 500Kbit/s vs optimized 576 @ 500Kbit/s</strong></p>
<p><a href="http://sonnati.files.wordpress.com/2011/09/eminem720p_10.jpg" target="_blank"><img class="aligncenter size-full wp-image-808" title="eminem720p_10" src="http://sonnati.files.wordpress.com/2011/09/eminem720p_10.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p><a href="http://sonnati.files.wordpress.com/2011/09/eminem720p_111.jpg" target="_blank"><img class="aligncenter size-full wp-image-809" title="eminem720p_11" src="http://sonnati.files.wordpress.com/2011/09/eminem720p_111.jpg?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p>Again much higher spatial resolution, details level and overal quality at the same bitrate.</p>
<p><strong>For the sake of optimization</strong></p>
<p>How have I obtained a bitrate / quality ratio like this ? Well, it is not simple but I will try to explain the base principle.</p>
<p>Modern encoders do a lot of work to optimize the encoding from a mathematical / machine point of view. So for example a metric is used for Rate Distortion Optimization (like PSNR or SSIM). But this kind of approach is not always usefull at low bitrates, or when a high quality/bitrate ratio is required. In this scenario the standard approach may not lead to the best encoding because it is not capable to forecast what pictures are more important to enhance the quality perceived by the average user. Not every keyframes or portions of video are equally important.</p>
<p>These examples of optimized encodings are obtained with a mix of automated video analysis tool (for dynamic filtering, for istance) and human-guided fitting approach (for keyframe placement and quality burst). I&#8217;m actually developing a fully automated pipeline but by now, if an expert eye guides the process, it produces better results.</p>
<p>Unfortuntely there is a downside in using an ultra-optimized encoding: the encoding time rises consistently, so it is not realistic to think that Youtube could re-encode every single video with new optimized profiles.</p>
<p>But, you know, when we talk about big numbers, there&#8217;s an empiric law which may help use in a real world scenario:<em> the Pareto principle</em>. Let&#8217;s apply the Pareto principle to Youtube&#8230;</p>
<p><strong>The Pareto principle</strong></p>
<p>The <strong>Pareto principle</strong> (aka the 80-20 law) states that, for many events, roughly 80% of the effects come from 20% of the causes. Applying this rule to YouTube, it&#8217;s very likely that 80% of traffic comes from 20% of videos. A derivation of Pareto law known as 64-4 rule states that 64% of effects come from 4% of causes (and so on). So optimizing a reduced set of most popular videos would lead to huge savings and optimal user experience with only a limited amount of extra effort (the 4%).</p>
<p>But &#8220;Not Afraid&#8221; belongs to the top 10 of most popular video on YouTube, so it&#8217;s a perfect candidate for an extremization of Pareto law.</p>
<p>Let&#8217;s do some calculation. My samples reduce the bandwith of a factor 2 at every versions. So if we suppose that the most preferite version of the video is 720p and consider that the video has been watched more than 250 M times in the last 12 months, YouTube has consumed : 64MB * 250 M views = 16 PBytes, only to stream Not Afraid for 1 year.</p>
<p>Supposing an &#8220;equivalent&#8221; cost of 2c$/GByte*, this means 320.000$ (* it&#8217;s the lowest cost in CDN industry for huge volumes; probably YouTube uses different models of billing so consider it as a rough evaluation).</p>
<p>So an hand-made encoding of only 1 video could generate a saving of 160.000$. Wow&#8230; Encoding even only the TOP10 Youtube videos means probably at least 1M$ of saving&#8230;multiply this for the TOP1000 video and probably we talk of tens of millions per year&#8230;what to say&#8230;youtube, you know where to find me <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><strong>Moral of the story</strong></p>
<p>The proposed application of Pareto rule is an example of adaptive strategy. Instead of encode all the video with a complex process that could not be affordable, why not encode only a limited subset of very popular videos ? Why not encode them with the standard set and then re-process without hurry only if the rate of popularity rise over an interesting  threshold ?</p>
<p>Adaptive strategies are always the most productive. So if you apply this to the Youtube model, you get huge bandwidth (money) savings, if you apply this to a NetFlix model (dynamic streaming) you get a sudden increase in average quality delivered to clients and so on.</p>
<p>Concluding, the moral of the story is that every investment in encoding optimizations and adaptive encoding workflows can have very positive effects on user experience and/or business balance.</p>
<p>PS: I&#8217;ll speak about encoding and adaptive strategies during Adobe MAX 2011 (2-5 October) &#8211; If you are there and interested in encoding join my presentation : <a href="http://bit.ly/qvKjP0" target="_blank"> http://bit.ly/qvKjP0</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sonnati.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sonnati.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sonnati.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sonnati.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sonnati.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sonnati.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sonnati.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sonnati.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sonnati.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sonnati.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sonnati.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sonnati.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sonnati.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sonnati.wordpress.com/592/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=592&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sonnati.wordpress.com/2011/09/15/bandwidth-is-running-out-lets-save-the-bandwidth/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64695556c64a28845a3eb5004c9f8609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sonnati</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/09/eminem720p_9.jpg" medium="image">
			<media:title type="html">eminem720p_9</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/09/eminem720p_11.jpg" medium="image">
			<media:title type="html">eminem720p_1</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/09/eminem720p_21.jpg" medium="image">
			<media:title type="html">eminem720p_2</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/09/eminem720p_5.jpg" medium="image">
			<media:title type="html">eminem720p_5</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/09/eminem720p_4.jpg" medium="image">
			<media:title type="html">eminem720p_4</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/09/eminem720p_6.jpg" medium="image">
			<media:title type="html">eminem720p_6</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/09/eminem720p_7.jpg" medium="image">
			<media:title type="html">eminem720p_7</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/09/eminem720p_8.jpg" medium="image">
			<media:title type="html">eminem720p_8</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/09/eminem720p_10.jpg" medium="image">
			<media:title type="html">eminem720p_10</media:title>
		</media:content>

		<media:content url="http://sonnati.files.wordpress.com/2011/09/eminem720p_111.jpg" medium="image">
			<media:title type="html">eminem720p_11</media:title>
		</media:content>
	</item>
		<item>
		<title>FFmpeg – the swiss army knife of Internet Streaming – part IV</title>
		<link>http://sonnati.wordpress.com/2011/08/30/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-iv/</link>
		<comments>http://sonnati.wordpress.com/2011/08/30/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-iv/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 17:14:28 +0000</pubDate>
		<dc:creator>sonnati</dc:creator>
				<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://sonnati.wordpress.com/?p=768</guid>
		<description><![CDATA[This is the fourth and last part of a short series dedicated to FFmpeg (First, Second and Third part). In this conclusive article I will focus on the support for RTMP that makes FFmpeg an excellent tool for enhancing the capabilities of the Adobe Flash Streaming Ecosystem. FFmpeg introduced a strong support for RTMP streaming [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=768&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the fourth and last part of a short series dedicated to FFmpeg (<a title="FFmpeg – the swiss army knife of Internet Streaming – part I" href="http://sonnati.wordpress.com/2011/07/11/ffmpeg-the-swiss-army-knife-of-internet-streaming-part-i/" target="_blank">First</a>, <a title="FFmpeg – the swiss army knife of Internet Streaming – part II" href="http://sonnati.wordpress.com/2011/08/08/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-ii/" target="_blank">Second</a> and <a title="FFmpeg – the swiss army knife of Internet Streaming – part III" href="http://sonnati.wordpress.com/2011/08/19/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-iii/" target="_blank">Third</a> part).</p>
<p>In this conclusive article I will focus on the support for RTMP that makes FFmpeg an excellent tool for enhancing the capabilities of the Adobe Flash Streaming Ecosystem.</p>
<p>FFmpeg introduced a strong support for RTMP streaming with the release 0.5 by the inclusion of the librtmp (rtmpdump) core. An RTMP stream can be used both as an input and/or as an output in a command line.</p>
<p>The required syntax is:</p>
<p><strong><em>rtmp_proto://server[:port][/application][/stream] options</em></strong></p>
<p>where <strong>rtmp_proto</strong> can be: &#8220;<em>rtmp</em>&#8220;, &#8220;<em>rtmpt</em>&#8220;, &#8220;<em>rtmpte</em>&#8220;, &#8220;<em>rtmps</em>&#8220;, &#8220;<em>rtmpte</em>&#8220;, &#8220;<em>rtmpts</em>&#8221; and <strong>options</strong> contain a list of space-separated options in the form <em>key=val</em> (more info <a href="http://rtmpdump.mplayerhq.hu/librtmp.3.html" target="_blank">here</a>).</p>
<p>Using some of the parameters that we have seen in the first three parts of the series, it&#8217;s possible to do a lot of things that the standard Flash Streaming Ecosystem cannot offer. Sometimes there are minor bugs but generally speaking the rtmplib works well and helps FMS to fill the gap with some advanced feature of Wowza Server (like re-purposing of rtp/rtsp stream, TS-stream and so on). FFmpeg works with FMS as well as Wowza Server and RED5, so in the article I will use FMS as a generic term to mean any &#8220;RTMP-server&#8221;.</p>
<p><strong>1. STREAM A FILE TO FMS AS IF IT WERE LIVE</strong></p>
<p>With the help of FFmpeg it is possible for example to stream a pre-encoded file to FMS as if it were a live source. This can be very useful for test purpose but also to create pseudo-live channels.</p>
<p><em><strong>ffmpeg -re -i localFile.mp4 -acodec copy -vcodec copy -f flv rtmp://server/live/streamName</strong></em></p>
<p>The<strong> -re</strong> option tells FFmpeg to read the input file in realtime and not in the standard as-fast-as-possible manner. With <strong>-acodec copy</strong> and<strong> -vcodec copy</strong> I&#8217;m telling FFmpeg to copy the essences of the input file without transcoding, then to package them in an FLV container (<strong>-f flv</strong>) and send the final bitstream to an rtmp destination (rtmp://server/live/streamName).</p>
<p>The input file must have audio and video codec compatible with FMS, for example H.264 for video and AAC for audio but any supported codecs combination should work.<br />
Obviously it would be also possible to encode on the fly the input video. In this case remember that the CPU power requested for a live encoding can be high and cause loss in frame rate or stuttering playback on subscribers&#8217; side.</p>
<p>In which scenario can be useful a command like that ?</p>
<p>For example, suppose to have created a communication or conference tool in AIR. One of the partecipants at the conference could fetch a local file and stream it to the conference FMS to show, in realtime, the same file to other partecipants. Leveraging the &#8220;native process&#8221; feature of AIR it is simple to launch a command line like the one above and do the job. In this scenario, probably you will have to transcode the input, or check for the compatibility of codecs analyzing the input up front (remember <strong>ffmpeg -i INPUT</strong> trick we spoke about in the second article).</p>
<p><strong>2. GRAB AN RTMP SOURCE</strong></p>
<p>Using a command like this:</p>
<p><strong>ffmpeg -i rtmp://server/live/streamName -acodec copy -vcodec copy dump.flv</strong></p>
<p>It&#8217;s possible to dump locally the content of a remote RTMP stream. This can be useful for test/audit/validation purpose. It works for both live and on-demand content.</p>
<p><strong>3. TRANSCODE LIVE RTMP TO LIVE RTMP</strong></p>
<p>One of the more interesting scenario is when you want to convert a format to a different one for compatibility sake or to change the characteristics of the original stream.</p>
<p>Let&#8217;s suppose to have a Flash Player based app that do a live broadcast. You know that until FP11, Flash can only encode using the old Sorenson spark for video and NellyMoser ASAO or Speex for audio. You may use a live transcoding command to enhance the compression of the video transcoding from Sorenson to H.264:</p>
<p><em><strong>ffmpeg -i rtmp://server/live/originalStream -acodec copy -vcodec libx264 -vpre slow -f flv rtmp://server/live/h264Stream</strong></em></p>
<p>This could be useful to reduce bandwidth usage especially in live broadcasting where latency it&#8217;s not a problem.<br />
The next release of FMS will also offer support for the Apple HTTP Live Streaming (like Wowza already do). So it will be possible to use FMS to stream live to iOS device. But FMS does not transcode the stream essence, it performs only a repackaging or repurposing of the original essences. But FFmpeg can help us to convert the uncompliant Sorenson-Speex stream to a H.264-AAC stream in this way:</p>
<p><em><strong>ffmpeg -i rtmp://server/live/originalStream -acodec libfaac -ar 44100 -ab 48k -vcodec libx264 -vpre slow -vpre baseline -f flv rtmp://server/live/h264Stream</strong></em></p>
<p>See also the point 4 and 5 to know how to generate a multibitrate stream to be compliant with Apple requirements for HLS. This approach will be useful also with FP11 that encode in H.264, but generate only one stream.</p>
<p>Another common scenario is when you are using FMLE to make a live broadcast. The standard windows version of FMLE supports only MP3 and not AAC for audio encoding (plug-in required). This may be a problem when you want to use your stream also to reach iOS devices with FMS or Wowza (iOS requires AAC for HLS streams). Again FFmpeg can help us:</p>
<p><em><strong>ffmpeg -i rtmp://server/live/originalStream -acodec libfaac -ar 44100 -ab 48k -vcodec copy -f flv rtmp://server/live/h264_AAC_Stream</strong></em></p>
<p>On the other hand, I have had the opposite problem recently with an AIR 2.7 apps for iOS. AIR for iOS does not support by now H.264 or AAC streaming with the classical netStream object, but I needed to subscribe AAC streams generated for the desktops. FFmpeg helped me in transcoding AAC streams to MP3 for the AIR on iOS app.</p>
<p>Again, you probably know that Apple HLS requires an audio only AAC stream with a bitrate less than 64Kbit/s for the compliance of video streaming apps, but at the same time you probably want to offer an higher audio quality for your live streaming (on desktop fpo istance). Unfortunately FMLE encode at multiple bitrates only the video track while use a unique audio preset for all bitrates. With FFmpeg is possible to generate a dedicated audio only stream in AAC with bitrate less than 64Kbit/s.</p>
<p><strong>4. GENERATE BASELINE FOR LOW-END DEVICES</strong></p>
<p>Very similarly, if you want to be compliant with older iOS versions or other mobile devices (older BB for istance) you need to encode in Baseline profile, but at the same time you may want to leverage high profile for desktop HDS. So you could use FMLE to generate high profile streams, with high quality AAC and then generate server side a baseline set of multi-bitrate streams for HLS and/or low end devices compatibility.</p>
<p>This command read from FMS the highest quality of a multi bitrate set generated by FMLE and starting from that generate 3 scaled down versions in baseline profile for HLS or Mobile. The last stream is an audio only AAC bitstream at 48Kbit/s.</p>
<p><em><strong>ffmpeg -re -i rtmp://server/live/high_FMLE_stream -acodec copy -vcodec x264lib -s 640&#215;360 -b 500k -vpre medium -vpre baseline rtmp://server/live/baseline_500k -acodec copy -vcodec x264lib -s 480&#215;272 -b 300k -vpre medium -vpre baseline rtmp://server/live/baseline_300k -acodec copy -vcodec x264lib -s 320&#215;200 -b 150k -vpre medium -vpre baseline rtmp://server/live/baseline_150k -acodec libfaac -vn -ab 48k rtmp://server/live/audio_only_AAC_48k</strong></em></p>
<p><strong>5. ENCODE LIVE FROM LOCAL GRABBING DEVICES</strong></p>
<p>FFmpeg can use also a local AV source, so it&#8217;s possible to encode live directly from FFmpeg and bypass completely FMLE. I suggest to do that only in very controlled scenarios because FMLE offers precious, addictional functions like auto-encoding adjust to keep as low as possible the latency when the bandwidth between the acquisition point and the server is not perfect.</p>
<p>This is an example of single bitrate:</p>
<p><strong><em>ffmpeg -r 25 -f dshow -s 640&#215;480 -i video=&#8221;video source name&#8221;:audio=&#8221;audio source name&#8221; -vcodec libx264 -b 600k -vpre slow -acodec libfaac -ab 128k rtmp://server/application/stream_name</em></strong></p>
<p>Join this command line and the previous and you have a multi-bitrate live encoding configuration for desktop and mobile.</p>
<p><strong>6. ENCODE SINGLE PICTURES WITH H.264 INTRA COMPRESSION</strong></p>
<p>H.264 has a very efficient Intra compression mode, so it is possible to leverage it for picture compression. I have estimated an improvement of around 50% in compression compared to JPG. Last year I have discussed estensively the possibility to use this kind of image compression to protect professional footage with FMS and RTMPE. <a href="http://sonnati.wordpress.com/2010/10/19/h-264-for-image-compression/" target="_blank">Here you find the article</a>, and this is the command line:</p>
<p><em><strong>ffmpeg.exe -i INPUT.jpg -an -vcodec libx264 -coder 1 -flags +loop -cmp +chroma -subq 10 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -flags2 +dct8x8 -trellis 2 -partitions +parti8x8+parti4x4 -crf 24 -threads 0 -r 25 -g 25 -y OUTPUT.mp4</strong></em></p>
<p>Change -crf to modulate encoding quality (and compression rate).</p>
<p><strong>CONCLUSIONS</strong></p>
<p>With this article, this short series on FFmpeg comes to an end.<br />
There are a lot of other scenarios where using FFmpeg with FMS (or Wowza) can help you creating new exciting services for you projects and overcome the limitations of the current Flash Video Ecosystem, so now it&#8217;s up to you. Try to mix my examples and post comments about new ways of customization that you have found of your RTMP delivery system.</p>
<p>I&#8217;ll speak about this topic also during my presentation at MAX 2011,<a href="http://bit.ly/qvKjP0" target="_blank"> http://bit.ly/qvKjP0</a>, so I&#8217;m looking forward to chat of advanced FFmpeg usage and Encoding optimizations with someone of you in Los Angeles.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sonnati.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sonnati.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sonnati.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sonnati.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sonnati.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sonnati.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sonnati.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sonnati.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sonnati.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sonnati.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sonnati.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sonnati.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sonnati.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sonnati.wordpress.com/768/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=768&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sonnati.wordpress.com/2011/08/30/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-iv/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64695556c64a28845a3eb5004c9f8609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sonnati</media:title>
		</media:content>
	</item>
		<item>
		<title>FFmpeg – the swiss army knife of Internet Streaming – part III</title>
		<link>http://sonnati.wordpress.com/2011/08/19/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-iii/</link>
		<comments>http://sonnati.wordpress.com/2011/08/19/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-iii/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 10:48:56 +0000</pubDate>
		<dc:creator>sonnati</dc:creator>
				<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://sonnati.wordpress.com/?p=745</guid>
		<description><![CDATA[This is the third part of a series dedicated to FFmpeg. Here you find the first and second part. In this article we will look more closely at the parameters you need to know to encode to H.264. FFmpeg uses x264 library to encode to H.264. x264 offers a very wide set of parameters and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=745&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the third part of a series dedicated to FFmpeg. Here you find the <a title="FFmpeg – the swiss army knife of Internet Streaming – part I" href="http://sonnati.wordpress.com/2011/07/11/ffmpeg-the-swiss-army-knife-of-internet-streaming-part-i/" target="_blank">first</a> and <a title="FFmpeg – the swiss army knife of Internet Streaming – part II" href="http://sonnati.wordpress.com/2011/08/08/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-ii/" target="_blank">second</a> part. In this article we will look more closely at the parameters you need to know to encode to H.264.</p>
<p>FFmpeg uses x264 library to encode to H.264. x264 offers a very wide set of parameters and therefore an accurate control over compression. However you have to know that FFmpeg applies a parameter name re-mapping and doesn&#8217;t offer the whole set of x264 options.</p>
<p>Explain the meaning of all the parameters is a long task and it is not the aim of this article. So I&#8217;ll describe only the most important and provide some useful samples. Therefore, if you want to go deeper in the parameterization of FFmpeg, I can suggest you to read<a href="http://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping" target="_blank"> this article</a> to know the meaning of each x264 parameters and the mapping between FFmpeg and x264. To know more about the technical principles of H.264 encoding, I suggest also to take a look at the first part of my presentions at <a title="MaxEurope: Encoding video for the highest Quality" href="http://sonnati.wordpress.com/2008/12/17/maxeurope-encoding-video-for-the-highest-quality-2/" target="_blank">MAX2008</a>, <a title="H.264 best practices presentation – pdf and video recording" href="http://sonnati.wordpress.com/2009/10/13/h-264-best-practices-presentation-pdf-and-video-recording/" target="_blank">MAX2009</a> and <a title="H.264 Encoding Strategies for all screens is on AdobeTV" href="http://sonnati.wordpress.com/2010/11/02/h-264-encoding-strategies-for-all-screens-is-on-adobetv/" target="_blank">MAX2010</a>.</p>
<p><strong>ENCODING IN H.264 WITH FFMPEG<br />
</strong></p>
<p>Let’s start analyzing a sample command line to encode in H.264 :</p>
<p><strong><em>ffmpeg -i INPUT -r 25 -b 1000k –s 640&#215;360 -vcodec libx264 -flags +loop -me_method hex -g 250 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 3 -b_strategy 1 -i_qfactor 0.71 -cmp +chroma -subq 8 -me_range 16 -coder 1 -sc_threshold 40 -flags2 +bpyramid+wpred+mixed_refs+dct8x8+fastpskip -keyint_min 25 -refs 3 -trellis 1 –level 30 -directpred 1 -partitions -parti8x8-parti4x4-partp8x8-partp4x4-partb8x8 -threads 0 -acodec libfaac -ar 44100 -ab 96k -y OUTPUT.mp4</em></strong></p>
<p>This command line encodes the INPUT file using a framerate of 25 Fps (<strong>-r</strong>), a target bitrate of 1000Kbit/s (<strong>-b</strong>), a gop max-size of 250 frames (<strong>-g</strong>), 3 b-frames (<strong>-bf</strong>) and resizing the input to 640&#215;360 (<strong>-s</strong>). The level is set to 3.0 (<strong>-level</strong>), the entropy coder to CABAC (<strong>-coder 1</strong>) and the number of reference frames to 3 (<strong>-refs</strong>). The profile is determined by the presence of b-frames, dct8x8 and Cabac, so it is an <em>high-profile</em>. Notice the syntax to enable/disable options in the multi options parameters like<strong> -partitions</strong>, <strong>-flags2</strong> and <strong>-cmp</strong>. The string <strong>&#8220;<em>-flags2 +bpyramid+wpred+mixed_refs+dct8x8&#8243;</em></strong> means that you are enabling b-pyramid, weighted prediction, mixed references frames and the use of the 8&#215;8 dct. So for example, if you want to disable dct8x8 to generate an output compliant with the <em>main-profile</em>, you can do that changing the previous string to <strong>&#8220;</strong><em><strong>-flags2 +bpyramid+wpred+mixed_refs-dct8x8&#8243;</strong> (notice the &#8220;-&#8221; character in front of dct8x8 instead of &#8220;+&#8221;).</em> Disabling dct8x8 you obtain a <em>main profile</em>, disabling also <em>b-frames</em> and CABAC (setting &#8220;<strong><em>-bf 0</em></strong>&#8221; and  &#8220;<strong><em>-codec 0</em></strong>&#8220;) you obtain a <em>baseline-profile</em>.</p>
<p>Profiles and Levels are very important for device compatibility so it is important to know how to produce a specific profile and level pair. You find a short primer to profiles and levels <a href="http://sonnati.wordpress.com/2008/10/25/a-primer-to-h-264-levels-and-profiles/" target="_blank">here</a> and generic raccomandations for multi device encoding <a href="http://www.adobe.com/devnet/devices/articles/mobile_video_encoding.html" target="_blank">here</a>.</p>
<p><strong>MAIN PARAMETERS<br />
</strong></p>
<p>Here you find a short explanation of the most significative parameters. <strong><br />
</strong></p>
<p><strong>-me_method</strong></p>
<p>Sets the accuracy of the search method in motion estimation. Allowed values: <strong>dia </strong>(fastest), <strong>hex</strong>, <strong>umh</strong>, <strong>full </strong>(slowest). Dia is usually used for first pass encoding only and full is too slow and not significantly better than umh. For single pass encoding or the second pass in multi-pass encoding use umh or hex depending by encoding speed requirements or constraints.</p>
<p><strong>-subq</strong></p>
<p>Sets the accuracy of motion vectors. Accepts values in the range 1-10. Use lower values like 1-3 for first pass and higher values like 7-10 for the second pass. Again, the effective value depends by a quality/speed tradeoff.</p>
<p><strong>-g, -keyint_min, -sc_threshold</strong></p>
<p>x264 uses by default a dynamic gop size. <strong>-g</strong> selects the max gop size, <strong>-keyint_min</strong> the min size. <strong>–sc_threshold</strong> is the Scene Change sensitivity (0-100). At every scene change a new i-frame (intra compressed frame) is inserted. Depending by <strong>-g</strong> and -<strong>keyint_min</strong> an I-frame (IDR frame alias keyframe) is inserted instead. The gop can be long (i.e. -g 300) for compression efficiency sake, or short (i.e. 25/50) for accessibility sake. This depends by what you need to achieve and by the delivery technique used (when using RTMP streaming you can seek to every frame, with progressive downloading only to IDRs). Sometimes you may need to have a consistent, contant gop size across multiple bitrates (i.e. for Http Dynamic Streaming or HLS). To do that set min and max gop size equal and disable completely scene change (i.e. <em><strong>-g 100 -keyint_min 100 -sc-threashold 0</strong></em>).</p>
<p><strong>-bf, b-strategy</strong></p>
<p>-bf sets the max number of consecutive b-frames (H.264 supports up to 16 b-frames). Remember that b-frames are not allowed in baseline profile. B-strategy defines the technique used for b-frames placement.</p>
<p>Use 0 to disable dynamic placement.<br />
Use 1 to enable a fast-choice technique for dynamic placement. Fast but less accurate.<br />
Use 2 to enable a slow-and-accurate mode. Can be really slow if used with an high number of b-frames.</p>
<p><strong>-refs</strong></p>
<p>sets the number of reference frames (H.264 supports up to 16 reference frames). Influences the encoding time. Using more than  4-5 refs gives commonly very little or null gain.</p>
<p><strong> -partitions</strong></p>
<p>H.264 supports several partitions modes for MBs estimation and compensation. P-macroblocks can be subdivided into 16&#215;8, 8&#215;16, 8&#215;8, 4&#215;8, 8&#215;4, and 4&#215;4 partitions. B-macroblocks can be divided into 16&#215;8, 8&#215;16, and 8&#215;8 partitions. I-macroblocks can be divided into 4&#215;4 or 8&#215;8 partitions. Analyzing more partition options improves quality at the cost of speed. The default in FFmpeg is to analyze all partitions except p4x4 (p8x8, i8x8, i4x4, b8x8). Note that i8x8 requires 8x8dct, and is the only partition High Profile-specific. p4x4 is rarely useful (i.e. for small frame size). <strong></strong></p>
<p><strong>-b, -pass, -crf, -maxrate, -bufsize</strong></p>
<p>-b sets the desired bitrate that will be achieved using a single pass or multi-pass process using the -pass parameter. -crf define a desired average quality instead of a target bitrate.<br />
These are all options retalted to bitrate allocation and rate control. Rate Control is a key area of video encoding and deserves a wider description.<strong><br />
</strong></p>
<p><strong>RATE CONTROL OPTIONS<br />
</strong></p>
<p><strong></strong>Particular attention must be paid to the Rate Control mode used. x264 supports different rate control techniques: Average Bit Rate (ABR), Costant Bit Rate (CBR), Variable Bit Rate (VBR at constant quality or constant quantization). Furthermore it is possible to use 1, 2 or more passes.</p>
<p><strong>MultiPass encoding<br />
</strong></p>
<p>FFmpeg supports multi pass encoding. The most common is the 2 pass encoding. In the first pass the encoder collects informations about the video&#8217;s complexity and create a stat file. In the 2<sup>nd</sup> pass the stat file is used for final encoding and better bit allocation. This is the generic syntax:</p>
<p><strong>ffmpeg -i input -pass 1 [parameters] output.mp4</strong><br />
<strong>ffmpeg -i input -pass 2 [parameters] output.mp4</strong></p>
<p>-pass 1 tells to FFmpeg to analize video and write a stat file. -pass 2 tells to read the stat file and encode accordingly. Exist also a -pass 3 option that read and update the stat. So if you want to do a 3-pass encoding the correct sequence is:</p>
<p><strong>ffmpeg -i input -pass 1 [parameters] output.mp4</strong><br />
<strong>ffmpeg -i input -pass 3 [parameters] output.mp4</strong><br />
<strong> ffmpeg -i input -pass 2 [parameters] output.mp4</strong></p>
<p>3-pass encoding is rarely useful.<strong></strong></p>
<p><strong>ABR</strong></p>
<p>Average Bitrate is the default rate control mode. Simply set the desired target average bitrate using -b. Remember that the bitrate can fluctuate freely locally and only the average value over the whole video duration is controlled. ABR can be performed with 1 or 2 pass but I suggest to always use a 2-pass for better data allocation.</p>
<p><strong>CBR</strong></p>
<p><strong></strong>Using the VBV model (Video Bitrate Verifier) it&#8217;s possible to obtain CBR encoding with custom buffer control. For example, to encode in canonical CBR mode use:</p>
<p><strong>ffmpeg -i input -b 1000k -maxrate 1000k -bufsize 1000k [parameters] output.mp4</strong></p>
<p>CBR encoding can be performed in single pass or multi pass. Single pass CBR is sufficiently efficient.<br />
<strong><br />
VBR</strong></p>
<p>libx264 supports two unconstrained VBR modes. In pure VBR you don&#8217;t know the final average bitrate of your video but you set a target quality (or quantization) that is applied by the encoder across the whole video.</p>
<p><strong>-cqp</strong> sets a costant quantization for each frame. It is rarely useful.<br />
<strong>-crf</strong> (Constant Rate Factor) sets a target quality factor and lets the encoder to change the quantization depending by frame type and sequence complexity. Adaptive Quantization and MB-Tree techniques change quantization at macroblock level according to macroblock importance. The -crf factor can usually be chosen in the range 18 (trasparent quality) to 30-35 (low quality, but the perceived quality depends by frame resolution and device dpi).</p>
<p>Usually VBR encoding is performed in single pass.<strong><br />
</strong></p>
<p><strong>SIMPLIFY YOUR LIFE USING PRESETS</strong></p>
<p>Fortunately it is possible to avoid long command lines using pre-defined or custom encoding settings. Indeed I do not like very much this approach because there are a lot of cases when you need to have an accurate control over the parameters like in the case of HLS or HDS. But I recognise that the use of presets can save a lot of time in every-day works.</p>
<p>Profiles are simply a set of parameters enclosed in a profile file which you find in the <em>ffpresets</em> folder after unzipping the FFmpeg build package. Presets can change depending by the version of FFmpeg you have, so the best is to take a look at the content of the preset file. Commonly you will find a set of quality preset like <strong>libx264-hq.ffpreset </strong>or<strong>  <strong>libx264-slow.ffpreset</strong> </strong>, first pass presets like <strong>libx264-hq_firstpass.ffpreset</strong> and constraints presets like<strong> libx264-main.ffpreset </strong>or <strong><strong>libx264-baseline.ffpreset </strong><br />
</strong></p>
<p>So, to make a 2-pass encoding in baseline profile with the HQ preset you can use a command like this:</p>
<p><em><strong>ffmpeg -i INPUT -pass 1 -an -vcodec libx264 -vpre hq_firstpass -vpre baseline -b 1000k -s 640&#215;360 OUTPUT.mp4</strong></em><br />
<em><strong>ffmpeg -i INPUT -pass 2 -acodec libfaac -ab 96k -ar 44100 -vcodec libx264 -vpre hq -b 1000k -vpre baseline -s 640&#215;360 OUTPUT.mp4</strong></em></p>
<p>Notice that the constrains preset is applyed with a second -vpre and that the first pass has the audio encoding disabled.<br />
Sometimes I have had problems with presets in Windows. You can bypass problems locating the presets simply using<strong> -fpre</strong> instead of -vpre. When using -fpre you must specify the absolute path to the preset file and not only the short name like in -vpre.</p>
<p><strong>ENCODING FOR DIFFERENT DEVICES</strong></p>
<p>Using the constraits presets it is possible to encode for mobile devices that usually require baseline profile to enable hardware acceleration. This limit is rapidly being surpassed by current hardware and operative systems. But if you need to target older devices (for example iOS 3 devices) and newer with the same video it&#8217;s still necessary to be able to generate easily video compliant to baseline profile. You find other generic raccomandations for multi device encoding <a href="http://www.adobe.com/devnet/devices/articles/mobile_video_encoding.html" target="_blank">here</a>.</p>
<p><strong>THE NEXT PART</strong></p>
<p>In this part we have seen how to encode to H.264 using FFmpeg as well as the richness of encoding parameters. In the next and last part of this series we will see how to leverage the FFmpeg support for RTMP streaming to enhance the Flash Video Ecosystem capabilities.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sonnati.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sonnati.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sonnati.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sonnati.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sonnati.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sonnati.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sonnati.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sonnati.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sonnati.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sonnati.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sonnati.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sonnati.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sonnati.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sonnati.wordpress.com/745/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=745&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sonnati.wordpress.com/2011/08/19/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-iii/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64695556c64a28845a3eb5004c9f8609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sonnati</media:title>
		</media:content>
	</item>
		<item>
		<title>FFmpeg – the swiss army knife of Internet Streaming – part II</title>
		<link>http://sonnati.wordpress.com/2011/08/08/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-ii/</link>
		<comments>http://sonnati.wordpress.com/2011/08/08/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-ii/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 23:20:14 +0000</pubDate>
		<dc:creator>sonnati</dc:creator>
				<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://sonnati.wordpress.com/?p=686</guid>
		<description><![CDATA[This is the second part of a small series about FFmpeg (you can find here the intro). After the short introduction of the previous post, now it&#8217;s time to see FFmpeg in action. This post is dedicated to the most important parameters and end with an example of transcoding to H.264. FFmpeg supports hundreds of AV [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=686&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the second part of a small series about FFmpeg (you can find<a title="FFmpeg – the swiss army knife of Internet Streaming – part I" href="http://sonnati.wordpress.com/2011/07/11/ffmpeg-the-swiss-army-knife-of-internet-streaming-part-i/" target="_blank"> here </a>the intro).</p>
<p>After the short introduction of the previous post, now it&#8217;s time to see FFmpeg in action. This post is dedicated to the most important parameters and end with an example of transcoding to H.264. FFmpeg supports hundreds of AV formats and codecs as input and output (for a complete list type <strong>ffmpeg -formats</strong> and <strong>ffmpeg -codecs</strong>) but you know that nowadays the most important output format is without doubt H.264.</p>
<p>H.264 is supported by Flash (99% of computers + mobile), iOS, Android, BlackBerry, low-end mobile devices, STBs and Connected TVs. So why target different formats ? A streaming professional has primarily to master H.264. Other formats are marginal, even Google&#8217;s VP8 which is still in a too early phase of adoption.</p>
<p>FFmpeg is vast subject, so I&#8217;ll focus on what I think to be the most important options and a useful selection of command lines. But first of all, how to find a build of FFmpeg to start managing your video?</p>
<p>FFmpeg, for various reasons, is provided officially only as source files. So you have to compile it by yourself for your platform, otherwise you can easily find &#8220;unofficial builds&#8221; of FFmpeg <a href="http://www.videohelp.com/tools/ffmpeg" target="_blank">here</a> or simply Googling. Be aware that a generic unofficial build can lack some library like <em>libfaac</em> (for AAC encoding) or <em>librtmp</em> (for RTMP support), in this case some of the following examples may throw an error message. The list of all libraries included during compilation is listed in the screen message that appear in console when you launch FFmpeg.</p>
<p><strong>KEY PARAMETERS</strong></p>
<p>This is the base structure of an FFmpeg invocation:</p>
<p><strong>ffmpeg -i input_file [...parameter list...] output_file</strong></p>
<p><em>Input_file</em> and <em>output_file</em> can be defined not only as file system objects but a number of protocols are supported: <strong>file, http, pipe, rtp/rtsp, raw udp, rtmp</strong>. I&#8217;ll focus on the possiblity to use RTMP as input and/or output in the fourth part of this series, while in the following examples I&#8217;ll use only the local file option.</p>
<p>FFmpeg supports litterally hundreds of parameters and options. Very often, FFmpeg infers the parameters from the context, for example the input or output format from the file extention and it also applies default values to unspecified parameters. Sometimes it is instead necessary to specify some important parameters to avoid errors or to optimize the encoding.</p>
<p>Let’s start with a selection of the most important, not codec related, parameters:</p>
<pre>-formats   print the list of supported file formats
-codecs    print the list of supported codecs (E=encode,D=decode)
-i         set the input file. Multiple -i switchs can be used
-f         set video format (for the input if before of -i, for output otherwise)
-an        ignore audio
-vn        ignore video
-ar        set audio rate (in Hz)
-ac        set the number of channels
-ab        set audio bitrate
-acodec    choose audio codec or use “copy” to bypass audio encoding
-vcodec    choose video codec or use “copy” to bypass video encoding
-r         video fps. You can also use fractional values like 30000/1001 instead of 29.97
-s         frame size (w x h, ie: 320x240)
-aspect    set the aspect ratio i.e: 4:3 or 16:9
-sameq     ffmpeg tries to keep the visual quality of the input
-t N       encode only N seconds of video (you can use also the hh:mm:ss.ddd format)
-croptop, -cropleft, -cropright, -cropbottom   crop input video frame on each side
-y         automatic overwrite of the output file
-ss        select the starting time in the source file
-vol       change the volume of the audio
-g         Gop size (distance between keyframes)
-b         Video bitrate
-bt        Video bitrate tolerance
-metadata  add a key=value metadata </pre>
<p><strong></strong> </p>
<p><strong>COMMAND LINES EXAMPLES</strong></p>
<p>And now let&#8217;s combine these parameters to manipulate AV files:</p>
<p><strong></strong> </p>
<p><strong>1. Getting info from a video file</strong></p>
<p> <em>ffmpeg -i video.mpg</em></p>
<p>Useful to retrieve info from a media file like audio/video codecs, fps, frame size and other params. You can parse the output of the command line in a script redirecting the <em>stderr</em> channel to a file with a command like this:</p>
<p><em> ffmpeg –i inputfile 2&gt;info.txt</em></p>
<p><em></em> </p>
<p><strong>2. Encode a video to FLV</strong></p>
<p><em>ffmpeg –i input.avi –r 15 –s 320&#215;240 –an video.flv</em></p>
<p>By default FFmpeg encodes flv files in the old Sorenson’s Spark format (H.263). This can be useful today only for compatibility with older systems or if you wanto to encode for a Wii (which supports only Flash Player 7).<br />
Before the introduction of H.264 in Flash Player I was used to re-encode the FLVs recorded by FMS with a command like this: </p>
<p><em>ffmpeg –i input.flv –acodec copy –sameq output.flv </em></p>
<p>This produced a file 40-50% smaller with the same quality of the input, preserving at the same time the Nellymoser ASAO audio codec which was not supported by FFmpeg in such days and therefore not encodable in something else.</p>
<p>Today you can easily re-encode to H.264 and also transcode ASAO or Speex to something else.</p>
<p>VP6 codec (Flash Player 8+) is officially supported only in decoding.</p>
<p><strong></strong> </p>
<p><strong>3. Encode from a sequence of pictures</strong> </p>
<p><em>ffmpeg -f image2 -i image%d.jpg –r 25 video.flv</em></p>
<p>Build a video from a sequence of frame with a name like image1.jpg,image2.jpg,..,imageN.jpg<br />
Is it possible to use different naming conventions like image%3d.jpeg where FFmpeg search for file with names like image 001.jpeg, image002.jpg, etc&#8230;The output is an FLV file at 25Fps.</p>
<p><strong></strong> </p>
<p><strong>4. Decode a video into a sequence of frames</strong></p>
<p><em>ffmpeg -i video.mp4 –r 25 image%d.jpg</em></p>
<p>Decodes the video in a sequence of images (25 images per second) with names like image1, image2, image 3, &#8230; , imageN.jpg. It&#8217;s possible to change the naming convention.</p>
<p><em>ffmpeg –i video.mp4 –r 0.1 image%3d.jpg</em></p>
<p>Decodes a picture every 10 seconds (1/0.1=10). Useful to create a thumbnail gallery for your video. In this case the putput files have names like image001, image002, etc. </p>
<p><em>ffmpeg –i video.mp4 –r 0.1 –t 20 image%3d.jpg</em></p>
<p>Extracts 2-3 images from the first 20 seconds of the source. </p>
<p><strong></strong> </p>
<p><strong>5. Extract an image from a video</strong></p>
<p><em>ffmpeg -i video.avi -vframes 1 -ss 00:01:00 -f image2 image-%3d.jpg</em></p>
<p>This is a more accurate command for image extraction. It extracts only 1 single frame (-vframes 1) starting 1min from the start of the video. The thumbnail will have the name image-001.jpg.</p>
<p><em>ffmpeg -i video.avi -r 0.5 -vframes 3 -ss 00:00:05 -f image2 image-%3d.jpg</em></p>
<p>In this case FFmpeg will extract 3 frames, each every 1/0.5=2seconds, starting from time 5s. Useful for video CMS where you want to offer a selection of thumbnails and a backend user choose the best one.</p>
<p><strong></strong> </p>
<p><strong>6. Extract only audio track without re-encoding</strong> </p>
<p><em>ffmpeg -i video.flv -vn -acodec copy audio.mp3</em></p>
<p>Here I assume that the audio track is an mp3. Use audio.mp4 if it is AAC or audio.flv if it is ASAO or Speex. Similarly you can extract the video track without re-encoding.</p>
<p><strong></strong> </p>
<p><strong>7. Extract audio track with re-encoding</strong></p>
<p><em>ffmpeg -i video.flv -vn -ar 44100 -ac 2 -ab 128k -f mp3 audio.mp3</em></p>
<p>This command extract audio and transcode to MP3. Useful when the video.flv is saved by FMS and has an audio track encoded with ASAO or Speex.</p>
<p><em>ffmpeg –i video.flv –vn –acodec libaac –ar 44100 –ac 2 –ab 64k audio.mp4</em></p>
<p>The same as above but encoded to AAC. </p>
<p><strong></strong> </p>
<p><strong>8. Mux audio + video</strong></p>
<p><em>ffmpeg -i audio.mp4 -i video.mp4 output.mp4</em></p>
<p>Depending by the content of the input file you may need to use the map setting to choose and combine the audio video tracks correctly. Here I suppose to have an audio only and video only input files.</p>
<p><strong></strong> </p>
<p><strong>9. Change container</strong></p>
<p><em>ffmpeg –i input.mp4 –acodec copy –vcodec copy output.flv</em></p>
<p>I use this to put h.264 in FLV container, sometimes it is useful. This kind of syntax will come back when we will talk about FFmpeg and RTMP.</p>
<p><strong></strong> </p>
<p><strong>10. Grab from a webcam</strong></p>
<p>On Linux it is easy to use an audio or video grabbing device as input to FFmpeg:</p>
<p><em>ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 out.flv</em></p>
<p>On windows it is possible to use vfwcap (only video) or direct show (audio and video):</p>
<p><em>ffmpeg -r 15 -f vfwcap -s 320&#215;240 -i 0 -r 15 -f mp4 webcam.mp4</p>
<p>ffmpeg -r 15 -f dshow -s 320&#215;240 -i video=&#8221;video source name&#8221;:audio=&#8221;audio source name&#8221; webcam.flv</em></p>
<p>Notice here that the parameters –r –f –s are setted before –i.</p>
<p><strong></strong> </p>
<p><strong>11. Extract a slice without re-encoding</strong></p>
<p><em>ffmpeg -i input -ss 00:01:00 -tt 00:01:00 -acodec copy -vcodec copy output.mp4</em></p>
<p>Extract 1min of video starting from time 00:01:00. Be aware that putting the -ss and -tt parameters before or after -i may have different effects.</p>
<p><strong></strong> </p>
<p><strong>12. Make a video file from a single frame</strong></p>
<p><em>ffmpeg -loop_input -vframes 1 -i frame.jpg -t 10s -r 25 output.mp4</em></p>
<p>Generate a video with 25Fps and length 10s from a single frame. Playing with -vframes it is possible to loop a sequence of frames and so loop on entire input video.</p>
<p><strong></strong> </p>
<p><strong>13. Add metadata</strong></p>
<p><em>ffmpeg -i input.flv -vcodec copy -acodec copy -metadata title=&#8221;MyVideo&#8221; output.flv</em></p>
<p>Useful to change or add metadata like resolution, bitarate or other info</p>
<p><strong>14. Encode to H.264</strong></p>
<p>Let’s conclude this second part of the series with an example of encoding to H.264 + AAC. In the example above I have used, for simplicity sake, FLV or MP4 output. But to encode to H.264 you have to explicitly set the output codec and some required parameters.</p>
<div>
<p><em>ffmpeg -y -i input.mov -r 25 -b 1000k -vcodec libx264 -pass 1 -vpre fastfirstpass -an output.mp4</em><br />
<em>ffmpeg -y -i input.mov -r 25 -b 1000k -vcodec libx264 -pass 2 -vpre hq -acodec libfaac -ac 2 -ar 44100 -ab 128k output.mp4</em></p>
<p>This first example tells FFmpeg to use the libx264 to produce a H.264 output. We are using a two pass encoding (-pass 1 generate only a stat file that will be used by a second pass). The -vpre option tells FFmpeg to use the preset file &#8220;fastfirstpass&#8221; that its found in the preset folder of the FFmpeg installation directory. The second line performs the second pass using a more accurate preset (-vpre hq) and adds the audio encoding.</p>
<p>FFmpeg use a dedicated remapping of the most important parameters of libx264. x264 has an high number of parameters and if you know what you are doing you can also set each of them individually instead of using a predefined preset. This is an example of two pass encoding without preset:</p>
<p><em>ffmpeg -y -i input -r 25 -b 1000k -vcodec libx264 -pass 1 -flags +loop -me_method dia -g 250 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 3 -b_strategy 1 -i_qfactor 0.71 -cmp +chroma -subq 1 -me_range 16 -coder 1 -sc_threshold 40 -flags2 -bpyramid-wpred-mixed_refs-dct8x8+fastpskip -keyint_min 25 -refs 3 -trellis 0 -directpred 1 -partitions -parti8x8-parti4x4-partp8x8-partp4x4-partb8x8 -an output.mp4</em></p>
<p><em>ffmpeg -y -i input -r 25 -b 1000k -vcodec libx264 -pass 2 -flags +loop -me_method umh -g 250 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 3 -b_strategy 1 -i_qfactor 0.71 -cmp +chroma -subq 8 -me_range 16 -coder 1 -sc_threshold 40 -flags2 +bpyramid+wpred+mixed_refs+dct8x8+fastpskip -keyint_min 25 -refs 3 -trellis 1 -directpred 3 -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -acodec libfaac -ac 2 -ar 44100 -ab 128k output.mp4</em></p>
</div>
<p><strong>IN THE NEXT PART</strong></p>
<p>In this second part of the series we have taken a look at the most important &#8220;not codec related&#8221; features of FFmpeg. <br />
The next part will entirely dedicated to how encode to H.264 using FFmpeg and libx264. Stay tuned.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sonnati.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sonnati.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sonnati.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sonnati.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sonnati.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sonnati.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sonnati.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sonnati.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sonnati.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sonnati.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sonnati.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sonnati.wordpress.com/686/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sonnati.wordpress.com/686/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sonnati.wordpress.com/686/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=686&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sonnati.wordpress.com/2011/08/08/ffmpeg-%e2%80%93-the-swiss-army-knife-of-internet-streaming-%e2%80%93-part-ii/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64695556c64a28845a3eb5004c9f8609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sonnati</media:title>
		</media:content>
	</item>
		<item>
		<title>I&#8217;ll speak about Encoding at MAX 2011</title>
		<link>http://sonnati.wordpress.com/2011/07/19/ill-speak-about-encoding-at-max-2011/</link>
		<comments>http://sonnati.wordpress.com/2011/07/19/ill-speak-about-encoding-at-max-2011/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 09:13:20 +0000</pubDate>
		<dc:creator>sonnati</dc:creator>
				<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://sonnati.wordpress.com/?p=688</guid>
		<description><![CDATA[This is my fourth partecipation to Adobe MAX as a speaker. I&#8217;ll be in Los Angeles in October to speak about what I know most: encode video at best for every device. Every edition I have had very good feedbacks from the audience so I thank you all and this year I want to follow [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=688&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://max.adobe.com/?sdid=ISMTQ"><img class="alignleft" style="margin:12px;" src="http://www.adobe-max.com/published/adobemax2011/global_files/MAX11_125x125_SPEAKER_dancers.jpg" alt="" width="125" height="125" /></a>This is my fourth partecipation to Adobe MAX as a speaker. I&#8217;ll be in Los Angeles in October to speak about what I know most: <strong>encode video at best for every device.</strong></p>
<p>Every edition I have had very good feedbacks from the audience so I thank you all and this year I want to follow a request I have had often from many attendees: <strong>how to get the max out of FFmpeg ?</strong></p>
<p>So let&#8217;s take a look at the abstract of my session this year:</p>
<p><strong>Encoding for Performance on Multiple Devices</strong></p>
<div><em>Learn how to create amazing H.264 video that performs well on multiple devices from one of the industry masters. The session will begin by discussing the fundamentals of encoding H.264 for Adobe Flash Player and will focus on using techniques using FFMPEG for live and on demand encoding. We&#8217;ll also cover hardware acceleration and optimizing H.264 for tablets and smartphones. Find out Adobe&#8217;s recommendations for video encoding for HTTP delivery and how you can make your video look great.</em></div>
<div>In the session I&#8217;ll speak about encoding vod and live with Adobe  products but also with FFmpeg. I&#8217;ll discuss some tricks and tips about encoding but most of all about how to use this tool to overcome some limitations of the Flash Video platform. Furthermore,<br />
a specific chapter of the presentation will be dedicated to encoding and delivery optimizations for AIR apps on iOS devices.</div>
<div>So, if you are at MAX2011 on Monday, October 3, from 3:30 p.m. &#8211; 4:30 p.m. you know where to find me!</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sonnati.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sonnati.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sonnati.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sonnati.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sonnati.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sonnati.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sonnati.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sonnati.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sonnati.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sonnati.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sonnati.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sonnati.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sonnati.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sonnati.wordpress.com/688/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=688&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sonnati.wordpress.com/2011/07/19/ill-speak-about-encoding-at-max-2011/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64695556c64a28845a3eb5004c9f8609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sonnati</media:title>
		</media:content>

		<media:content url="http://www.adobe-max.com/published/adobemax2011/global_files/MAX11_125x125_SPEAKER_dancers.jpg" medium="image" />
	</item>
		<item>
		<title>FFmpeg &#8211; the swiss army knife of Internet Streaming &#8211; part I</title>
		<link>http://sonnati.wordpress.com/2011/07/11/ffmpeg-the-swiss-army-knife-of-internet-streaming-part-i/</link>
		<comments>http://sonnati.wordpress.com/2011/07/11/ffmpeg-the-swiss-army-knife-of-internet-streaming-part-i/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 11:35:57 +0000</pubDate>
		<dc:creator>sonnati</dc:creator>
				<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://sonnati.wordpress.com/?p=640</guid>
		<description><![CDATA[With this post I want to start a small series dedicated to FFmpeg. I have already talked about it 6 years ago when this tool was still young (Why I love FFmpeg: post1 and post2) but in these 6 years it has evolved widely and now it is a really useful &#8220;swiss army knife&#8221; for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=640&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With this post I want to start a small series dedicated to <strong>FFmpeg</strong>. I have already talked about it 6 years ago when this tool was still young (<em>Why I love FFmpeg: <strong><a title="Why I love FFMPEG: Intro." href="http://sonnati.wordpress.com/2005/12/27/why-i-love-ffmpeg-intro/" target="_blank">post1</a></strong> and <strong><a title="Why I love FFMPEG: Flexibility, interoperability, encoding options." href="http://sonnati.wordpress.com/2005/12/30/why-i-love-ffmpeg-flexibility-interoperability-encoding-options/" target="_blank">post2</a></strong></em>) but in these 6 years it has evolved widely and now it is a really useful <em>&#8220;swiss army knife&#8221;</em> for Internet streaming. I could define FFmpeg also as <strong>one of the pilllars of Internet Video</strong>. Sites like YouTube, Vimeo, Google video and the entire trend of UGC would not exist without FFmpeg. It is an exceptionally flexible tool that can be very useful for who works in the streaming business and most of all it is open source and free.</p>
<p><strong>A brief history of FFmpeg</strong></p>
<p><em>From wikipedia:</em><strong><br />
<em>&#8220;FFmpeg</em></strong><em> is a free software / open source project that produces libraries and programs for handling multimedia data. The most notable parts of FFmpeg are <strong>libavcodec</strong>, an audio/video codec library used by several other projects, <strong>libavformat</strong>, an audio/video container mux and demux library, and the <strong>ffmpeg</strong> command line program for transcoding multimedia files. FFmpeg is published under the GNU Lesser General Public License 2.1+ or GNU General Public License 2+ (depending on which options are enabled). The project was started by Fabrice Bellard, and has been maintained by Michael Niedermayer since 2004.&#8221;</em></p>
<p>So FFmpeg is the command line program that using libavcodec, libavformat and several other open source programs (notably x264 for H.264 encoding) offers exceptional transcoding capabilities especially for server side batch transcoding, but also for live encoding and audio/video files manipulation (muxing, demuxing, slicing, splitting and so on).</p>
<p><strong>Me and FFmpeg</strong></p>
<p>I started to study video encoding optimization during University and in the last decade I have used several open source and commercial encoders and defined my own original approaches and optimizations to encoding (take a look at <a href="http://sonnati.wordpress.com/best-of-blog/" target="_blank">best <strong>articles</strong></a> page for some experiments). But encoding video and streaming became a business for me only after the release of FMS and Flash Player 6 in the late 2002. In the next years I developed several real time communication programs for my clients and a couple products. One of these was the &#8220;BlackBox&#8221; (2005), an HW/SW appliance that acquired multiple video sources using a Flash front-end and a FMS back-end. The system not only acquired video but provided also video editing features.</p>
<p>And here started my FFmpeg discovery. I needed a tool, possibly free, to manipulate FLV (cut, join, resize, re-encode, etc&#8230;) to provide the primitive operations of video editing. Being a .net developer I created my own tools (especially for splitting and joining) but then I found FFmpeg to be the best solution to do the most complex parts of the work. So my confidence with FFmpeg dates back to 2005. Around the same year Youtube started to use it as a free and fast way to encode (almost) any video format in input to a common output format (Sorenson&#8217;s Spark) for playback in Flash&#8230; you know the rest of the story.</p>
<p>Services like Youtube could not afford massive video transcoding using commercial solutions, so a tool like FFmpeg has been of fundamental importance for the sostenibility of their business model. This is why I defined FFmpeg as one of the pillars of Internet Video.</p>
<p><strong>What is it possible to do with FFmpeg ?</strong></p>
<p>The most obvious functionality is the decoding and encoding of audio and video files (transcoding). FFmpeg accepts an exceptional number of formats in input and is capable to decode, process (resize, change fps, filter, deinterlace, and so on) and finally encode to several output formats. But it can do a lot of other useful tasks like extract the elementary AV streams from a container, mux elementary streams in a new container, cut portions from a video, extract track informations.</p>
<p>These are features that FFmpeg has from many years while only more recently has been added the support for RTMP protocol (librtmp)</p>
<p>I think that, for an Internet Streaming professional, this has become one of the most important feature of FFmpeg. Before, if you wanted to acquire streams or push streams to a server in live mode you needed to use the RTP/RTSP protocol, but it is too complex and the implementation not really stable. On the other hand, RTMP is a simple yet powerful protocol and most important of all, it is supported by FMS and Wowza which are the most used streaming server in the last 5 years.</p>
<p>For example with librtmp it is possible to:</p>
<p>1. Connect to FMS, subscribe a live or vod stream and record it to file system.<br />
2. Connect to FMS, subscribe a stream, transcode and publish a new version to a different or the same FMS.<br />
3. Publish a local video file to FMS to simulate live streaming (with or without transcoding).<br />
4. Acquire a live feed on the local PC, transcode and publish to FMS.</p>
<p><strong>The series</strong></p>
<p>After this conceptual introduction I&#8217;ll write a series of articles on how to use FFmpeg for base tasks (decode, encode, mux) and than for advanced task (live transcoding with FMLE and FMS).</p>
<p>Concluding I like to underline that with a smart usage of FFmp an dRTMP it is possible to create infine combinations and overcome current limitations of Flash Video platform.<br />
For example, one of the most interesting consequence of the point 3 is that using this tool and Wowza Media Server (or the next release of FMS which will offer HLS compatibility to stream to iOS devices) it is possible to transcode on-the-fly a stream generated by Flash Player (sorenson + asao or speex) to HLS for  consumption on iOS devices&#8230;not bad&#8230;but we will talk about this in a next post, stay tuned and follow the discussion on my twitter account too (<a href="http://twitter.com/sonnati" target="_blank">@sonnati</a>).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sonnati.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sonnati.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sonnati.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sonnati.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sonnati.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sonnati.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sonnati.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sonnati.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sonnati.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sonnati.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sonnati.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sonnati.wordpress.com/640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sonnati.wordpress.com/640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sonnati.wordpress.com/640/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sonnati.wordpress.com&amp;blog=1980824&amp;post=640&amp;subd=sonnati&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sonnati.wordpress.com/2011/07/11/ffmpeg-the-swiss-army-knife-of-internet-streaming-part-i/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64695556c64a28845a3eb5004c9f8609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sonnati</media:title>
		</media:content>
	</item>
	</channel>
</rss>
