<?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>decker labs &#187; Development</title>
	<atom:link href="http://labs.eric-decker.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.eric-decker.com</link>
	<description></description>
	<lastBuildDate>Thu, 18 Aug 2011 04:16:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Video Sync Issues with Flash AS3</title>
		<link>http://labs.eric-decker.com/2011/08/video-sync-issues-with-flash-as3/</link>
		<comments>http://labs.eric-decker.com/2011/08/video-sync-issues-with-flash-as3/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 04:16:11 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Firstborn]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://labs.eric-decker.com/?p=443</guid>
		<description><![CDATA[<script type="text/javascript" src="http://labs.eric-decker.com/wp-includes/js/jquery/jquery.js"></script><script type="text/javascript" src="http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/js/sbadapter/shadowbox-jquery.js"></script><script type="text/javascript" src="http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/js/shadowbox.js"></script><script type="text/javascript"><!--
window.onload = function() {var options ={assetURL:'',loadingImage:'http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/css/images/loading.gif',flvPlayer:'http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/swf/mediaplayer.swf',animate:true,animSequence:'wh',overlayColor:'#000',overlayOpacity:0.85,overlayBgImage:'http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/css/images/overlay-85.png',listenOverlay:true,autoplayMovies:true,showMovieControls:true,resizeDuration:0.35,fadeDuration:0.35,displayNav:true,continuous:false,displayCounter:true,counterType:'default',viewportPadding:20,handleLgImages:'resize',initialHeight:160,initialWidth:320,enableKeys:true,keysClose:['c', 'q', 27],keysPrev:['p', 37],keysNext:['n', 39],handleUnsupported:'',text: {cancel:'Cancel',loading: 'loading',close:'<span class="shortcut">C</span>lose',next:'<span class="shortcut">N</span>ext',prev:'<span class="shortcut">P</span>revious',errors:{single: 'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared: 'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either: 'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}}};Shadowbox.init(options);}
--></script>It&#8217;s been almost a year exactly since my last update. I guess I&#8217;ve been pretty preoccupied. I wanted to do a post about an age old problem very often encountered in Flash &#8211; compositing video so that overlaying elements sync perfectly with a video. In essence, getting the true current frame of an FLV or F4V. Specifically [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been almost a year exactly since my last update. I guess I&#8217;ve been pretty preoccupied. I wanted to do a post about an age old problem very often encountered in Flash &#8211; compositing video so that overlaying elements sync perfectly with a video. In essence, getting the true current frame of an FLV or F4V. Specifically the problem I want to talk about tackling is having an image be composited as if it were in the video. I think a great example of this is a site we (as in Firstborn, not me) did for <a title="5 React" href="http://www.5react.com/" target="_blank">5 React</a> a year or so ago.</p>
<p>There are a couple of solutions to solve this problem that work almost perfectly 99% of the time. In general, they usually involve an XML file that contains corner points for each frame of how an image should be transformed to match the video. For live video (no CG) tracking is set up in After Effects and then the cue points are exported. While After Effects doesn&#8217;t have a native export cue points as XML option, the keyframe data can be copied &amp; pasted out as plain text, and then you can just run a simple RegEx to convert it to XML. This is all pretty simple and isn&#8217;t the problem, the issue lies with not being able to get the exact frame that a video is displaying.</p>
<p><img class="alignnone size-full wp-image-467" title="Editing in After Effects" src="http://labs.eric-decker.com/wp-content/uploads/2011/08/ae.jpg" alt="Editing in After Effects" width="600" height="400" /></p>
<p>Simply guessing the frame based on the position property doesn&#8217;t give an accurate enough result. Another option that Zeh had discovered was using decodedFrames and droppedFrames property to get the current frame. This works pretty well, but has several drawbacks as it is a total value, so looping or seeking can become a issue, and switching tabs or right clicking can throw these values out of of sync. We had also tried using cue points on every frame that would contain the frame number, or better yet as <a href="http://www.simonlindsay.co.nz/" target="_blank">Simon</a> had pointed out, you can embed the tracking values directly as values for the cue points. This works pretty well, and it eliminates the need for an XML file. However, on some Macs this doesn&#8217;t work, and the video slips and becomes out of sync with the cue point data.</p>
<p>I&#8217;ve pretty much come to the conclusion that there is no true way to get the true current frame of a video using any properties of the stream or metadata from the video. Whatever information you receive about the video you can never be sure that&#8217;s actually what pixels are being displayed. Even if you draw the video to a bitmap, you can never be sure what frame the video object is currently displaying when you copy the pixels. That is, the only way to know what frame is displayed is to actually <em>look at that frame</em>.</p>
<p>The only true thing you can trust about a displayed frame is the frame itself. Therefore, the solution I came up with is to embed the frame value into the video itself. This can be done as a small bar at the bottom of the video that is the binary value of the current frame displayed as a barcode. Then, every frame you capture the video frame, check the pixels of the barcode, and convert the binary value back to base-10 and voilà, you have the actual current frame.</p>
<p>Basically your video has an extra 10 pixels at the bottom. The first 5 pixels are the bottom 5 pixels of the video mirrored. This is to ensure that during the compression bleeding and artifacts don&#8217;t appear due to the stark contrast between the video and the barcode. The last 5 rows of pixels below the mirrored strip are the barcode. There are many options to make the barcode at the bottom of the video. Zeh wrote an After Effects expression that generates it as the video renders. I made mine externally, via Photoshop JSX. A better option than Photoshop scripting would have been processing or AIR app, but at the time I was too lazy to set either of those up and honestly I wanted to explore using JavaScript in Photoshop some more.</p>
<p style="text-align: center;"><img class="size-full wp-image-446 aligncenter" title="The 3 regions of the video file" src="http://labs.eric-decker.com/wp-content/uploads/2011/08/diagram.jpg" alt="The 3 regions of the video file" width="400" height="300" /></p>
<p>I&#8217;m not going to pretend that this solution is by any means perfect &#8211; in fact, it is far from it. There are possible performance problems  from drawing the video every frame, and the video is slightly larger so you have to crop it. The video file might be larger in size due to less compression because of the drastic difference between frames due to the barcode. The biggest drawback is that this method requires a lot more prep work. However, the payoff is perfectly synced video to frame and you can still use FLVs and F4Vs without having to embed it into the timeline in Flash or use a PNG sequence, which would increase file size greatly.</p>
<p>If you want to read some more about video frame stuff, check out <a href="http://zehfernando.com/2011/flash-video-frame-time-woes/" target="_blank">Zeh&#8217;s post</a> from a few weeks ago.</p>
<p>You can see a demo of the final result <a href="http://casestudy.edecker.net/video_sync/index.html" target="_blank">here</a> or below.</p>
<p><span id="more-443"></span></p>
<p><small>(Please open the article to see the flash file or player.)</small></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.eric-decker.com/2011/08/video-sync-issues-with-flash-as3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Doritos.com</title>
		<link>http://labs.eric-decker.com/2010/08/doritos-com/</link>
		<comments>http://labs.eric-decker.com/2010/08/doritos-com/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 01:43:56 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Firstborn]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://labs.eric-decker.com/?p=430</guid>
		<description><![CDATA[Just a quick update here, we recently relaunched the new Doritos.com, my latest project. I was lead developer on this project with much help from Lucas Motta and Michael Roushey on the flash forefront, and as always Francis Turmel as our technical Sensei. The project was done with the world renowned ad agency Goodby, Silverstein [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick update here, we recently relaunched the new <a title="Snackstrong Productions" href="http://doritos.com/" target="_blank">Doritos.com</a>, my latest project. I was lead developer on this project with much help from <a title="Lucas' Portfolio" href="http://www.lucasmotta.com/" target="_blank">Lucas Motta</a> and <a title="Roushey's Blog" href="http://mroushey.com/blog/" target="_blank">Michael Roushey</a> on the flash forefront, and as always Francis Turmel as our technical Sensei. The project was done with the world renowned ad agency <a title="Goodby" href="http://www.goodbysilverstein.com/" target="_blank">Goodby, Silverstein &amp; Partners</a>. We put a lot of hours into this site, but I think it was worth it. My job as lead developer was doing the overall structure and framework of the site. I also developed some helpful debugging utils along the way, which I hope to post on here rather soon.</p>
<p>On a side note, I also brewed a special beer for this project. It was a Doritos style ale, and you can read all about it on my other blog, <a title="Decker's Beer Logs" href="http://www.beer.eric-decker.com/2010/08/08/doritos-style-ale/" target="_blank">beer.eric-decker.com</a>. I&#8217;ll be brewing a special beer per project from now on.</p>
<p>And on another side note, today was my girlfriend&#8217;s birthday. She&#8217;s a painter and has a blog which she updates regularly with her work and progress, and you should defiantly check it out at <a title="Erin's Tumblr" href="http://eringregory.com/" target="_blank">eringregory.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.eric-decker.com/2010/08/doritos-com/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NanoTween</title>
		<link>http://labs.eric-decker.com/2010/07/nanotween/</link>
		<comments>http://labs.eric-decker.com/2010/07/nanotween/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 13:56:15 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[NanoTween]]></category>
		<category><![CDATA[tween]]></category>

		<guid isPermaLink="false">http://labs.eric-decker.com/?p=423</guid>
		<description><![CDATA[Recently I was working on preloader for a project and needed to use a tweening engine. (We have an internally developed one at Firstborn that is based off of the syntax of Tweener). I wanted to see if I could write my own that would be super small. I wasn&#8217;t as concerned with performance &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on preloader for a project and needed to use a tweening engine. (We have an internally developed one at Firstborn that is based off of the syntax of Tweener). I wanted to see if I could write my own that would be super small. I wasn&#8217;t as concerned with performance &#8211; meaning being able to tween thousands of objects at once, a highly unlikely scenario anyways. I wanted to keep compiled file size down, as well as number of classes. So I created a NanoTween class that is a super simple tweening utility. When compiled on it&#8217;s own, it only consist of about 1.3 Kb.</p>
<p>NanoTween is only one class. Each tween is created as it&#8217;s own more or less independent object. They are however synchronized to a central enter frame event dispatcher, which is kept as a static instance. Instead of providing callback functions and parameters for events such as onComplete and onUpdate (as is the case with some tween engines) NanoTween instead dispatches native Event.COMPLETE and Event.ENTER_FRAME. Additionally, the Robert Penner easing functions are externalized into separate classes to keep filesize down. Special properties such as brightness are not included, but can easily be achieved though an external proxy object.</p>
<p>The syntax looks like this:<br />
var tween:NanoTween = new NanoTween(myMovieClip, 1.5, {x:100, y:200}, Quad.easeOut);<br />
tween.addEventListener(Event.COMPLETE, hndlTweenComplete);<br />
tween.start(1);</p>
<p>The previous example will tween myMovieClip to the position (100,200) over the period of 1.5 seconds using the ease out Quad function, and is delayed by 1 second. Upon completion of the tween the hndlTweenComplete will be called. Likewise, the syntax can also be &#8216;condensed&#8217; for simple tweens:<br />
new NanoTween(myMovieClip, 1, {alpha:0}).start();</p>
<p>Anyhow, I thought it might be useful to other people, and I wanted to try out Google Code so you can grab it from the project page at: <a title="NanoTween on Google Code" href="https://code.google.com/p/nanotween/" target="_blank">https://code.google.com/p/nanotween/</a>. Once again, the purpose of this is not to replace mammoth tween engines such as gTween, TweenMax, or Tweener. Rather, it is intended for special cases where size is the main importance such as preloaders and banner ads.</p>
<p><span id="more-423"></span></p>
<p><script type="text/javascript" src="http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/js/swfobject.js"></script><span class="embedflash" id="swfid0c063580b495d49a5d63b1263d70ee57"><small>(Please open the article to see the flash file or player.)</small></span><script type="text/javascript">
				var flashvars = {}; var params = {}; var attributes = {};params.allowfullscreen = "true"; params.allowscriptaccess = "always";
				swfobject.embedSWF("http://testing.eric-decker.com/nanoTween/example01.swf","swfid0c063580b495d49a5d63b1263d70ee57","550","400","9.0.0","http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/swf/expressInstall.swf",flashvars,params,attributes);
		</script></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.eric-decker.com/2010/07/nanotween/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Speaking at OFFF Paris 2010</title>
		<link>http://labs.eric-decker.com/2010/06/offf_paris_2010/</link>
		<comments>http://labs.eric-decker.com/2010/06/offf_paris_2010/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 05:17:02 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Firstborn]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[OFFF]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://labs.eric-decker.com/?p=421</guid>
		<description><![CDATA[I probably should have mentioned this way earlier, but I&#8217;ll be speaking along with Mathieu Badimon at OFFF Paris on behalf of Firstborn. Our presentation will be on Friday, June 25th at 12:30. I have to say, this is quite an honor to speak at this conference. If you&#8217;re interested, there should be more information [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-420" title="off" src="http://labs.eric-decker.com/wp-content/uploads/2010/06/off.jpg" alt="" width="600" height="156" /></p>
<p>I probably should have mentioned this way earlier, but I&#8217;ll be speaking along with Mathieu Badimon at OFFF Paris on behalf of Firstborn. Our presentation will be on Friday, June 25th at 12:30. I have to say, this is quite an honor to speak at this conference. If you&#8217;re interested, there should be more information on the <a title="OFFF Paris" href="http://www.offf.ws/" target="_blank">OFFF Paris 2010 website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.eric-decker.com/2010/06/offf_paris_2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking at FITC Toronto 2010</title>
		<link>http://labs.eric-decker.com/2010/04/speaking-at-fitc-toronto-2010/</link>
		<comments>http://labs.eric-decker.com/2010/04/speaking-at-fitc-toronto-2010/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 06:16:59 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Firstborn]]></category>
		<category><![CDATA[FITC]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://labs.eric-decker.com/?p=411</guid>
		<description><![CDATA[So I realize this is pretty last minute, but I&#8217;ll be speaking at FITC Toronto this Monday with Mathieu Badimon. We&#8217;ll be speaking on Firstborn&#8217;s behalf. Our presentation is titled &#8220;Tools &#38; Prototypes: Crafting a Unique Digital Experience.&#8221; It&#8217;s basically focusing on how for each project we make, we usually need to make demos to [...]]]></description>
			<content:encoded><![CDATA[<p>So I realize this is pretty last minute, but I&#8217;ll be speaking at FITC Toronto this Monday with <a href="http://five3d.mathieu-badimon.com/" target="_blank">Mathieu Badimon</a>. We&#8217;ll be speaking on Firstborn&#8217;s behalf. Our presentation is titled &#8220;Tools &amp; Prototypes: Crafting a Unique Digital Experience.&#8221; It&#8217;s basically focusing on how for each project we make, we usually need to make demos to test techniques or make tools to aid in development. It&#8217;s more of a creative presentation than a technical one, as we really won&#8217;t be talking about code directly. So if you&#8217;re up at FITC this weekend, we&#8217;ll be presenting Monday at 12:10.</p>
<p><a title="FITC" href="http://www.fitc.ca/events/presentations/presentation.cfm?event=102&amp;presentation_id=1227" target="_blank">http://www.fitc.ca/events/presentations/presentation.cfm?event=102&amp;presentation_id=1227</a></p>
<p><a title="Flickr" href="http://www.flickr.com/photos/fitc/4555380861/in/set-72157623804976489/" target="_blank"><img class="alignnone size-full wp-image-416" title="FITC Toronto 2010" src="http://labs.eric-decker.com/wp-content/uploads/2010/04/fitc2010.jpg" alt="" width="600" height="400" /></a></p>
<p><span id="more-411"></span></p>
<blockquote><p>Nowadays, there are numerous ways to create websites and a large amount of tools, frameworks, packages and other reusable pieces available online.</p>
<p>Some of these icon libraries, 3D engines, Augmented Reality demos and diverse experiments can often give good inspiration during the conception phase And can sometimes be requested by a client (to see a &#8220;demo&#8221; of how something would work). Sometimes using these pieces in a website or other digital experience can make you feel like you&#8217;re stitching a giant patchwork blanket without really getting into the detail of each of the parts; this is sometimes a safe approach but not necessarily an innovative one.</p>
<p>There is a alternative approach, which gives freedom to generate new ideas and where everyone can let their imagination flow before some of these ideas eventually make the cut of the technical feasibility. Implementing such ideas is sometimes more difficult but also a more exciting and challenging path into crafting something unique.</p>
<p>This presentation is about clients asking questions such as: &#8220;Can I have a headphone wire as realistic as the one in the TV spot&#8230;and for it to be interactive?&#8221;, &#8220;Is it possible to colorize the car in any color I want?&#8221;, &#8220;Can the user deform the 3D face to look like himself?&#8221; and internal brainstorm sessions punctuated with: &#8220;Could a pen write whatever request I make?&#8221;, &#8220;Can we fake this 3D character into a 2D landscape?&#8221; or &#8220;What about we sew the text onto the screen itself?&#8221;</p>
<p>More importantly, we will go into the process and the techniques we had to come up with to answer these questions through the creation of prototypes and unique tools.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://labs.eric-decker.com/2010/04/speaking-at-fitc-toronto-2010/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Time Displacement Experiment (part II)</title>
		<link>http://labs.eric-decker.com/2010/03/time-displacement-experiment-part-ii/</link>
		<comments>http://labs.eric-decker.com/2010/03/time-displacement-experiment-part-ii/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 17:19:13 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://labs.eric-decker.com/?p=398</guid>
		<description><![CDATA[I made some updates to my time displacement experiments. I lumped them all into one nice little app, as well as give some options to toggle the effect. I also added the option to choose video source, so it doesn&#8217;t have to be with a webcam anymore. I added the option to tint what area [...]]]></description>
			<content:encoded><![CDATA[<p>I made some updates to my time displacement experiments. I lumped them all into one nice little app, as well as give some options to toggle the effect. I also added the option to choose video source, so it doesn&#8217;t have to be with a webcam anymore. I added the option to tint what area is being effected, as well as experimented with frame blending to try to lessen hard edges. Like the previous post, I&#8217;m still using Pixel Bender to apply the displacement.</p>
<p><a href="http://experiments.eric-decker.com/time_displacement/" target="_blank">experiments.eric-decker.com/time_displacement</a></p>
<p><img class="alignnone size-full wp-image-402" title="thumb01" src="http://labs.eric-decker.com/wp-content/uploads/2010/03/thumb011.jpg" alt="" width="600" height="528" /></p>
<p><span id="more-398"></span><img class="alignnone size-full wp-image-403" title="thumb02" src="http://labs.eric-decker.com/wp-content/uploads/2010/03/thumb021.jpg" alt="" width="600" height="528" /></p>
<p><img class="alignnone size-full wp-image-404" title="thumb03" src="http://labs.eric-decker.com/wp-content/uploads/2010/03/thumb031.jpg" alt="" width="600" height="528" /></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.eric-decker.com/2010/03/time-displacement-experiment-part-ii/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>More Time Displacement Experiments: Now with Pixel Bender</title>
		<link>http://labs.eric-decker.com/2010/03/more-time-displacement-experiments-now-with-pixel-bender/</link>
		<comments>http://labs.eric-decker.com/2010/03/more-time-displacement-experiments-now-with-pixel-bender/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:35:07 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://labs.eric-decker.com/?p=391</guid>
		<description><![CDATA[I decided to try using Pixel Bender to do the time displacement in the recent experiments I&#8217;ve been doing, as I was hoping it would perform better. It actually seems to, but there still is a significant lag. However, I&#8217;m pretty sure this is because of having to make a huge sprite sheet first. I [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to try using Pixel Bender to do the time displacement in the recent experiments I&#8217;ve been doing, as I was hoping it would perform better. It actually seems to, but there still is a significant lag. However, I&#8217;m pretty sure this is because of having to make a huge sprite sheet first.</p>
<p>I basically make a huge sprite sheet of all the frames I have saved. Since Flash 10 lets you have bigger bitmaps (16,777,215 pixels total, max dimension at 8,191 <a title="Bit-101" href="http://www.bit-101.com/blog/?p=1426" target="_blank">src</a>) I can create a large image that tiles all the frames I currently have saved. I can have a max of 12 frames across (at 640) and 4 frames down (at 480). So after I create/update this giant bitmap, I send it to a pixel bender filter that is currently applied to a gray scale image. The Pixel Bender filter then looks at each pixel, evaluates the brightness and interpolates it to what frame it needs to update from, then replaces the current pixel with the appropriate one from the selected frame.</p>
<p>These experiments are still a little rough, but I&#8217;ll post &#8216;em anyways. No videos yet, I need to find some time to do screen recordings. The ticker is obviously by <a title="Mr. Doob" href="http://mrdoob.com/blog/post/582" target="_blank">Mr. Doob</a>. You&#8217;ll need a webcam for all of these, sorry.</p>
<ul>
<li><a href="http://experiments.eric-decker.com/video_time_displacement_pb/brightness.html" target="_blank">brightness</a>: Displacement based off of brightness of current frame.</li>
<li><a href="http://experiments.eric-decker.com/video_time_displacement_pb/movement.html" target="_blank">movement</a>: Displacement based off of movement (difference between frames)</li>
<li><a href="http://experiments.eric-decker.com/video_time_displacement_pb/paint.html" target="_blank">painting</a>: Displacement based off area pained by user, as in previous post (inspired by Smudge City).</li>
<li><a href="http://experiments.eric-decker.com/video_time_displacement_pb/noise.html" target="_blank">noise</a>: Displacement based off of perlin noise.</li>
<li><a href="http://experiments.eric-decker.com/video_time_displacement_pb/filmstrip.html" target="_blank">filmstrip</a>: Displacement based off of titled blocks.</li>
</ul>
<p>In any of these experiments, you can right-click to show the source that is controlling the displacement.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.eric-decker.com/2010/03/more-time-displacement-experiments-now-with-pixel-bender/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Video Time Painting Experiment</title>
		<link>http://labs.eric-decker.com/2010/03/video-time-painting-experiment/</link>
		<comments>http://labs.eric-decker.com/2010/03/video-time-painting-experiment/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 15:06:04 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://labs.eric-decker.com/?p=376</guid>
		<description><![CDATA[I started playing around with doing some experiments with video and time delay. When showing the previously mentioned JPEG video experiment to my coworker Roushey, he mentioned how just the effect of the time delay was interesting. I was thinking about neat things to do with, and the first idea I had was to offset [...]]]></description>
			<content:encoded><![CDATA[<p>I started playing around with doing some experiments with video and time delay. When showing the previously mentioned JPEG video experiment to my coworker <a title="Roushey's Blog" href="http://mroushey.com/blog/" target="_blank">Roushey</a>, he mentioned how just the effect of the time delay was interesting. I was thinking about neat things to do with, and the first idea I had was to offset each frame as one row or column of pixels. So in a 640 x 480 video, the left-most column of pixels would be from the current frame, and the last rightmost column would be from 639 frames ago. The<a title="Time Waves experiment" href="http://experiments.eric-decker.com/webcam_delay_wave/" target="_blank"> experiment is live here</a>, and there&#8217;s a <a title="Video Wave recoring" href="http://www.youtube.com/watch?v=PVR2rUmMVEQ" target="_blank">video of it on YouTube</a>.</p>
<p>I had remember seeing a video (I think it was at FITC &#8217;07) of some really cool video Processing experiments by James Seo (see <a title="Lossless" href="http://www.lossless.net/projects/asynchrony/" target="_blank">Asynchrony Smudge City</a>). He had made an experiment where you could paint a time remap on video. This experiment has always stuck with me, as I always thought it was really well done. So after doing the previous experiment, I thought I would like to try what he had done too, except I choose to do it in Flash (which, I imagine, would make it perform worse than Processing).</p>
<p>It ended up being a fun little project. First, I just paint into a hidden canvas and capture that bitmap data. Then, depending on the number of frames recorded, I break out multiple version of the painting each with a different threshold. I then use this image as an alpha mask via the Layer blend mode to mask out the frame. Lastly, I draw each one to the resulting bitmap, which is displayed. Additionally, since the threshold method is 0 and 1 there are hard edges around each threshold, so I also apply a blur filter (16 x 16, quality 1) to help them blend a little more. This ends up being very taxing, and causes for a lot of slow down. In the demo, you can right-click and toggle this on and off to see the difference for yourself. I also did a version with PixelBender which I need to tweak a little bit, but the performance doesn&#8217;t seem to be that great (although I might be able to optimize it still).</p>
<p>Play with it here: <a title="Webcam Time Painting" href="http://experiments.eric-decker.com/time_remap_painting/" target="_blank">Webcam Time Painting</a>. There are also some video recordings below.</p>
<p><script type="text/javascript" src="http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/js/swfobject.js"></script><span class="embedflash" id="swfid099d286d3f6f99f079b2fbb2d26aefec"><small>(Please open the article to see the flash file or player.)</small></span><script type="text/javascript">
				var flashvars = {}; var params = {}; var attributes = {};params.allowfullscreen = "true"; params.allowscriptaccess = "always";
				swfobject.embedSWF("http://www.youtube.com/v/8UJwkgFl84Y","swfid099d286d3f6f99f079b2fbb2d26aefec","425","355","9.0.0","http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/swf/expressInstall.swf",flashvars,params,attributes);
		</script></p>
<p><script type="text/javascript" src="http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/js/swfobject.js"></script><span class="embedflash" id="swfid1e64b9a54afdd66a803c959fc98dd1c9"><small>(Please open the article to see the flash file or player.)</small></span><script type="text/javascript">
				var flashvars = {}; var params = {}; var attributes = {};params.allowfullscreen = "true"; params.allowscriptaccess = "always";
				swfobject.embedSWF("http://www.youtube.com/v/zmMfWK6CaRg","swfid1e64b9a54afdd66a803c959fc98dd1c9","425","355","9.0.0","http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/swf/expressInstall.swf",flashvars,params,attributes);
		</script></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.eric-decker.com/2010/03/video-time-painting-experiment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>&#8216;Encoding&#8217; Video as JPEG real time in AS3</title>
		<link>http://labs.eric-decker.com/2010/03/encoding-video-as-jpef-real-time-in-as3/</link>
		<comments>http://labs.eric-decker.com/2010/03/encoding-video-as-jpef-real-time-in-as3/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 03:23:33 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://labs.eric-decker.com/?p=371</guid>
		<description><![CDATA[A few days ago I was thinking if there was a way to reproduce the effect of JPEG compression real time in flash. I figured the best way would be to literally encode the image with the native AS3 JPEGEncoder class. The problem there was that the returned ByteArray could not be interpreted as an [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I was thinking if there was a way to reproduce the effect of JPEG compression real time in flash. I figured the best way would be to literally encode the image with the native AS3 JPEGEncoder class. The problem there was that the returned ByteArray could not be interpreted as an image anymore. However, the Loader class does allow for loading a ByteArray and converting it to a Bitmap. And luckily, the loadBytes method let us load the ByteArray right from Flash (as opposed to having to save out a file and load it externally).</p>
<p>So, applied to a webcam video on an interval, a bitmap data snapshot is taken of the current video frame. Then it is encoded as a JPEG and returned as a ByteArray. The ByteArray is then loaded back into Flash though the loader, which takes a one frame delay, which I imagine is because the loader object probably needs to initialize. Then, the bitmap is extracted from the loader the same way any image is, and the bitmapdata is copied to a display bitmap on the stage, and the cycle loops again.</p>
<p>You&#8217;ll notice a pretty significant delay on the demo. The delay comes from the encoding of the image, not the loading. You can play with the example here: <a href="http://experiments.eric-decker.com/JPEG_compression_webcam/" target="_blank">JPEG Video Experiment</a>. No webcam? There&#8217;s a prerecorded video below.</p>
<p><script type="text/javascript" src="http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/js/swfobject.js"></script><span class="embedflash" id="swfid70365bee88c20007362d46dfe5cd6f13"><small>(Please open the article to see the flash file or player.)</small></span><script type="text/javascript">
				var flashvars = {}; var params = {}; var attributes = {};params.allowfullscreen = "true"; params.allowscriptaccess = "always";
				swfobject.embedSWF("http://www.youtube.com/v/SYvlTaXW9NE","swfid70365bee88c20007362d46dfe5cd6f13","425","355","9.0.0","http://labs.eric-decker.com/wp-content/plugins/pb-embedflash/swf/expressInstall.swf",flashvars,params,attributes);
		</script></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.eric-decker.com/2010/03/encoding-video-as-jpef-real-time-in-as3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Webcam Snapshot Tool</title>
		<link>http://labs.eric-decker.com/2010/02/webcam-snapshot-tool/</link>
		<comments>http://labs.eric-decker.com/2010/02/webcam-snapshot-tool/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 17:04:46 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://labs.eric-decker.com/?p=363</guid>
		<description><![CDATA[Every once and a while, I find that I need to just take a quick snapshot with my webcam at work. Since I&#8217;m on a PC, so I don&#8217;t have Apple&#8217;s pre-installed Photobooth app, or any other simple program (that I&#8217;m at least aware of). I also didn&#8217;t want to install any bulky 3rd party [...]]]></description>
			<content:encoded><![CDATA[<p>Every once and a while, I find that I need to just take a quick snapshot with my webcam at work. Since I&#8217;m on a PC, so I don&#8217;t have Apple&#8217;s pre-installed Photobooth app, or any other simple program (that I&#8217;m at least aware of). I also didn&#8217;t want to install any bulky 3rd party software that might come with the webcam that I&#8217;m using, since all I need in order for it to work is the driver, which more or less Windows installed all by itself. Photoshop has an option to capture from webcam, but the util is pretty limited as it only lets me capture a very small thumbnail size image.</p>
<p>So I decided to make a really simple webcam capture utility using Flash. Even if there was some really simple app out there, as I am sure there is, the developer urge inside me just wanted to create one anyways. I figure this way is pretty cool, since all you need is the webcam driver (so that the webcam actually works) and Flash Player 10 installed (which is current at 94% penetration). It&#8217;s just a simple little tool, you can re-size the image and save it as a jpeg. That&#8217;s really all the functionality that I needed from it.</p>
<p>Anyways, you can check it out here:<br />
<a title="Webcam Snapshot Util" href="http://experiments.eric-decker.com/webcam_snapshot/" target="_blank">experiments.eric-decker.com/webcam_snapshot</a></p>
<p>I&#8217;ve also used it to take some macro snapshot, as apparently my webcam can focus insanely close on things, and I&#8217;ve uploaded them to my flickr account:<br />
<a title="Flickr Webcam Macro Shots" href="http://www.flickr.com/photos/ericdecker/sets/72157623403965642/" target="_blank">flickr.com/photos/ericdecker/sets/72157623403965642</a></p>
<p><a href="http://www.flickr.com/photos/ericdecker/sets/72157623403965642/"><img class="alignnone size-full wp-image-368" title="macro_thumbnails" src="http://labs.eric-decker.com/wp-content/uploads/2010/02/macro_thumbnails.png" alt="Macro Thumbnails" width="465" height="231" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.eric-decker.com/2010/02/webcam-snapshot-tool/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

