<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Multiple object motion detection</title>
	<atom:link href="http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/</link>
	<description>Actionscript / C++ / C# / Py ... "My God. It's full of stars!"</description>
	<lastBuildDate>Tue, 09 Mar 2010 18:31:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: flashgordon</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-4635</link>
		<dc:creator>flashgordon</dc:creator>
		<pubDate>Sat, 19 Dec 2009 03:30:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-4635</guid>
		<description>It depends on the systems configuration - ports will only listen to requests once they where opened by a service - for example php - or at least this should be the case as having unused ports open is a security issue.

So in short the answer is no - you should start the socketserver before scanning the port.

Also being able to scan the port doesn´t necessarily mean that your socketserver is working.

If executing the sandbox.php doesn´t throw &lt;i&gt;
unable to bind address [98]: Address already in use...
&lt;/i&gt;or any other error you can be fairly sure that the sever is up and running and the port isn´t already occupied by another service.

But if it doesn´t reply to the portscan, the port is most likely being blocked by a firewall.

In that case you can try your luck and use another port - the last option is to ask media temple to open 843 or if you should use another one and which.  </description>
		<content:encoded><![CDATA[<p>It depends on the systems configuration &#8211; ports will only listen to requests once they where opened by a service &#8211; for example php &#8211; or at least this should be the case as having unused ports open is a security issue.</p>
<p>So in short the answer is no &#8211; you should start the socketserver before scanning the port.</p>
<p>Also being able to scan the port doesn´t necessarily mean that your socketserver is working.</p>
<p>If executing the sandbox.php doesn´t throw <i><br />
unable to bind address [98]: Address already in use&#8230;<br />
</i>or any other error you can be fairly sure that the sever is up and running and the port isn´t already occupied by another service.</p>
<p>But if it doesn´t reply to the portscan, the port is most likely being blocked by a firewall.</p>
<p>In that case you can try your luck and use another port &#8211; the last option is to ask media temple to open 843 or if you should use another one and which.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Chernoff</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-4634</link>
		<dc:creator>Josh Chernoff</dc:creator>
		<pubDate>Sat, 19 Dec 2009 03:11:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-4634</guid>
		<description>So I take it that if I ran that port scan on 843 and even if I did not have my socket server running I should be able to talk with that port, right?

if that is true then media temple does block that port and I will have to find another one I can use. Or maybe it&#039;s that I have to have the socket server running correctly?</description>
		<content:encoded><![CDATA[<p>So I take it that if I ran that port scan on 843 and even if I did not have my socket server running I should be able to talk with that port, right?</p>
<p>if that is true then media temple does block that port and I will have to find another one I can use. Or maybe it&#8217;s that I have to have the socket server running correctly?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flashgordon</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-4632</link>
		<dc:creator>flashgordon</dc:creator>
		<pubDate>Sat, 19 Dec 2009 02:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-4632</guid>
		<description>First you should check if your host is responding to requests at that port by using a portscanner like http://www.t1shopper.com/tools/port-scanner/ for example.

If it is open, you can insert &lt;i&gt;echo $pfile;&lt;/i&gt; after line 36 and &lt;i&gt;echo $message;&lt;/i&gt; at line 48 of the sandbox.php, to print to the console what (and if) the socketserver and your flashclient are exchanging.

Nearly forgot to mention this - in order to see the output, you have to start the sandbox.php without nohub: #php sandbox.php.
Also don´t forget to always kill the process of the already running one before you (re)start the socketserver.

And last but not least - please make sure, that the crossdomain.xml resides at the same folder as the sandbox.php and holds the correct domain/ip.</description>
		<content:encoded><![CDATA[<p>First you should check if your host is responding to requests at that port by using a portscanner like <a href="http://www.t1shopper.com/tools/port-scanner/" rel="nofollow">http://www.t1shopper.com/tools/port-scanner/</a> for example.</p>
<p>If it is open, you can insert <i>echo $pfile;</i> after line 36 and <i>echo $message;</i> at line 48 of the sandbox.php, to print to the console what (and if) the socketserver and your flashclient are exchanging.</p>
<p>Nearly forgot to mention this &#8211; in order to see the output, you have to start the sandbox.php without nohub: #php sandbox.php.<br />
Also don´t forget to always kill the process of the already running one before you (re)start the socketserver.</p>
<p>And last but not least &#8211; please make sure, that the crossdomain.xml resides at the same folder as the sandbox.php and holds the correct domain/ip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Chernoff</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-4631</link>
		<dc:creator>Josh Chernoff</dc:creator>
		<pubDate>Sat, 19 Dec 2009 02:31:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-4631</guid>
		<description>I still getting hung up by the sandbox.php. 

I did set the vars for host and I left the port to 843. What could I do to test if that is working right?</description>
		<content:encoded><![CDATA[<p>I still getting hung up by the sandbox.php. </p>
<p>I did set the vars for host and I left the port to 843. What could I do to test if that is working right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flashgordon</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-4630</link>
		<dc:creator>flashgordon</dc:creator>
		<pubDate>Sat, 19 Dec 2009 02:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-4630</guid>
		<description>As I was able to open the default port I didn´t have to use &lt;i&gt;loadPolicyFile()&lt;/i&gt;, but this should work fine:

&lt;i&gt;
//System.security.allowDomain(&quot;*&quot;); //if you are going across domains 
System.security.loadPolicyFile(&quot;xmlsocket://&quot;+your_ip&quot;+&quot;:&quot;+your_port);
&lt;/i&gt;</description>
		<content:encoded><![CDATA[<p>As I was able to open the default port I didn´t have to use <i>loadPolicyFile()</i>, but this should work fine:</p>
<p><i><br />
//System.security.allowDomain(&#8220;*&#8221;); //if you are going across domains<br />
System.security.loadPolicyFile(&#8220;xmlsocket://&#8221;+your_ip&#8221;+&#8221;:&#8221;+your_port);<br />
</i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Chernoff</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-4628</link>
		<dc:creator>Josh Chernoff</dc:creator>
		<pubDate>Sat, 19 Dec 2009 01:58:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-4628</guid>
		<description>Thanks for your help. I forgot to set the loadPolicyFile. 


How did you go about setting that in the MJPEG.as file?</description>
		<content:encoded><![CDATA[<p>Thanks for your help. I forgot to set the loadPolicyFile. </p>
<p>How did you go about setting that in the MJPEG.as file?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flashgordon</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-4626</link>
		<dc:creator>flashgordon</dc:creator>
		<pubDate>Sat, 19 Dec 2009 01:51:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-4626</guid>
		<description>Hi Josh,

did you modify the variable &lt;i&gt;$host&lt;/i&gt; in line 11 of the sandbox.php?

Maybe you should check back with the folks at media temple and ask them if you are allowed to open ports/that specific port as this is often the issue. 

If they tell you that you have to use a port other than 843 - no problem... 
Just change line 12 of the sandbox.php and don´t forget to tell flash where to send the request to ( via &lt;i&gt;loadPolicyFile()&lt;/i&gt; ).

Hope this was of any help and wish you good luck with whatever intersting stuff you are working on :)</description>
		<content:encoded><![CDATA[<p>Hi Josh,</p>
<p>did you modify the variable <i>$host</i> in line 11 of the sandbox.php?</p>
<p>Maybe you should check back with the folks at media temple and ask them if you are allowed to open ports/that specific port as this is often the issue. </p>
<p>If they tell you that you have to use a port other than 843 &#8211; no problem&#8230;<br />
Just change line 12 of the sandbox.php and don´t forget to tell flash where to send the request to ( via <i>loadPolicyFile()</i> ).</p>
<p>Hope this was of any help and wish you good luck with whatever intersting stuff you are working on <img src='http://www.smart-page.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Chernoff</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-4624</link>
		<dc:creator>Josh Chernoff</dc:creator>
		<pubDate>Sat, 19 Dec 2009 01:00:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-4624</guid>
		<description>I&#039;m trying to get the snadbox.php to run on my media temple account. I can get in to the server via ssh and I have tried #nohup php -q sandbox.php &amp; with no errors from ssh but I still get sandbox errors from flash. Could some one give a better example of how I would ssh my sandbox.php file to that it runs as a socket server. Thanks. 

- Josh C</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to get the snadbox.php to run on my media temple account. I can get in to the server via ssh and I have tried #nohup php -q sandbox.php &amp; with no errors from ssh but I still get sandbox errors from flash. Could some one give a better example of how I would ssh my sandbox.php file to that it runs as a socket server. Thanks. </p>
<p>- Josh C</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fabrizio</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-3951</link>
		<dc:creator>fabrizio</dc:creator>
		<pubDate>Thu, 12 Nov 2009 10:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-3951</guid>
		<description>thanks you very very much!, if i use your example in my localhost
i must replace in proxy.php
$fp = fsockopen (&quot;62.16.100.204&quot;, 80, $errno, $errstr, 30); with 
&quot;192.168.101.50&quot;: is the ip of my cam
$fp = fsockopen (&quot;192.168.101.50&quot;, 80, $errno, $errstr, 30); 
and in my fla i must replace
motion = new MJPEG(”filerack.de”, “/as3/sp_tracking/proxy.php”, 80); 
with
motion = new MJPEG(”localhost”, “/proxy/proxy.php”, 80); 

???</description>
		<content:encoded><![CDATA[<p>thanks you very very much!, if i use your example in my localhost<br />
i must replace in proxy.php<br />
$fp = fsockopen (&#8220;62.16.100.204&#8243;, 80, $errno, $errstr, 30); with<br />
&#8220;192.168.101.50&#8243;: is the ip of my cam<br />
$fp = fsockopen (&#8220;192.168.101.50&#8243;, 80, $errno, $errstr, 30);<br />
and in my fla i must replace<br />
motion = new MJPEG(”filerack.de”, “/as3/sp_tracking/proxy.php”, 80);<br />
with<br />
motion = new MJPEG(”localhost”, “/proxy/proxy.php”, 80); </p>
<p>???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flashgordon</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-3941</link>
		<dc:creator>flashgordon</dc:creator>
		<pubDate>Wed, 11 Nov 2009 15:26:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-3941</guid>
		<description>Hi fabrizio,

Josh´s class needs the IP as first param, followed by the file/script to query and the port to open a socket on for this connection.

In my code this looks as follows:

motion = new MJPEG(&quot;filerack.de&quot;, &quot;/as3/sp_tracking/proxy.php&quot;, 80);	

And please note that you have to rename the proxy.phps to *.php so your webserver will execute it instead of opening it as a syntax highlighted view.

Within this file setup your connection to your webcam and there you go :)

You should be able to get a connection if you test your flashfile local from within your IDE.

To make this run on a webserver you need to setup and execute the socketserver mentioned in the previous comments.

Good luck!</description>
		<content:encoded><![CDATA[<p>Hi fabrizio,</p>
<p>Josh´s class needs the IP as first param, followed by the file/script to query and the port to open a socket on for this connection.</p>
<p>In my code this looks as follows:</p>
<p>motion = new MJPEG(&#8220;filerack.de&#8221;, &#8220;/as3/sp_tracking/proxy.php&#8221;, 80);	</p>
<p>And please note that you have to rename the proxy.phps to *.php so your webserver will execute it instead of opening it as a syntax highlighted view.</p>
<p>Within this file setup your connection to your webcam and there you go <img src='http://www.smart-page.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You should be able to get a connection if you test your flashfile local from within your IDE.</p>
<p>To make this run on a webserver you need to setup and execute the socketserver mentioned in the previous comments.</p>
<p>Good luck!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fabrizio</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-3939</link>
		<dc:creator>fabrizio</dc:creator>
		<pubDate>Wed, 11 Nov 2009 14:56:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-3939</guid>
		<description>Hello, Tank you for the examples, and last post , i have used mjpeg class but in local , i have used this code:
import MJPEG;

//&quot;192.168.101.51&quot; host of axis ip cam

var test:MJPEG = new MJPEG(&quot;192.168.101.51&quot;, &quot;/axis-cgi/mjpg/video.cgi&quot;, 80, &quot;root&quot;, &quot;root&quot;);
, i don&#039;t undurstood exactly, to use this class in remote connection,I must replace &quot;192.168.101.52&quot; to &quot;proxy.phps&quot; showed in the 2° post ? My question is , can you give me an example How can i integrate exactly MJPEG class to use in a online web application?</description>
		<content:encoded><![CDATA[<p>Hello, Tank you for the examples, and last post , i have used mjpeg class but in local , i have used this code:<br />
import MJPEG;</p>
<p>//&#8221;192.168.101.51&#8243; host of axis ip cam</p>
<p>var test:MJPEG = new MJPEG(&#8220;192.168.101.51&#8243;, &#8220;/axis-cgi/mjpg/video.cgi&#8221;, 80, &#8220;root&#8221;, &#8220;root&#8221;);<br />
, i don&#8217;t undurstood exactly, to use this class in remote connection,I must replace &#8220;192.168.101.52&#8243; to &#8220;proxy.phps&#8221; showed in the 2° post ? My question is , can you give me an example How can i integrate exactly MJPEG class to use in a online web application?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flashgordon</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-2933</link>
		<dc:creator>flashgordon</dc:creator>
		<pubDate>Mon, 12 Oct 2009 13:25:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-2933</guid>
		<description>Thanks for bringing this to my attention - the example will now work again.

Please feel free to contact me via mail if you need further help.


I will elaborate why a socket server is necessary as this information might be interesting for other readers too:

MJPEG streams are transferred via HTTP but handled a bit different than a normal image-download as they have another mime-type which basically tells the browser to keep the TCP connection open and to expect a continuous feed of new data (images).

With flash you have to open your own TCP connection to the stream, keep it alive and cut the incoming data into images.

That’s basically what Doug´s/Josh´s class does for you.

But as I wrote on my first comment...
Due to the flash players sandbox security policy, every time you try to open a socket-connection, flash query’s the port 843 on that url and expects that a crossdomain policy file is returned and allows the desired connection.

This is intended to prevent you from opening socket connections to services that you don´t own.

So you HAVE to run a socket server that listens on that query and returns the crossdomain file.

This service has to run on your server as an application - you could write it in C/Java/Pearl/Python... - or as I did in PHP.
Using the PHP CLI (Command Line Interface) SAPI you can run PHP scripts from your servers console (via telnet or SSH) - not as an on-demand script but as a program.

So you also need to have access to your servers console.

Executing the PHP socket server as a background task on linux will look something like this:

#nohup php -q sandbox.php &amp;


Cheers!</description>
		<content:encoded><![CDATA[<p>Thanks for bringing this to my attention &#8211; the example will now work again.</p>
<p>Please feel free to contact me via mail if you need further help.</p>
<p>I will elaborate why a socket server is necessary as this information might be interesting for other readers too:</p>
<p>MJPEG streams are transferred via HTTP but handled a bit different than a normal image-download as they have another mime-type which basically tells the browser to keep the TCP connection open and to expect a continuous feed of new data (images).</p>
<p>With flash you have to open your own TCP connection to the stream, keep it alive and cut the incoming data into images.</p>
<p>That’s basically what Doug´s/Josh´s class does for you.</p>
<p>But as I wrote on my first comment&#8230;<br />
Due to the flash players sandbox security policy, every time you try to open a socket-connection, flash query’s the port 843 on that url and expects that a crossdomain policy file is returned and allows the desired connection.</p>
<p>This is intended to prevent you from opening socket connections to services that you don´t own.</p>
<p>So you HAVE to run a socket server that listens on that query and returns the crossdomain file.</p>
<p>This service has to run on your server as an application &#8211; you could write it in C/Java/Pearl/Python&#8230; &#8211; or as I did in PHP.<br />
Using the PHP CLI (Command Line Interface) SAPI you can run PHP scripts from your servers console (via telnet or SSH) &#8211; not as an on-demand script but as a program.</p>
<p>So you also need to have access to your servers console.</p>
<p>Executing the PHP socket server as a background task on linux will look something like this:</p>
<p>#nohup php -q sandbox.php &#038;</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xpb7</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-2932</link>
		<dc:creator>Xpb7</dc:creator>
		<pubDate>Mon, 12 Oct 2009 12:35:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-2932</guid>
		<description>Thanks for such a quick response!
I found your blog very usefull!

Is that ok I contact you here for help or should I better email you? I need a bit more help to make it done. I am good in as3, but not so good in PHP. What means &quot;php socket server that you will have to launch from your servers console&quot; from your last post?

Thanks a lot again!</description>
		<content:encoded><![CDATA[<p>Thanks for such a quick response!<br />
I found your blog very usefull!</p>
<p>Is that ok I contact you here for help or should I better email you? I need a bit more help to make it done. I am good in as3, but not so good in PHP. What means &#8220;php socket server that you will have to launch from your servers console&#8221; from your last post?</p>
<p>Thanks a lot again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xpb7</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-2931</link>
		<dc:creator>Xpb7</dc:creator>
		<pubDate>Mon, 12 Oct 2009 12:30:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-2931</guid>
		<description>Sorry, I got that it is possible.
Now I am trying to solve sandbox security problem, using proxies as you advices.
By the way, why your example shows me nothing when I go to &quot;http://www.smart-page.de/as3/sp_tracking/&quot;?</description>
		<content:encoded><![CDATA[<p>Sorry, I got that it is possible.<br />
Now I am trying to solve sandbox security problem, using proxies as you advices.<br />
By the way, why your example shows me nothing when I go to &#8220;http://www.smart-page.de/as3/sp_tracking/&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flashgordon</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/comment-page-1/#comment-2930</link>
		<dc:creator>flashgordon</dc:creator>
		<pubDate>Mon, 12 Oct 2009 12:20:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281#comment-2930</guid>
		<description>Hi Xpb7,

yes, it´s possible but you will need Josh´s streaming class, a php-proxy that fetches the feed (assuming that it doesn´t originate from your own server) and a php socket server that you will have to launch from your servers console.

You can find the link to the MJPEG streaming class within the post and I wrote a quick howto to the proxy and socketserver including script examples within the second comment.</description>
		<content:encoded><![CDATA[<p>Hi Xpb7,</p>
<p>yes, it´s possible but you will need Josh´s streaming class, a php-proxy that fetches the feed (assuming that it doesn´t originate from your own server) and a php socket server that you will have to launch from your servers console.</p>
<p>You can find the link to the MJPEG streaming class within the post and I wrote a quick howto to the proxy and socketserver including script examples within the second comment.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
