<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nicolas Schudel &#187; Video</title>
	<atom:link href="http://nicolasschudel.name/tag/video/feed/" rel="self" type="application/rss+xml" />
	<link>http://nicolasschudel.name</link>
	<description>Balancing Design and Development in Online Media</description>
	<lastBuildDate>Sun, 09 May 2010 08:42:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Compressed, High-Performing Animations in Flash</title>
		<link>http://nicolasschudel.name/bitmap-animations/</link>
		<comments>http://nicolasschudel.name/bitmap-animations/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 01:50:22 +0000</pubDate>
		<dc:creator>Nicolas</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://nicolasschudel.name/?p=296</guid>
		<description><![CDATA[<p>Multimedia applications often have interactive elements based on video. The Flash Video data used for such scenes is compressed but processor intensive. I discuss a solution that decompresses the data on the client side, in order to enhance display performance.</p>]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>
Multimedia applications often have interactive elements based on video: For example, a pre-rendered 3D scene that moves according to a user’s interaction. The trick, in such a scene, is to play specific parts of the movie forward and backward to fake movement.
</p>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="360" id="sculpture"><param name="movie" value="/fileadmin/articles/2009/11/sculpture.swf" /><!--[if !IE]>--><object type="application/x-shockwave-flash" data="/fileadmin/articles/2009/11/sculpture.swf" width="480" height="360"><!--<![endif]--><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a><!--[if !IE]>--></object><!--<![endif]--></object>
<p class="wp-caption-text">
This sculpture has been rendered as a movie, with the camera panning 360˚around the object. <br />(Drag with the mouse to turn the object)
</p>

<h2>Embedding Animations</h2>
<p>
There are three basic ways to embed an animated scene into Flash:
</p>
<ul>
<li>In the Flash Video format (FLV);</li>
<li>As a sequence of images, e.g. PNG or JPEG;</li>
<li>As a sequence of vector graphics.</li>
</ul>
<p>
The latter is often forgotten. Tools such as <a href="http://www.cinemax4d.de/flashex/home_us.html">Cinema 4D’s FlashEx renderer</a> can export a scene as a vector animation. If the scene doesn’t contain many objects and has simple texturing, a vector animation would probably be the way to go. The file size stays relatively small, plus the graphics are scalable.
</p>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="150" id="blimp"><param name="movie" value="/fileadmin/articles/2009/11/blimp.swf" /><!--[if !IE]>--><object type="application/x-shockwave-flash" data="/fileadmin/articles/2009/11/blimp.swf" width="480" height="150"><!--<![endif]--><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a><!--[if !IE]>--></object><!--<![endif]--></object>
<p class="wp-caption-text">
A simple 3D object rendered as a vector sequence with FlashEx 2.<br />(Drag with the mouse to turn the object)
</p>
<p>
The other two methods, FLV and image sequences, are both pixel based, but have their own pros and cons. FLV has a decent quality/size ratio. <a href="http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WSBDABD69F-D146-4e5c-9340-BF717A10426C.html">Flash CS4 does not allow F4V files to be embedded directly</a>, so the best codec is the older and less compressing On2 VP6. Interacting with FLV, e.g. jumping between frames quickly or playing it backward, is heavy on the processor. Presumably, the Flash Player has to jump to the nearest proceeding keyframe and process the changes to the current frame each time. On the other end of the spectrum is the image sequence. The compression is on a per-frame basis, so the overall file size will usually turn out much bigger. The display performance, however, is far better than FLV.
</p>
<h2>Eliminating the Cons</h2>
<p>
A combination of the reduced file size of FLV and the performance of an image sequence is possible, if the data gets decompressed on the client side. H.264 encoded video data could be sent through the wire and then be processed into an uncompressed image sequence before being displayed. I wrote a class named BitmapAnimation that parses each frame of a MovieClip (including any FLVs within) and adds it to an array of bitmap data. BitmapAnimation has the same methods as a MovieClip (gotoAndPlay, currentframe etc.), so the two can be interchanged. For instance, I was able to use a BitmapAnimation in place of a MovieClip to create a MovieMaterial in Papervision3d – polymorphism works. 
</p>
<p>
When <a href="/fileadmin/flv_vs_bitmapanimation.zip">compared with simultaneously running FLVs</a>, BitmapAnimations showed a <strong>500% performance increase</strong> on my system. The difference was even bigger with the clips running backward. There may be a performance benefit in converting complicated vector animations to a BitmapAnimation before they are displayed. I have, however, not recently come across a scenario where a pure vector animation alone caused the frame rate to stagnate. 
</p>
<p>
The MovieClip option cacheAsBitmap requires, to my understanding, the frame to be rendered in the Flash display list before it takes effect. This would be the only major difference to BitmapAnimation (where the image is rendered before being displayed). Enabling cacheAsBitmap on MovieClips containing FLV did not show a change in performance in my tests. Because a video is usually viewed once, it makes sense not to cache FLV by default.
</p>
<p>
There is one known drawback when using a BitmapAnimation: Depending on the size of the video and the client’s processor speed, the Flash Player could “freeze” for a few seconds while decompressing the video data. I created an additional class, where I lengthened the processing time by decompressing one frame per half-second. This would allow the video to be prepared in the background without noticeably slowing down the rest of the application. Delayed processing would work best during a loading sequence, where the video is loaded first, then converted to a BitmapAnimation, while the rest of the assets are being retrieved.
</p>
<h2>Usage</h2>
<p>Simply pass a MovieClip to the draw method.</p>
<pre class="brush: as3">
bitmapAnimation = new BitmapAnimation();
bitmapAnimation.draw(movieClip);
addChild(bitmapAnimation);
</pre>
<p>The imported bitmap data can be reused with multiple BitmapAnimations.</p>
<pre class="brush: as3">
var bitmapAnimation1:BitmapAnimation = new BitmapAnimation();
bitmapAnimation1.draw(movieClip);
var bitmapAnimation2:BitmapAnimation = new BitmapAnimation(bitmapAnimation1.bitmapSequence);
</pre>

<h2>Conclusions</h2>
<p>
Pre-rendering a complex MovieClip, such as embedded FLV, using the BitmapAnimation class, may likely show a performance increase. Also, this method may remove the need to embed an image sequence where display performance is an issue. Due to the computation time required for conversion, BitmapAnimations should not be used for long clips. Inputs and feature requests are welcome, just add a comment below.
</p>
<p><a href="/fileadmin/bitmapanimation_classes.zip">Download the classes BitmapAnimation and DelayedBitmapAnimation</a>.</p>
<p><a href="/fileadmin/blimp.zip">Download the blimp example</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://nicolasschudel.name/bitmap-animations/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Forgotten Intro Video</title>
		<link>http://nicolasschudel.name/the-forgotten-intro-video/</link>
		<comments>http://nicolasschudel.name/the-forgotten-intro-video/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 23:35:06 +0000</pubDate>
		<dc:creator>Nicolas</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://nicolasschudel.name/?p=125</guid>
		<description><![CDATA[<p>A video fellow students and I produced is revived and analyzed. The short clip was made with the theme of “stealing the show” and involves a street musician and a talented passer-by.</p>]]></description>
			<content:encoded><![CDATA[<p>“Stealing the show” has been the concept of my blog since I started it in late 2006. I already had the domain (stoletheshow.com) for quite some time before that, to host some multimedia projects. The first project, made during my studies at SAE Zurich, involved <a href="http://www.youtube.com/watch?v=2drHJUwCYJ8">a song from the band Brassy</a> with the same title &#8211; hence the name.</p>

<p>The original intro of my blog was to display a mediocre “show” (e.g. a street musician playing a song) &#8211; and then have somebody come in to outperform the original.</p>

<p>Fellow students and I made this video for my site in late 2006. The ‘bad’ guitarist is played by Andreas Dietl, the ‘good’ guitarist is  played by Gabe Hill. Gabe’s performance is awesome, the tune he played is real. He shredded the guitar so hard he cut his finger and started bleeding!</p>

<div id="player1">
	<a href="http://www.macromedia.com/go/getflashplayer">
		<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
	</a>
</div>
<script type="text/javascript">
swfobject.embedSWF(
	'http://nicolasschudel.name/wp-content/plugins/flvplayer.swf',
	'player1',
	462,
	425,
	'9.0.0',
	false, 
	{file: "/fileadmin/global/videos/sts_intro.flv"},
	{allowfullscreen: true},
	{});
</script>
<p>&nbsp;</p>
<p>The intro video was placed in the masthead of my site for a short time only. I trashed the entire site design for a more colorful version after just two months. It was a shame for the video, but the design just had to go.</p>

<p><a rel="shadowbox" href="http://nicolasschudel.name/fileadmin/articles/2009/11/sts_intro_2.jpg"><img class="alignnone size-thumbnail wp-image-129" title="sts_intro_2" src="http://nicolasschudel.name/fileadmin/articles/2009/11/sts_intro_2-150x150.jpg" alt="sts_intro_2" width="150" height="150" /></a>&nbsp;&nbsp;<a rel="shadowbox" href="http://nicolasschudel.name/fileadmin/articles/2009/11/sts_intro_1.jpg"><img class="alignnone size-thumbnail wp-image-128" title="sts_intro_1" src="http://nicolasschudel.name/fileadmin/articles/2009/11/sts_intro_1-150x150.jpg" alt="sts_intro_1" width="150" height="150" /></a></p>

<p><a href="/fileadmin/global/videos/sts_intro.flv">Download the video</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://nicolasschudel.name/the-forgotten-intro-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
