Quick and Easy RTMP Flash Streaming Video with Red5 on FreeBSD

Install Red5

Installing Red5 on FreeBSD is very straight forward.  The port pretty much takes care of everything.  Log on to your FreeBSD console, browse to the port's directory and install it.

cd /usr/ports/www/red5
make install

When the port has finished installing, you'll need to edit your rc.conf file to allow the Red5 server to start.  Open up /etc/rc.conf in your favorite text editor and add the following line to the end.   (If you have Webmin, you can do this from the "Bootup and Shutdown" section under "System".)

red5_enable="YES"

Next, we must allow network connections to our server.  Edit the file /usr/local/red5/conf/red5.properties and change all the instances of 127.0.0.1 to 0.0.0.0.  For example:

...
# HTTP
http.host=0.0.0.0
http.port=5080
https.port=8443

# RTMP
rtmp.host=0.0.0.0
rtmp.port=1935
rtmp.io_threads=16
rtmp.connect_threads=4
rtmp.send_buffer_size=271360
rtmp.receive_buffer_size=65536
rtmp.ping_interval=1000
rtmp.max_inactivity=60000
rtmp.tcp_nodelay=true
...

We must enable the RTMPTLoader, otherwise our sever won't work properly.  Do this by un-commenting the RTMPT section in the /usr/local/red5/conf/red5-core.xml file.  This is located in and around line 117 through 153, just remove the XML comment tags at the beginning and end.

Finally, we can start our Red5 server.  Simply issue the following command (or if your using Webmin, do it from the Bootup and Shutdown section.)

service red5 start

Verify that the server is working by connecting to it on port 5080 from your web browser.  For example: http://freebsd.domain.tld:5080.  You should see the Red5 logo with links to demos.  Click on Launch a demo and click on the Shared Ball demo to verify it loads.  The demo won't do anything, we just want to make sure that the page loads with no errors.

At this point, we have a fully functional RTMP server.  Make sure (if necessary) to open or forward tcp port 1935 to your FreeBSD server so it is accessible from the Internet.

Pacy
Powered by Pacy