Skip to content

Zero code live streaming with red5

rajdeeprath edited this page Sep 21, 2016 · 24 revisions

Red5 media server use-case ready streaming engine. By this I intend convey that if you are looking to set-up live streaming using red5, you need not go through the pain of setting up a development environment and code anything.

To set-up you do not need to know about programming applications or Java. Red5 open source media server comes as a - Ready to use - Easy to set-up - and - Free to use (with no strings attached) media server.

This lesson is not directly development related, but more of a bonus lesson in this series, which intends to show how easy it is to set-up live streaming with red5 media server in minutes.


PREREQUISITE

  • You should have installed your media server properly on the host system where it is intended to run. The server start-up should be without errors or warnings. This also means that all prerequisites for Red5 media server should have been met.

  • Flash player should be installed (For playback of live stream)

  • You must have a web-cam device with integrated microphone (For publishing the live stream)


COMPONENTS OF SIMPLE LIVE STREAMING SET-UP

  • Broadcaster entity / user - (Broadcaster)
  • Broadcasting software / hardware to encode the stream into a supported format - (Adobe flash media live encoder)
  • Media server to receive published stream and relay the same to subscribers - (Red5 media server)
  • Subscriber entity / user - (Subscriber)
  • Subscribing software / hardware to decode the stream and render it on screen - (Adobe Flash player)


BROADCASTER SETUP

  • Download & install “Adobe Flash Media Live Encoder” from adobe’s website via the li9nk below: http://offers.adobe.com/en/na/leap/landings/fmle3.html

  • Make sure your web-cam device is properly installed and connect to you computer system

  • Make sure your red5 media server is started & running. Ensure that your personal firewall does not block port 1935 which is the default RTMP port used by red5.

  • When you download the latest Red5 media server distribution, you automatically procure the server side applications along with it. These applications can be found in {RED5HOME}/webapps/ directory.

For our setup we will be using the application called “live”. This application will serve as a unique point in the media server where a user connects.

  • Run the previously installed , "Flash media live encoder" software on your system and enter the following url in FMS Url text field: rtmp://localhost/live and then enter the following in the Stream text field : demo

Flash media live encoder UI

rtmp://localhost/live : Specifies the live application in Red5 media server as the streaming application.

demo : Specifies the name of the stream that we will be publishing.


---

PUBLISHING STREAM TO RED5

  • Press the Connect button to connect to the media server endpoint. Once connected the button label changes to disconnect.

  • Press the Start button to start broadcasting to the server. Once publishing starts you will be able to see the same in flash media live encoder log window.

Flash media live encoder publishing

This concludes the broadcast process. Now you are successfully publishing a stream called “demo” to your media server endpoint rtmp://localhost/live. Flash media live encoder is the encoding software which captures raw data from your camera and/or microphone device(s) and encodes them into a single stream called demo using industry standard codecs.

Next we'll set up the subscribe process and see how to consume the broadcast stream.


---

SUBSCRIBER SETUP

  • Ensure that you have the latest flash plugin installed on your system. To check for flash player or download visit this url: https://get.adobe.com/flashplayer/

  • Once flash player is installed we shall load a sample flash based video player to view the stream. To do so launch a new browser instance and visit the following url: https://rajdeeprath.github.io/red5-server/player/

  • Configure the settings as shown in the image below. Note the src field value : rtmp://localhost/live/demo

  • Hit the “Preview and generate button” to generate the sample player.

Strobe media player setup


---

SUBSCRIBING TO THE STREAM FROM RED5

  • Click the play button to start subscribing to the stream.

You should now be able to view the live stream feed that you are broadcasting from adobe flash media live encoder. The player we used is a open sourced sample player. When deploying your streaming setup, you can use an existing player such as jwplayer of flowplayer or this sample player (adobe strobe media playback).

The flash plugin decodes the stream received from red5 media server and delegates the video player to render the stream (audio + video) on your system

Strobe media player playing


Red5 media server logging


Note: When using Red5pro you can target mobile devices using HTML5 standard video tag for browser or use a platform specific SDK (IOS and android) for application based deployment.


CONCLUSION:

As you might have noticed, we were able to complete a simple set-up involving the broadcast and subscribe of a live stream without having to code anything.