<?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>Brooks Andrus &#187; media</title>
	<atom:link href="http://www.brooksandrus.com/blog/tag/media/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brooksandrus.com/blog</link>
	<description>This is the blog of Brooks Andrus. Here, at irregular intervals, you may find digital noise centered around the activities of an early 21st century technologist. I work for TechSmith Corporation, but this web space and the views found on it are entirely my own.</description>
	<lastBuildDate>Fri, 13 May 2011 19:19:28 +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>OSMF + Flex Example</title>
		<link>http://www.brooksandrus.com/blog/2010/02/10/osmf-flex-example/</link>
		<comments>http://www.brooksandrus.com/blog/2010/02/10/osmf-flex-example/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 18:34:35 +0000</pubDate>
		<dc:creator>brooks</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[osmf]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.brooksandrus.com/blog/?p=1269</guid>
		<description><![CDATA[I&#8217;ve been checking up on OSMF (Open Source Media Framework) periodically, but found that many of their examples / samples don&#8217;t work at the moment (their APIs have been in flux). If you&#8217;re just looking for a quick way to get OSMF (v.9) up and running in Flex here&#8217;s a bit of code that should [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been checking up on <a href="http://www.opensourcemediaframework.com/">OSMF</a> (Open Source Media Framework) periodically, but found that many of their examples / samples don&#8217;t work at the moment (their APIs have been in flux). If you&#8217;re just looking for a quick way to get OSMF (v.9) up and running in Flex here&#8217;s a bit of code that should help.</p>
<p><span id="more-1269"></span></p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt; ?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;">&lt;mx :Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> xmlns:containers=<span style="color: #ff0000;">&quot;org.osmf.containers.*&quot;</span> applicationComplete=<span style="color: #ff0000;">&quot;init();&quot;</span> xmlns:media=<span style="color: #ff0000;">&quot;org.osmf.media.*&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
&nbsp;
&nbsp;
    <span style="color: #000000;">&lt;/mx<span style="color: #7400FF;">&gt;</span>&lt;mx :Script<span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt; !<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import org.osmf.display.MediaPlayerSprite;</span>
<span style="color: #000000;">            import org.osmf.layout.LayoutUtils;</span>
&nbsp;
<span style="color: #000000;">            import org.osmf.containers.MediaContainer;</span>
<span style="color: #000000;">            import org.osmf.media.MediaElement;</span>
<span style="color: #000000;">            import org.osmf.media.MediaPlayer;</span>
<span style="color: #000000;">            import org.osmf.media.URLResource;</span>
<span style="color: #000000;">            import org.osmf.utils.URL;</span>
<span style="color: #000000;">            import org.osmf.video.VideoElement;</span>
<span style="color: #000000;">            import org.osmf.net.NetLoader;</span>
&nbsp;
<span style="color: #000000;">            import mx.core.UIComponent;</span>
&nbsp;
<span style="color: #000000;">            private static const REMOTE_PROGRESSIVE:String = <span style="color: #ff0000;">&quot;http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv&quot;</span>;</span>
&nbsp;
<span style="color: #000000;">            private var mediaElement:MediaElement;</span>
<span style="color: #000000;">            private var mediaPlayer:MediaPlayer;</span>
<span style="color: #000000;">            private var container:MediaContainer;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                // set up some listeners for our buttons</span>
<span style="color: #000000;">                playBtn.addEventListener<span style="color: #66cc66;">&#40;</span> MouseEvent.CLICK, playHandler, false, <span style="color: #cc66cc;">0</span>, true <span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                pauseBtn.addEventListener<span style="color: #66cc66;">&#40;</span> MouseEvent.CLICK, pauseHandler, false, <span style="color: #cc66cc;">0</span>, true <span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                seekBtn.addEventListener<span style="color: #66cc66;">&#40;</span> MouseEvent.CLICK, seekHandler, false, <span style="color: #cc66cc;">0</span>, true <span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                // First create a MediaElement and load some media </span>
<span style="color: #000000;">                mediaElement = new VideoElement<span style="color: #66cc66;">&#40;</span> new NetLoader, new URLResource<span style="color: #66cc66;">&#40;</span> new URL<span style="color: #66cc66;">&#40;</span> REMOTE_PROGRESSIVE <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                // We need a DisplayObject for the video</span>
<span style="color: #000000;">                container = new MediaContainer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </span>
<span style="color: #000000;">                // feed the display object a media element</span>
<span style="color: #000000;">                container.addMediaElement<span style="color: #66cc66;">&#40;</span> mediaElement <span style="color: #66cc66;">&#41;</span>; </span>
<span style="color: #000000;">                // Flex requires a DisplayObject to be wrapped in Flex Framework UI Abstraction</span>
<span style="color: #000000;">                videoParent.addChild<span style="color: #66cc66;">&#40;</span> container <span style="color: #66cc66;">&#41;</span>; </span>
&nbsp;
<span style="color: #000000;">                // MediaPlayer is a virtual controller. Assign it a media element and it will autoplay the media by default.</span>
<span style="color: #000000;">                mediaPlayer = new MediaPlayer<span style="color: #66cc66;">&#40;</span> mediaElement <span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                // We will manually resize the MediaContainer just for kicks</span>
<span style="color: #000000;">                LayoutUtils.setAbsoluteLayout<span style="color: #66cc66;">&#40;</span> mediaElement.metadata, <span style="color: #cc66cc;">640</span>, <span style="color: #cc66cc;">360</span> <span style="color: #66cc66;">&#41;</span>; </span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function playHandler<span style="color: #66cc66;">&#40;</span> e:MouseEvent <span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span> !mediaPlayer.playing <span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    mediaPlayer.play<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function pauseHandler<span style="color: #66cc66;">&#40;</span> e:MouseEvent <span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span> mediaPlayer.playing <span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    mediaPlayer.pause<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function seekHandler<span style="color: #66cc66;">&#40;</span> e:MouseEvent <span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var val:Number =  parseFloat<span style="color: #66cc66;">&#40;</span> timeTxt.text <span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                mediaPlayer.seek<span style="color: #66cc66;">&#40;</span> val <span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;">&lt;/mx<span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;">&lt;mx :UIComponent id=<span style="color: #ff0000;">&quot;videoParent&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;">&lt;mx :Button x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;400&quot;</span> label=<span style="color: #ff0000;">&quot;play&quot;</span> id=<span style="color: #ff0000;">&quot;playBtn&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;">&lt;mx :Button x=<span style="color: #ff0000;">&quot;72&quot;</span> y=<span style="color: #ff0000;">&quot;400&quot;</span> label=<span style="color: #ff0000;">&quot;pause&quot;</span> id=<span style="color: #ff0000;">&quot;pauseBtn&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;">&lt;mx :Button x=<span style="color: #ff0000;">&quot;145&quot;</span> y=<span style="color: #ff0000;">&quot;400&quot;</span> label=<span style="color: #ff0000;">&quot;seek&quot;</span> id=<span style="color: #ff0000;">&quot;seekBtn&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;">&lt;mx :TextInput x=<span style="color: #ff0000;">&quot;211&quot;</span> y=<span style="color: #ff0000;">&quot;400&quot;</span> width=<span style="color: #ff0000;">&quot;40&quot;</span> id=<span style="color: #ff0000;">&quot;timeTxt&quot;</span> text=<span style="color: #ff0000;">&quot;0&quot;</span> restrict=<span style="color: #ff0000;">&quot;0-9&quot;</span><span style="color: #7400FF;">/&gt;</span></span></pre></div></div>

<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brooksandrus.com/blog/2010/02/10/osmf-flex-example/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
<enclosure url="http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv" length="2660334" type="video/x-flv" />
		</item>
		<item>
		<title>Getting Down and Dirty with XMP and AS3</title>
		<link>http://www.brooksandrus.com/blog/2009/04/13/getting-down-and-dirty-with-xmp-and-as3/</link>
		<comments>http://www.brooksandrus.com/blog/2009/04/13/getting-down-and-dirty-with-xmp-and-as3/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 06:10:05 +0000</pubDate>
		<dc:creator>brooks</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[xmp]]></category>

		<guid isPermaLink="false">http://www.brooksandrus.com/blog/?p=1001</guid>
		<description><![CDATA[One of the best ways to get started using XMP is to take a look at how Adobe is using it to embed speech-to-text data inside video files using Adobe Premiere. As Flash Platform devs, the easiest way to get access to the XMP data in a video file created by Adobe Premiere is to [...]]]></description>
			<content:encoded><![CDATA[<p>One of the best ways to get started using <a href="http://www.adobe.com/products/xmp/">XMP</a> is to take a look at how Adobe is using it to <a href="http://www.brooksandrus.com/blog/2008/11/16/the-xmp-revolution-is-here/">embed speech-to-text data</a> inside video files using Adobe Premiere.</p>
<p>As Flash Platform devs, the easiest way to get access to the XMP data in a video file created by Adobe Premiere is to make sure you handle the onXMPData callback that NetStream fires (Flash Player 10 only). One way to do this is by extending NetStream and adding a callback handler method that looks like this:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// callback handler inside a NetStream subclass dispatches a custom event that  </span>
<span style="color: #808080; font-style: italic;">// forwards the xmp data found in the callback handler</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onXMPData<span style="color: #66cc66;">&#40;</span> info:<span style="color: #0066CC;">Object</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	dispatchEvent<span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> XMPEvent<span style="color: #66cc66;">&#40;</span> XMPEvent.<span style="color: #006600;">XMP_STRING</span>, info.<span style="color: #0066CC;">data</span>, <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>; 
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p></code></p>
<p>Next you need to make sure you&#8217;re listening for the XMPEvent, then load the MPEG-4 AVC / F4V / FLV media:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// pseudo code</span>
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">video</span>:<span style="color: #0066CC;">NetStream</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">NetStream</span><span style="color: #66cc66;">&#40;</span> connection <span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">video</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> XMPEvent.<span style="color: #006600;">XMP_STRING</span>, xmpHandler, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">video</span>.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;h264_captions.f4v&quot;</span> <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p></code></p>
<p>Now its time to see what XMP looks like. We&#8217;ll use the <a href="http://labs.adobe.com/technologies/xmplibrary/">AS3 XMP library</a> that Adobe has up on labs:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> xmpHandler<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:XMPEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// XMPMeta is root data structure for xmp data. Pass in the xmp data</span>
	<span style="color: #808080; font-style: italic;">// we received from the NetStream callback</span>
	<span style="color: #000000; font-weight: bold;">var</span> xmp:XMPMeta = <span style="color: #000000; font-weight: bold;">new</span> XMPMeta<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">xmp</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	 <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">xml</span>:<span style="color: #0066CC;">XML</span> = xmp.<span style="color: #006600;">serializeToXML</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	 <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">toXMLString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p></code></p>
<p>The output of the previous trace should look something like this (full example xml available <a href="http://www.brooksandrus.com/resources/xmp.xml">here</a>):</p>
<p><img src="http://www.brooksandrus.com/jing2/xmp_sample.png" alt="XMP sample" /></p>
<p>As you can see in the example above the much of the XMP information is stored in the <a href="www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart2.pdf">Adobe Dynamic Media schema</a> that uses the xmpDM namespace.</p>
<p><img src="http://www.brooksandrus.com/jing2/xmpNamespace.png" alt="xmpDM cust XMP namespace" /></p>
<p>XMP itself builds on top of another metadata framework called <a href="http://www.w3.org/RDF/">RDF</a> (Rich Description Framework). You can think of RDF as the raw building blocks or data structures necessary to generically describe data.</p>
<p><img src="http://www.brooksandrus.com/jing2/xmpRDF.png" alt="XMP uses RDF" /></p>
<p>The gigantic mess of RDF and XMP namespace elements that need to be mixed and matched can be overwhelming, but keep yer cool&#8211;Adobe&#8217;s AS3 XMP library makes it relatively simple to parse, modify or create XMP metadata.</p>
<p>First off let&#8217;s come to a basic understanding of the core RDF elements used in XMP:</p>
<ul>
<li><strong>Description</strong> &#8211; the basic data structure of RDF, this sucka holds just about anything.</li>
<li><strong>Bag</strong> &#8211; an array structure. I just think of these as unordered all purposes arrays.</li>
<li><strong>Seq</strong> &#8211; an array structure that&#8217;s ordinal by nature.</li>
<li><strong>li</strong> &#8211; an item. If yer a Bag or Seq and aren&#8217;t just an empty vessel then plenty of these will be present.</li>
</ul>
<p>Luckily, Adobe&#8217;s AS3 XMP library has a similar ActionScript object data model:</p>
<ul>
<li><strong>XMPStruct</strong> &#8211; the core data structure of XMP.</li>
<li><strong>XMPArray</strong> &#8211; there are bag and seq flavors, but for the most part these are implicitly derived.</li>
</ul>
<p>Let&#8217;s take a look at the speech-to-text data again and see if we can piece together some of the details.</p>
<p><img src="http://www.brooksandrus.com/jing2/markers_tracks_xmp_desc.png" alt="Describing speech to text XMP data types" /></p>
<p>Now lets see how we could use this information to parse the XMP data and extract values:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> xmpHandler<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:XMPEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> xmp:XMPMeta = <span style="color: #000000; font-weight: bold;">new</span> XMPMeta<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">xmp</span> <span style="color: #66cc66;">&#41;</span>;
    <span style="color: #808080; font-style: italic;">// define a namespace that will allow us to &quot;dot down&quot; into the data</span>
    <span style="color: #808080; font-style: italic;">// the XMP lib provides constants for many of the common XMP schemas</span>
    <span style="color: #000000; font-weight: bold;">var</span> xmpDM:Namespace = XMPConst.<span style="color: #006600;">xmpDM</span>; 
&nbsp;
    <span style="color: #808080; font-style: italic;">// &quot;Tracks&quot; is a Bag array containing XMPStruct types.</span>
    <span style="color: #808080; font-style: italic;">// Let's take a look at how we can parse out the values in</span>
    <span style="color: #808080; font-style: italic;">// first XMPStruct. NOTE: All XMP arrays start at 1 rather than 0.</span>
    <span style="color: #000000; font-weight: bold;">var</span> track1:XMPStruct = xmp.<span style="color: #006600;">xmpDM</span>::Tracks<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>;
    <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> track1.<span style="color: #006600;">xmpDM</span>::trackName <span style="color: #66cc66;">&#41;</span>;
    <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> track1.<span style="color: #006600;">xmpDM</span>::frameRate <span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">// the second struct contains the array of speech-to-text</span>
    <span style="color: #808080; font-style: italic;">// markers that we're interested in.</span>
    <span style="color: #000000; font-weight: bold;">var</span> track2:XMPStruct = xmp.<span style="color: #006600;">xmpDM</span>::Tracks<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span>;
    <span style="color: #000000; font-weight: bold;">var</span> markers:XMPArray = track2.<span style="color: #006600;">xmpDM</span>::markers;
    <span style="color: #000000; font-weight: bold;">var</span> item:XMPStruct;
&nbsp;
    <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">1</span>; i <span style="color: #66cc66;">&lt;</span> markers.<span style="color: #0066CC;">length</span> + <span style="color: #cc66cc;">1</span>; i++ <span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        item = markers<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>; <span style="color: #808080; font-style: italic;">//  a reference to the current marker of type XMPStruct</span>
&nbsp;
        <span style="color: #808080; font-style: italic;">// now we can simply look at all of the property values for each </span>
        <span style="color: #808080; font-style: italic;">// item in the array</span>
        <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;startTime: &quot;</span> + item.<span style="color: #006600;">xmpDM</span>::startTime <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;duration: &quot;</span> + item.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">duration</span> <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;name: &quot;</span> + item.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">name</span> <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;speaker: &quot;</span> + item.<span style="color: #006600;">xmpDM</span>::speaker <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;probability: &quot;</span> + item.<span style="color: #006600;">xmpDM</span>::probability + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

</pre>
<p></code></p>
<p>Ok, so that wasn&#8217;t too bad was it? Armed with some basic RDF knowledge, the Adobe AS3 XMP lib actually makes it pretty easy to parse out any XMP metadata you&#8217;re likely to run into. But we can do better than that, right? Let&#8217;s use the XMP lib and our reverse engineered knowledge of the Adobe XMP Dynamic Media schema to create some XMP marker data from scratch.</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> createXMPMarkers<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">// create an xmp object and create a namespace for the Adobe DynamicMedia schema</span>
    <span style="color: #000000; font-weight: bold;">var</span> xmp:XMPMeta = <span style="color: #000000; font-weight: bold;">new</span> XMPMeta<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000000; font-weight: bold;">var</span> xmpDM:Namespace = XMPConst.<span style="color: #006600;">xmpDM</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">// create some markers and set some properties</span>
    <span style="color: #000000; font-weight: bold;">var</span> item1:XMPStruct = <span style="color: #000000; font-weight: bold;">new</span> XMPStruct<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    item1.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;XMP Standard Schemas&quot;</span>;
    item1.<span style="color: #006600;">xmpDM</span>::startTime = <span style="color: #cc66cc;">0</span>;
    item1.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">duration</span> = <span style="color: #cc66cc;">15000</span>;
    item1.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">type</span> = <span style="color: #ff0000;">&quot;Chapter&quot;</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> item2:XMPStruct = <span style="color: #000000; font-weight: bold;">new</span> XMPStruct<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    item2.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;Dublin Core schema&quot;</span>;
    item2.<span style="color: #006600;">xmpDM</span>::startTime = <span style="color: #cc66cc;">0</span>;
    item2.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">duration</span> = <span style="color: #cc66cc;">9999</span>;
    item2.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">type</span> = <span style="color: #ff0000;">&quot;Index&quot;</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> item3:XMPStruct = <span style="color: #000000; font-weight: bold;">new</span> XMPStruct<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    item3.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;XMP Dynamic Media schema&quot;</span>;
    item3.<span style="color: #006600;">xmpDM</span>::startTime = <span style="color: #cc66cc;">10000</span>;
    item3.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">duration</span> = <span style="color: #cc66cc;">5000</span>;
    item3.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">type</span> = <span style="color: #ff0000;">&quot;Index&quot;</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> item4:XMPStruct = <span style="color: #000000; font-weight: bold;">new</span> XMPStruct<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    item4.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;Specialized Schema&quot;</span>;
    item4.<span style="color: #006600;">xmpDM</span>::startTime = <span style="color: #cc66cc;">15001</span>;
    item4.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">duration</span> = <span style="color: #cc66cc;">50000</span>;
    item4.<span style="color: #006600;">xmpDM</span>::<span style="color: #0066CC;">type</span> = <span style="color: #ff0000;">&quot;Chapter&quot;</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">// create an sequenced array to hold all of the markers</span>
    <span style="color: #000000; font-weight: bold;">var</span> markers:XMPArray = XMPArray.<span style="color: #006600;">newSeq</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    markers.<span style="color: #006600;">append</span><span style="color: #66cc66;">&#40;</span> item1 <span style="color: #66cc66;">&#41;</span>;
    markers.<span style="color: #006600;">append</span><span style="color: #66cc66;">&#40;</span> item2 <span style="color: #66cc66;">&#41;</span>;
    markers.<span style="color: #006600;">append</span><span style="color: #66cc66;">&#40;</span> item3 <span style="color: #66cc66;">&#41;</span>;
    markers.<span style="color: #006600;">append</span><span style="color: #66cc66;">&#40;</span> item4 <span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">//Create Tracks Struct</span>
    <span style="color: #000000; font-weight: bold;">var</span> tracks:XMPStruct = <span style="color: #000000; font-weight: bold;">new</span> XMPStruct<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    tracks.<span style="color: #006600;">xmpDM</span>::trackName = <span style="color: #ff0000;">&quot;TOC Markers&quot;</span>;
    tracks.<span style="color: #006600;">xmpDM</span>::markers = markers;
&nbsp;
    <span style="color: #808080; font-style: italic;">// Add the &quot;Tracks&quot; property to the xmp object and set its value equal to the track variable.</span>
    xmp.<span style="color: #006600;">xmpDM</span>::Tracks<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span> = tracks;
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">xml</span>:<span style="color: #0066CC;">XML</span> = xmp.<span style="color: #006600;">serializeToXML</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">toXMLString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p></code></p>
<p>That&#8217;s it for now kids &#8211; y&#8217;all should be XMP parsing and generating machines by now. Look for an upcoming tutorial on creating and using custom XMP schemas / namespaces to store application specific metadata in your media files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brooksandrus.com/blog/2009/04/13/getting-down-and-dirty-with-xmp-and-as3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Silver Tongue and Lifeless Corpse of Microsoft Silverlight</title>
		<link>http://www.brooksandrus.com/blog/2008/02/22/the-silver-tongue-and-lifeless-corpse-of-microsoft-silverlight/</link>
		<comments>http://www.brooksandrus.com/blog/2008/02/22/the-silver-tongue-and-lifeless-corpse-of-microsoft-silverlight/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 06:34:14 +0000</pubDate>
		<dc:creator>brooks</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[codecs]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://www.brooksandrus.com/blog/2008/02/22/the-silver-tongue-and-lifeless-corpse-of-microsoft-silverlight/</guid>
		<description><![CDATA[I work in a predominantly Windows oriented development shop focused around video and there&#8217;s been lots of discussion surrounding Microsoft Silverlight and VC-1 over the last year or so. We&#8217;ve looked at the technical specs, analyzed the possibilities and engaged in seemingly endless discussions comparing the technology to the Adobe Flash platform. Microsoft has come [...]]]></description>
			<content:encoded><![CDATA[<p>I work in a predominantly Windows oriented development <a href="http://www.techsmith.com">shop</a> focused around video and there&#8217;s been lots of discussion surrounding Microsoft Silverlight and <a href="http://en.wikipedia.org/wiki/VC-1">VC-1</a> over the last year or so. We&#8217;ve looked at the technical specs, analyzed the possibilities and engaged in seemingly endless discussions comparing the technology to the Adobe Flash platform. Microsoft has come knocking on our door repeatedly pitching the technology and as a Flash developer I&#8217;m surrounded by marketing hype and blogosphere rants, experiments, and outright paranoia at times. I&#8217;m always amazed at some of the claims that I see on the web and hear during meetings with their reps&#8211;claims which seemingly go unchallenged (maybe it&#8217;s just my ignorance that&#8217;s holding me back).</p>
<p>One of the oft heard and most annoying claims is that Silverlight will be a ubiquitous runtime quickly. This argument posits that all that it takes to be a ubiquitous runtime is a few killer apps. These killer apps typically are either viral content repositories or social in nature and therefore will quickly reach nearly every web enabled computer on the planet. Microsoft assured us during the Silverlight launch buildup that multiple killer apps would be released with the official 1.0 launch ensuring quick and massive penetration.</p>
<p>This claim that all it takes to become ubiquitous is a couple of killer apps has always struck me as off. Microsoft, and even some folks in the Adobe camp, like to point to YouTube and MySpace as what &#8220;made&#8221; Flash while conveniently forgetting that Flash Player adoption was at 98% of web enabled computers long before YouTube and MySpace came along. </p>
<p>It&#8217;s probably much more accurate to argue that Adobe Flash Player&#8217;s high penetration is what enabled the success of MySpace and YouTube. YouTube&#8217;s roaring success validated that Flash video had already won on the web despite the fact it supported fewer codecs of lesser quality than did the other embeddable media players. </p>
<p>When Flash MX and Flash Player 6 hit the streets in July of 2002 there were a lot of us who bought into the potential of video when paired with Flash Player&#8217;s ubiquity and its strange but wonderful scripting, graphics and animation capabilities. We envisioned a world of custom interfaces embedded seamlessly inside our rich applications and designs. We fought battle after battle just for the opportunity to use the technology. &#8220;Back in the day&#8221; no one was a believer and video on the web was a bad joke constantly undermined by the big three&#8217;s attempts at media player domination.</p>
<p>The point is that 6 years ago we started building the foundation for YouTube and it wasn&#8217;t by having a few killer apps, but rather thousands upon thousands of sites with a level of richness and creativity that was unimagined (I&#8217;m continually blown away by the creativity and talent that lives and breathes in this community).</p>
<p>Finally, VC-1 seems to be completely dead in the water. It&#8217;s my understanding that Microsoft&#8217;s strategy of driving adoption from the top down via major media studios and broadcasters has been a major failure. Hell, back in 2002 when Flash Player 6 sported its first video capabilities Windows Media 9 was being hyped like crazy by the softies. Six years later Microsoft has the same codec sporting a new name officially standardized under SMPTE and still can&#8217;t find a date to the prom. Instead, industry support has coalesced around <a href="http://en.wikipedia.org/wiki/H.264">h.264</a>. The h.264 tooling and licensing options are available on a variety of different platforms and are an integral part of many media technology stacks.</p>
<p>It&#8217;s clear that Apple&#8217;s strategy of winning the war by focusing on the content creation tools, dominant portable media playback, cross OS playback / encoding, and media purchasing has soundly beaten Microsoft in the codec / media platform war. Adobe&#8217;s decision to include the h.264 codec instead of VC-1 in Flash Player and ditch its proprietary container format should be read as a slap in the face and a clear sign of VC-1&#8242;s impotence. In one move they walk away from vendor lock-in strategies and indicate how unappealing Microsoft&#8217;s codec offering is.</p>
<p>Microsoft&#8217;s track record over the last 10 years lends little comfort. They&#8217;ve managed to make a media player that is universally despised and which has progressively gotten worse with each subsequent release. They have a retread codec that&#8217;s worn many skirts and names and still can&#8217;t get a date. They make a portable media player no one wants and have backed a next generation dvd format that is now officially dead. Let&#8217;s see, there&#8217;s QuickTime competitor ASF which pales in comparison and has never taken off and it replaced the universally maligned &#8220;video for windows&#8221; container&#8211;AVI. Oh and let&#8217;s not forget gems such as Windows Movie Maker and Microsoft Producer. I could go on, but you should be able to connect the dots. I actually feel sorry for the Microsoft employees when I hear them pitch this stuff&#8211;it can&#8217;t be good for the self-esteem. Note to Microsoft&#8211;maybe stop tanking in the media sector and work on making an operating system that people don&#8217;t hate.</p>
<p>In the end, perhaps Silverlight will take off, but I doubt it will happen overnight. If it does, it will mean a long, hard, consistent battle in the trenches where winning over the hearts of small shops and individual artists is just as important as pumping up MSDN groupies and stroking ISVs. It will mean building a community of stunning talent and incredible heart (its not a numbers game in my book). It will mean winning over the trust of a massive population trained not to trust new browser installs and increasingly cynical of Microsoft and its <a href="http://blog.seattlepi.nwsource.com/microsoft/archives/123837.asp">aggressive monopolist tendencies</a> as a whole. </p>
<p>If Microsoft is able to overcome all of the hurdles in front of it, Silverlight may become more than a lifeless corpse, but until then it appears they&#8217;ll be relying on Jedi mind tricks and their silvery tongue to convince developers and consumers to ignore their repeated missteps and failures in the media sector. Good luck with that MS, you&#8217;re going to need it. ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brooksandrus.com/blog/2008/02/22/the-silver-tongue-and-lifeless-corpse-of-microsoft-silverlight/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

