As part of the ongoing development of my SWF Tools project I needed to get a streaming media server up and running to try things out.
I started out with Red5, an open source server, which pretty much worked out the box (or off the download!)
I then discovered you can get the offical Adobe Flash Media Server for free in a "development" edition that limits you to ten streams. Perfect for local development I thought.
It has taken me the best part of two nights to actually get it running with my existing XAMPP installation though! The final answer was so simple it seems trivial - in fms.ini change ADAPTOR.HOSTPORT = :1935,80 to ADAPTOR.HOSTPORT = 127.0.0.1:1935!
For future reference, here's what (I think) was happening.
When you install FMS it offers to install Apache as well. I didn't want that as I already had Apache running in my existing Xampp set up, which is where all my Drupal development stuff is.
But, if I started Xampp, and then started FMS, then I couldn't connect to any of the video streams. If I started FMS I then couldn't start Xampp because FMS was grabbing port 80 for itself.
If I amended fms.ini so it didn't listen on port 80, by setting ADAPTOR.HOSTPORT = :1935 then none of the test videos work! I didn't understand why that should be since I was only trying to stream over RTMP, and that should default to 1935.
When I looked at the administration log I could see that all the streams were connecting via RTMPT, not RTMP. That means they were failing to connect on 1935, and were falling back to RTMPT (tunelling), and that needs port 80, so that's why things were failing.
I tried all sorts, including the suggestions on the Adobe website. However, trying to set FMS to proxy out to Apache (by changing the Apache listen port) broke everything.
I'm not quite sure where I found it, but from one website I ended up opening the Adaptor.xml file under conf/_defaultRoot_. There's a section in there called <HostPortList>, and the comments describe binding the server to to an IP address. The comments refer to binding 127.0.0.1, the localhost. In a flash (no pun intended) of desperation I tried adding the localhost IP address by changing ADAPTOR.HOSTPORT in fms.ini to ADAPTOR.HOSTPORT = 127.0.0.1:1935.
I restarted the server, tried the test page, and suddenly it's connecting on RTMP!
I ran the Xampp port check program, and found that port 80 was now free. So I started Xampp, and that fired up too.
Last step, I tried to access the streamed content from my Drupal development site and I had video!
At last - streaming video on a test server. Now I can go back to what I was TRYING to do before...
Note - these instructions will get the media server up and running on localhost, where both the regular web server and the Flash Media Server need to co-exist, and the only requirement is to stream media over rtmp. It is not a solution for a "real" webserver since the fix described prevents fall back and tunelling over rtmpt.
Comments
fms with XAMPP won't work locally
I have done what everything you said but i still can't make the fms work. I changed ADAPTOR.HOSTPORT in "fms.ini" to ADAPTOR.HOSTPORT = 127.0.0.1:1935, but i still cant stream. In XAMPP if i press "Port-check" while apache is running i get the following results:
Service Port Status
================================================
Apache 80 Program: C:\xampp\apache\bin\httpd.exe
Apache 81 free
Apache 443 Program: C:\xampp\apache\bin\httpd.exe
Have in mind that if i enter localhost on top of my browser i have the XAMPP interface loaded. I can't think anything why it doesn't work. Do i have to transfer any files from "fms" directory to "htdocs"?
If anyone knows how to fix that please contact me or write a comment after me..
my email: "andreas.8bit@hotmail.com"
FMS Port problem
Hi,
I am facing port problem as like this.
i installed fms in my server, and already its running a apache for hp, so want to run this fms as a separate port in 8083
While installing i gave port number as 8083,and now its shows in "fms.ini"
ADAPTOR.HOSTPORT = 1935,8083
I think it should listen any of these ports, but its not working while am acessing
domain.com:8083 domain.com:1935
Please tell me why its not working
Thanks in advance
connecting FMS with XAMPP
Ahh Thanks Buddy!! You saved my Hours and Hours.....Thanks Again.....Great Work..keep going...
Thanks !
Hi,
thanks a lot for this post !
I 've spend a lot of time before finding it : thanks, thanks, thanks, thanks and thanks again.
Serge
Still breaking head with Xampp n FMS
Tried the above
Changed
Adaptor.xml file under conf/_defaultRoot_. - ADAPTOR.HOSTPORT = 127.0.0.1:1935
The apache and Mysql are running but - shows this message Apache started [Port 80] Busy...
Now 1 more thing i see is my Xampp 6.8 [apache] - could this be the reason its not working as the apache version of Xampp is different from FMS [apache 2.2]
will look forward for your comment