<?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>timwhitlock.info &#187; Flash Media Server</title>
	<atom:link href="http://timwhitlock.info/blog/tag/flash-media-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://timwhitlock.info</link>
	<description>Tim Whitlock&#039;s personal site and blog</description>
	<lastBuildDate>Thu, 15 Dec 2011 13:51:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Flash Media Server &amp; FLVPlayback nightmare</title>
		<link>http://timwhitlock.info/blog/2008/05/14/flash-media-server-flvplayback-nightmare/</link>
		<comments>http://timwhitlock.info/blog/2008/05/14/flash-media-server-flvplayback-nightmare/#comments</comments>
		<pubDate>Wed, 14 May 2008 23:33:51 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Media Server]]></category>
		<category><![CDATA[FMS]]></category>
		<category><![CDATA[RTMP]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/05/14/flash-media-server-flvplayback-nightmare/</guid>
		<description><![CDATA[I am pretty new to Flash Media Server, but on my current project I have been charged with setting it up. Today, I ran into a thoroughly unpleasant problem, possibly a bug, which I thought I would share. I set up our simple FMS application, which merely streams video from a three-directory-deep file structure. This [...]]]></description>
			<content:encoded><![CDATA[<p><strong>I am pretty new to Flash Media Server</strong>, but on my current project I have been charged with setting it up. Today, I ran into a thoroughly unpleasant problem, possibly a bug, which I thought I would share.</p>
<p><span id="more-37"></span>I set up our simple FMS application, which merely streams video from a three-directory-deep file structure. This means our Flash front end must,<br />
a. connect to an instance of the application, say: <code>rtmp://mydomain.com/myApp/_definst_</code><br />
b. request the stream of an FLV resource, such as:<br />
<code>flv:ab/cd/ef/vwxyz</code>.</p>
<p>Note the explicit use of the default application instance <code>_definst_</code>, and also the odd reshuffling of the FLV path. This is how you&#8217;re supposed to do it [apparently]  and it worked just fine. Hoorah.</p>
<p>After running some successful tests with a simple front end using <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetConnection.html" target="_blank">NetConnection</a>, I am told that our Flash front end (actually Flex) will be using a skinned <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html" target="_blank">FLVPlayback</a> component. This component doesn&#8217;t ask you to split the resource into these two pieces; it takes a single, complete stream URL. The above example would mean passing in: <code>rtmp://mydomain.com/myApp/_definst_/ab/cd/ef/vwxyz.flv</code><br />
Note we still keep the instance name, and the flv extension is optional.<br />
This worked just fine on our dev server, and when we deployed to a live server it seemed to be ok too. Hoorah x 2!</p>
<p><strong>Anyhow, I&#8217;ll get to the &#8220;but&#8221;.</strong></p>
<p>After gong live, we received reports of videos not playing, and were unable to replicate the problem at will. Eventually I noticed in the log files that FMS was throwing 404s. On closer inspection, the 404s were for resources prefixed with our application instance name <code>_definst_</code>. The successful 200 responses were requested correctly as <code>ab/cd/ef/vwxyz</code>, but the failures were referenced as <code>_definst_/ab/cd/ef/vwxyz</code>. Most alarmingly these were sometimes for the same resources, and even from the same client.</p>
<p>It looks like under certain [unknown] circumstances, the application and the resource are not getting correctly split out of the full URL. I do not know at what point this error creeps in. I also don&#8217;t know what FLVPlayback does internally to make the stream request from the full URL you pass in. All I know is that the error appears arbitrarily, and has proved impossible to raise on purpose. Possibly a bug in FLVPlayback, or a bug in Flash Media Server?</p>
<p><strong>Solution</strong></p>
<p>A real solution I have not found, so I did a very dirty hack.<br />
As I have failed to avoid the 404s, I turned the bad paths into valid paths by sym-linking the FLV directory back to itself with the name <code>_definst_</code>, as follows:</p>
<pre class="code">cd /path/to/flvs
ln -s . _definst_</pre>
<p>Job done, but I&#8217;m not happy about it. Anyone able to offer a real solution, please post a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://timwhitlock.info/blog/2008/05/14/flash-media-server-flvplayback-nightmare/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

