<?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>Not sLop &#187; thoughts</title>
	<atom:link href="http://www.walking-productions.com/notslop/category/thoughts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.walking-productions.com/notslop</link>
	<description>Not - Shawn's Little Outpost</description>
	<lastBuildDate>Fri, 23 Dec 2011 15:23:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Trying out Storify.com</title>
		<link>http://www.walking-productions.com/notslop/2011/04/27/trying-out-storify-com/</link>
		<comments>http://www.walking-productions.com/notslop/2011/04/27/trying-out-storify-com/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 15:45:46 +0000</pubDate>
		<dc:creator>vanevery</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[New York City]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[cycling]]></category>
		<category><![CDATA[nyc]]></category>

		<guid isPermaLink="false">http://www.walking-productions.com/notslop/?p=1787</guid>
		<description><![CDATA[[View the story "Bike Month About to begin" on Storify]]]></description>
			<content:encoded><![CDATA[<p><script src="http://storify.com/vanevery/bike-month-begins.js"></script><noscript>[<a href="http://storify.com/vanevery/bike-month-begins" target="blank">View the story "Bike Month About to begin" on Storify]</a></noscript></p>
]]></content:encoded>
			<wfw:commentRss>http://www.walking-productions.com/notslop/2011/04/27/trying-out-storify-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Payments</title>
		<link>http://www.walking-productions.com/notslop/2011/04/26/mobile-payments/</link>
		<comments>http://www.walking-productions.com/notslop/2011/04/26/mobile-payments/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 15:28:42 +0000</pubDate>
		<dc:creator>vanevery</dc:creator>
				<category><![CDATA[future]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[telephony]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[contactless payments]]></category>
		<category><![CDATA[mobile payments]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[nfc]]></category>

		<guid isPermaLink="false">http://www.walking-productions.com/notslop/?p=1785</guid>
		<description><![CDATA[A few weeks ago, I was supposed to be on a panel about this two weeks ago. I got sick and couldn&#8217;t do it but I did a bunch of digging around/thinking about it. A friend just asked me why &#8230; <a href="http://www.walking-productions.com/notslop/2011/04/26/mobile-payments/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, I was supposed to be on a panel about this two weeks ago.  I got sick and couldn&#8217;t do it but I did a bunch of digging around/thinking about it.  </p>
<p>A friend just asked me why no-one has risen through the noise.  I didn&#8217;t think about that particular issue but here are some thoughts I did have:</p>
<p>NFC is not new &#8211; Nokia for a while &#8211; I don&#8217;t think it will make a big difference in the use of mobile payments. (Contactless payments aren&#8217;t new either, Citibank/MTA, EZ Pass and so on have been using them for a while)</p>
<p>Overall Issues &#8211; trust &#8211; Who do people want to put their trust in: carriers?  banks?  manufacturers?</p>
<p>Big winner likely: Amazon &#8211; will retailers trust &#8211; consumers say they are the most reputable company in the world.</p>
<p>Other Players:<br />
Isis &#8211; carrirers &#8211; T-Mobile, AT&#038;T and Verizon<br />
Google &#8211; android &#8211; probably open &#8211; Citibank and Mastercard<br />
Apple &#8211; ios &#8211; probably will take a big cut<br />
	Apple is probably required &#8211; as much as I hate to say it &#8211; not friendly to small developers &#8211; donations </p>
<p>What works now: &#8211; points the way towards what will work in the future<br />
Square &#8211; fits with what people already do &#8211; friendly to small merchants &#8211; attaches directly to phone &#8211; simple pricing<br />
Starbucks &#8211; App linked to CC &#8211; Just scan it and the backend system will charge your CC &#8211; Control in hands of consumer</p>
<p>Samsung &#8211; Olympics &#8211; London 2012 big trial</p>
<p>Business Card Transfers<br />
I wonder/fear it will look pretty much like how we exchange contact information now (via paper business cards).<br />
Standards didn&#8217;t catch on &#8211; security warnings about bluetooth &#8211; same will happen with NFC??</p>
<p>NFC will have to be the most secure tech in the world. There is nothing more juicy for a cracker to hack something that is used to transfer money.  People will react with viscerally as well.  The local news channels will run piece after piece.  The wikipedia page is already filled with potential exploits: eavesdropping, data modification, relay attack, lost property, &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walking-productions.com/notslop/2011/04/26/mobile-payments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Whitman&#8217;s Passport</title>
		<link>http://www.walking-productions.com/notslop/2011/03/19/whitmans-passport/</link>
		<comments>http://www.walking-productions.com/notslop/2011/03/19/whitmans-passport/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 16:20:55 +0000</pubDate>
		<dc:creator>vanevery</dc:creator>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[Streaming and Multi-Media]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[dia]]></category>
		<category><![CDATA[diabeacon]]></category>
		<category><![CDATA[liveu]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[streaming]]></category>
		<category><![CDATA[whitman]]></category>

		<guid isPermaLink="false">http://www.walking-productions.com/notslop/?p=1773</guid>
		<description><![CDATA[The New York Times did a short writeup on the Whitman/Dia Passport performance that I have been working on. I&#8217;m putting together the system to transport the live video between each of the locations. We&#8217;ll be using bonded 3G connections &#8230; <a href="http://www.walking-productions.com/notslop/2011/03/19/whitmans-passport/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.nytimes.com/2011/03/18/arts/design/robert-whitmans-passport-at-diabeacon-and-montclair-state.html?_r=1">New York Times did a short writeup on the Whitman/Dia Passport performance</a> that I have been working on.  I&#8217;m putting together the system to transport the live video between each of the locations.  We&#8217;ll be using <a href="http://www.liveu.com/">bonded 3G connections on one end</a>. </p>
<p>Should be fun!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walking-productions.com/notslop/2011/03/19/whitmans-passport/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft-Nokia Hookup Leaves Symbian Devs Hanging &#124; Gadget Lab &#124; Wired.com</title>
		<link>http://www.walking-productions.com/notslop/2011/02/16/microsoft-nokia-hookup-leaves-symbian-devs-hanging-gadget-lab-wired-com/</link>
		<comments>http://www.walking-productions.com/notslop/2011/02/16/microsoft-nokia-hookup-leaves-symbian-devs-hanging-gadget-lab-wired-com/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 15:50:45 +0000</pubDate>
		<dc:creator>vanevery</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://www.walking-productions.com/notslop/?p=1764</guid>
		<description><![CDATA[Microsoft-Nokia Hookup Leaves Symbian Devs Hanging &#124; Gadget Lab &#124; Wired.com. From a developer perspective, It&#8217;s too bad that Nokia didn&#8217;t go the Android direction and work on porting Qt over to Android.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wired.com/gadgetlab/2011/02/nokia-developers/">Microsoft-Nokia Hookup Leaves Symbian Devs Hanging | Gadget Lab | Wired.com</a>.</p>
<p>From a developer perspective, It&#8217;s too bad that Nokia didn&#8217;t go the Android direction and work on porting Qt over to Android.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walking-productions.com/notslop/2011/02/16/microsoft-nokia-hookup-leaves-symbian-devs-hanging-gadget-lab-wired-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fracking</title>
		<link>http://www.walking-productions.com/notslop/2010/09/04/fracking/</link>
		<comments>http://www.walking-productions.com/notslop/2010/09/04/fracking/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 23:56:06 +0000</pubDate>
		<dc:creator>vanevery</dc:creator>
				<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://www.walking-productions.com/notslop/?p=1726</guid>
		<description><![CDATA[I sincerely hope that New York State is smart enough to prevent this from being done here.]]></description>
			<content:encoded><![CDATA[<p>I sincerely hope that New York State is smart enough to prevent this from being done here.</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/dZe1AeH0Qz8?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/dZe1AeH0Qz8?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.walking-productions.com/notslop/2010/09/04/fracking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Picture Tweeter Reviewed</title>
		<link>http://www.walking-productions.com/notslop/2010/05/03/picture-tweeter-reviewed/</link>
		<comments>http://www.walking-productions.com/notslop/2010/05/03/picture-tweeter-reviewed/#comments</comments>
		<pubDate>Tue, 04 May 2010 01:08:17 +0000</pubDate>
		<dc:creator>vanevery</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[youtube video picturetweeter android review app]]></category>

		<guid isPermaLink="false">http://www.walking-productions.com/notslop/2010/05/03/picture-tweeter-reviewed/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/ju2cACajcH0&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ju2cACajcH0&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.walking-productions.com/notslop/2010/05/03/picture-tweeter-reviewed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android App: Picture Tweeter</title>
		<link>http://www.walking-productions.com/notslop/2010/05/02/android-app-picture-tweeter/</link>
		<comments>http://www.walking-productions.com/notslop/2010/05/02/android-app-picture-tweeter/#comments</comments>
		<pubDate>Sun, 02 May 2010 19:22:34 +0000</pubDate>
		<dc:creator>vanevery</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[android app twitter picture image camera]]></category>

		<guid isPermaLink="false">http://www.walking-productions.com/notslop/2010/05/02/android-app-picture-tweeter/</guid>
		<description><![CDATA[Just published, my first Android app in the Market. It is simple, straight forward and not exactly original but it&#8217;s there! If you have an android phone, do a search for &#8220;Picture Tweeter&#8221; and you&#8217;ll find it. Love to hear &#8230; <a href="http://www.walking-productions.com/notslop/2010/05/02/android-app-picture-tweeter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just published, my first Android app in the Market.  It is simple, straight forward and not exactly original but it&#8217;s there!  </p>
<p>If you have an android phone, do a search for &#8220;Picture Tweeter&#8221; and you&#8217;ll find it.  Love to hear what you think.</p>
<p><a href="http://www.walking-productions.com/notslop/wp-content/uploads/2010/05/Picture-9.png"><img src="http://www.walking-productions.com/notslop/wp-content/uploads/2010/05/Picture-9-200x300.png" alt="Picture Tweeter Upload Screen" title="PictureTweeter1" width="200" height="300" class="size-medium wp-image-1717" /></a></p>
<p><a href="http://www.walking-productions.com/notslop/wp-content/uploads/2010/05/Picture-10.png"><img src="http://www.walking-productions.com/notslop/wp-content/uploads/2010/05/Picture-10-200x300.png" alt="Picture Tweeter Start Screen" title="PictureTweeter2" width="200" height="300" class="size-medium wp-image-1718" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.walking-productions.com/notslop/2010/05/02/android-app-picture-tweeter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>P2P video streaming with Adobe Stratus</title>
		<link>http://www.walking-productions.com/notslop/2010/04/23/p2p-video-streaming-with-adobe-stratus/</link>
		<comments>http://www.walking-productions.com/notslop/2010/04/23/p2p-video-streaming-with-adobe-stratus/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 23:05:26 +0000</pubDate>
		<dc:creator>vanevery</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[flash p2p streaming onlinevideo video]]></category>

		<guid isPermaLink="false">http://www.walking-productions.com/notslop/2010/04/23/p2p-video-streaming-with-adobe-stratus/</guid>
		<description><![CDATA[It works! (I guess you already knew that since it is how Chatroulette works.]]></description>
			<content:encoded><![CDATA[<p>It works!  (I guess you already knew that since it is how <a href="http://www.chatroulette.com">Chatroulette</a> works.<br />
<img src="http://www.walking-productions.com/notslop/wp-content/uploads/2010/04/Picture-5-300x162.png" alt="p2p example" title="p2p example" width="300" height="162" class="alignnone size-medium wp-image-1714" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.walking-productions.com/notslop/2010/04/23/p2p-video-streaming-with-adobe-stratus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Live Experimental Interactive Television</title>
		<link>http://www.walking-productions.com/notslop/2010/04/20/live-experimental-interactive-television/</link>
		<comments>http://www.walking-productions.com/notslop/2010/04/20/live-experimental-interactive-television/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 19:55:06 +0000</pubDate>
		<dc:creator>vanevery</dc:creator>
				<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://www.walking-productions.com/notslop/?p=1710</guid>
		<description><![CDATA[The students from my class (Live Experimental Interactive Television) at ITP are on again tonight. This week it is Unitv: UnItv is an exciting new venture in live television. Performed as a local news broadcast, the &#8216;news team&#8217; is given &#8230; <a href="http://www.walking-productions.com/notslop/2010/04/20/live-experimental-interactive-television/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The students from my class (Live Experimental Interactive Television) at <a href="http://itp.nyu.edu">ITP</a> are on again tonight.  This week it is Unitv:<br />
<img src="http://unitv.me/images/unitvlogo.png" alt="Unitv Logo" /></p>
<p><a href="http://unitv.me">UnItv</a> is an exciting new venture in live television.  Performed as a local news broadcast, the &#8216;news team&#8217; is given real-time user submitted content (images, questions, lyrics, and youtube videos) on which they improv the news, weather, a celebrity interview and a performance with a special musical guest.  The home television audience is provided with a two-screen setup where they use our website to become part of the show.  In the spirit of true improvisation, our cast is dependent upon user suggestions to make up the show as they string one joke along to the next.  UnItv was created through the <a href="http://itp.nyu.edu">Interactive Telecommunications Program (ITP) at NYU</a> in collaboration with <a href="http://www.mnn.org">Manhattan Neighborhood Network</a> and airs on the Manhattan Neighborhood Network Tuesday April 20th at 8:30pm.  For more information, check out <a href="http://unitv.me">http://unitv.me</a>.</p>
<p>If you are in Manhattan, you can watch on <a href="www.mnn.org">MNN</a> at 8:30 PM:<br />
Time Warner Cable channel 34<br />
RCN channel 82<br />
Verizon FiOS channel 33<br />
(all in Manhattan only)</p>
<p>If you aren&#8217;t in Manhattan, there *should be* a live stream of the program on <a href="http://unitv.me">http://unitv.me</a></p>
<p>Hope you catch it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.walking-productions.com/notslop/2010/04/20/live-experimental-interactive-television/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Motion JPEG in Flash and Java</title>
		<link>http://www.walking-productions.com/notslop/2010/04/20/motion-jpeg-in-flash-and-java/</link>
		<comments>http://www.walking-productions.com/notslop/2010/04/20/motion-jpeg-in-flash-and-java/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 17:42:33 +0000</pubDate>
		<dc:creator>vanevery</dc:creator>
				<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://www.walking-productions.com/notslop/?p=1706</guid>
		<description><![CDATA[I recently had the opportunity to develop a solution in both Java and Flash for pulling Motion JPEG streams from IP cameras and thought it might be nice to document a bit. Motion JPEG is generally served via HTTP from &#8230; <a href="http://www.walking-productions.com/notslop/2010/04/20/motion-jpeg-in-flash-and-java/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently had the opportunity to develop a solution in both Java and Flash for pulling Motion JPEG streams from IP cameras and thought it might be nice to document a bit.</p>
<p>Motion JPEG is generally served via HTTP from IP cameras as a single file.  Meaning, the connection stays open and the camera just keeps sending individual JPEG images down the pipe.  The images should start with a MIME boundary message such as:</p>
<p><code><br />
--myboundary<br />
Content-Type: image/jpeg<br />
Content-Length: 22517<br />
</code></p>
<p>or<br />
<code><br />
--randomstring<br />
Content-Type: image/jpeg<br />
Content-Length: 22598<br />
</code></p>
<p>The key in the development is to find the boundary and save the bytes between each and treat that as a JPEG image.  Neither of these snippets are great or even complete but they should give you a bit of a start.</p>
<p>Java:</p>
<pre>
package com.mobvcasting.mjpegparser;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;

public class MJPEGParser {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		MJPEGParser mp = new MJPEGParser("http://192.168.1.10/mjpg/video.mjpg", "username", "password");
	}

	public MJPEGParser(String mjpeg_url)
	{
		this(mjpeg_url,null,null);
	}

	public MJPEGParser(String mjpeg_url, String username, String password)
	{
		int imageCount = 0;

		try {
			if (username != null &#038;&#038; password != null)
			{
			    Authenticator.setDefault(new HTTPAuthenticator(username, password));
			}

            URL url = new URL(mjpeg_url);
            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
            String inputLine;
            int lineCount = 0;
            boolean lineCountStart = false;
            boolean saveImage = false;
            while ((inputLine = in.readLine()) != null) {
            	// Should be checking just for "--" probably
            	if (inputLine.lastIndexOf("--myboundary") > -1)
            	{
            		// Got an image boundary, stop last image
            		// Start counting lines to get past:
            		// Content-Type: image/jpeg
            		// Content-Length: 22517

            		saveImage = false;
            		lineCountStart = true;

            		System.out.println("Got a new boundary");
            		System.out.println(inputLine);
            	}
            	else if (lineCountStart)
            	{
            		lineCount++;
            		if (lineCount >= 2)
            		{
            			lineCount = 0;
            			lineCountStart = false;
            			imageCount++;
            			saveImage = true;
                		System.out.println("Starting a new image");

            		}
            	}
            	else if (saveImage)
            	{
            		System.out.println("Saving an image line");
            	}
            	else {

            		System.out.println("What's this:");
            		System.out.println(inputLine);
            	}
            }
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }		

	}

	static class HTTPAuthenticator extends Authenticator {
	    private String username, password;

	    public HTTPAuthenticator(String user, String pass) {
	      username = user;
	      password = pass;
	    }

	    protected PasswordAuthentication getPasswordAuthentication() {
	      System.out.println("Requesting Host  : " + getRequestingHost());
	      System.out.println("Requesting Port  : " + getRequestingPort());
	      System.out.println("Requesting Prompt : " + getRequestingPrompt());
	      System.out.println("Requesting Protocol: "
	          + getRequestingProtocol());
	      System.out.println("Requesting Scheme : " + getRequestingScheme());
	      System.out.println("Requesting Site  : " + getRequestingSite());
	      return new PasswordAuthentication(username, password.toCharArray());
	    }
	  }
}
</pre>
<p>ActionScript 3</p>
<pre>
import flash.display.Sprite;
    import flash.errors.*;
    import flash.events.*;
    import flash.net.URLRequest;
    import flash.net.URLStream;
	import flash.utils.ByteArray;

	var stream:URLStream;
	var mjpegBuffer:ByteArray = new ByteArray();
	// The actual image
	var imageBytes:ByteArray; // = new ByteArray();
	// The chars at the end of the image
	var endPos:String = "\n--myboundary";

	// Started to find, finished finding
	var done:Boolean = false;
	var started:Boolean = false;

	// Don't know why I have to save these to a ByteArray to do the comparisons but it seems I do
	var startBytes:ByteArray = new ByteArray();
	var startByte:int = 0xFF;
	var secondByte:int = 0xD8;
	startBytes.writeByte(0xFF);
	startBytes.writeByte(0xD8);
	trace(startBytes.length);
	var startNum:int = startBytes[0];
	trace(startNum);
	var nextNum:int = startBytes[1];
	trace(nextNum);

	// Open the stream
	stream = new URLStream();
    var request:URLRequest = new URLRequest("http://192.168.1.10/mjpg/video.mjpg?resolution=160x90&#038;fps=1");
    configureListeners(stream);
    try {
    	stream.load(request);
    } catch (error:Error) {
    	trace("Unable to load requested URL.");
    }

	function configureListeners(dispatcher:EventDispatcher):void {
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    }

         function progressHandler(event:Event):void
		 {
		 	trace("Running");
			stream.readBytes(mjpegBuffer,mjpegBuffer.length,stream.bytesAvailable);
			for (var i:int = 0; i < mjpegBuffer.length; i++)
			{
				var currentByte:int = mjpegBuffer[i];
				var nextByte:int = mjpegBuffer[i+1];
				var thirdByte:int = mjpegBuffer[i+2];
				var fourthByte:int = mjpegBuffer[i+3];

				//var randNum:Number = Math.random();
				//if (randNum > .5 &#038;&#038; randNum < .6) { trace(currentByte); }

				if (!started)
				{
					if (currentByte == startNum &#038;&#038; nextByte == nextNum)
					{
							trace("Started");
							started = true;
							imageBytes = new ByteArray();
							imageBytes.writeByte(currentByte);
							//imageBytes.writeByte(0xD8); // Gets written in the else
					}
				}
				else
				{
					if (currentByte == endPos.charCodeAt(0) &#038;&#038; nextByte == endPos.charCodeAt(1) &#038;&#038; thirdByte == endPos.charCodeAt(2) &#038;&#038; fourthByte == endPos.charCodeAt(3))
					{
						trace("done");
						trace(imageBytes);
						done = true;
						started = false;

						var loader:Loader = new Loader();
						loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onByteArrayLoaded)
						loader.loadBytes(imageBytes);
						//stream.close();
					}
					else
					{
						imageBytes.writeByte(currentByte);
					}
				}
			}
        }

		function onByteArrayLoaded(e:Event):void
		{
			var loader:Loader = Loader(e.target.loader);
			loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onByteArrayLoaded);

			var bitmapData:BitmapData = Bitmap(e.target.content).bitmapData;

			//sprLoaded.graphics.clear();
			graphics.beginBitmapFill(bitmapData);
			graphics.drawRect(0,0,bitmapData.width, bitmapData.height);
			graphics.endFill();

		}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.walking-productions.com/notslop/2010/04/20/motion-jpeg-in-flash-and-java/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

