Stream live media (RTMP)

Tutorial: stream live media (RTMP)

To complete this tutorial, install the following software:

  • Flash Media Live Encoder

    Flash Media Live Encoder captures live audio and video, encodes it, and streams it to Flash Media Server. Flash Media Live Encoder is free so it’s a good idea to download the latest version.

  • Flash Media Server

    You can use any edition of Flash Media Server to stream live media, including the free developer edition. For information about installing the server, see Installing the server.

  • Flash Player

    This tutorial uses a video player that requires Flash Player 10.

For more information, see Supported clients, encoders, codecs, and file formats and Pre-built media players.

Publish a live stream to Flash Media Server

  1. Connect a camera to the computer.

  2. Open Flash Media Live Encoder and do the following in the Encoding Options panel:

    1. From the Preset menu, choose High Bandwidth (300 Kbps) - H.264.

      You can choose any of the single stream options (not Multi Bitrate) from the Preset menu. The information on the left side of the panel is filled in when you choose a preset.

    2. Select Stream to Flash Media Server.

    3. For FMS URL, enter rtmp://localhost/live.

      Use localhost for testing when Flash Media Live Encoder and Flash Media Server are on the same computer. In a production environment, use the domain name or IP address of the computer hosting Flash Media Server, for example, rtmp://

      If you’re using a Flash Media Server hosting provider, they can give you the domain name or IP address of the server.

      You must use the name live in the FMS URL unless you duplicate and rename the live service. The live service is a pre-built application on Flash Media Server installed to rootinstall/applications/live. For more information, see Duplicate the live service.

    4. For Stream, enter livestream.

    5. To save a recording of the stream on your hard drive, select Save to File, click Browse, and choose a location. If you chose an H.264 preset, use an .f4v filename extension. If you chose a VP6 preset, use an .flv filename extension.

      Note that the server is not recording the file; Flash Media Live Encoder is recording the file. To serve the file on-demand when the live event is over, copy the file to the server. For more information, see Stream on-demand media (RTMP).

      To play an F4V file recorded by Flash Media Live Encoder without streaming it from the server, use the F4V Flattener tool to flatten the file. You can play FLV files without flattening them.

    6. Click Start to connect to the server and start streaming.

Use the Flash Media Server sample player to play a live stream

  1. Double-click the rootinstall/samples/videoPlayer/videoplayer.html file to open the sample video player in a browser.

    Note: Substitute the Flash Media Server installation directory for rootinstall.
  2. In the sample video player, do one of the following:

    • In the list of videos, click “livestream”.

    • Enter rtmp://localhost/live/livestream, check the LIVE checkbox, and click PLAY STREAM.

      If the media player isn’t on the same computer as Flash Media Server, replace localhost with the domain name or IP address of the computer hosting Flash Media Server.

      Use this URL to play this stream from any compatible video player, including Flash Media Playback and Strobe Media Playback. For more information about the sample video player and other video players, see Pre-built media players.

Use Flash Media Playback to play a live stream

  1. Load the Flash Media Playback Setup page in a web browser:

  2. Enter the Video Source:


    You can replace localhost with the domain name or IP address of the server.

  3. Click Preview to update the embed code.

  4. Click Play to test the code.

  5. To use the player in your own HTML page, copy the embed code and paste it into your page. Flash Media Playback is a compiled SWF file hosted by Adobe.

URLs for publishing and playing live streams over RTMP

Use the following values to publish a single live stream to Flash Media Server for streaming over RTMP:

FMS URL: rtmp://fms-ip-or-dns/live

Stream: streamname

Use the following URL to play a live stream:


Duplicate the live service

You can create as many instances of the live service as you need.

  1. Create a folder in the rootinstall/applications folder, for example, rootinstall/applications/live2

  2. Copy the main.far, Application.xml, allowedHTMLdomains.txt, and allowedSWFdomains.txt files from the rootinstall/applications/live folder to the live2 folder.

  3. Open the fms.ini file (located in rootinstall/conf) and add a parameter to set the content path for the new service, for example:
    LIVE2_DIR = C:\Program Files\Adobe\Flash Media Server 4.5\applications\live2
  4. Open the Application.xml file in the rootinstall/applications/live2 folder and edit the virtual directory to the following:

  5. Restart the server.

  6. Clients can connect to the new publishing point at the URL:


Modify server-side code in the live service

Note: You cannot modify server-side code in the live service on Flash Media Streaming Server.

 Remove the rootinstall/applications/live/main.far file and replace it with the rootinstall/samples/applications/live/main.asc file.

Disable live services

 Move any live services folders out of the applications folder.