Converting RTSP to RTMP for Ingestion to Kaltura Live

Background

Kaltura Live only supports ingestion via RTMP.  However, there are many devices that do not support RTMP broadcasts.  Examples of these types of broadcasts include many IP-enabled cameras (e.g. Axent security cameras).  This article describes a method to use a Wowza Media Server to convert RTSP broadcasts to RTMP to forward to Kaltura Live. 

The following example can be generalized for any device broadcasting in RTSP.  This example specifically describes an RTSP source, but the Wowza server can also ingest live streams in RTP, RTMP, MPEG-TS (unicast and multicast) and ICY protocols.  Though untested, this methodology should support rebroadcasting any of these protocols as RTMP.

Overview of the Solution

To convert RTSP to RTMP,  you can use the “Stream Targets” feature of the Wowza Media Server.  A brief description of the Stream Targets feature can be found in the article Use Wowza CDN for Live Stream Distribution.

Detailed documentation of the Wowza Streaming Engine can be found  in the Wowza Streaming Engine User"s Guide.

 

To implement the solution:

  1. Install the Wowza Server.
  2. Configure a Live Entry in KMC or KMS, or a Webcast Event in KMS.
  3. Configure the device to broadcast via RTSP to the Wowza Server.
  4. Configure the Stream Target on the Wowza Server.

Install the Wowza Server

  1. Download and install the Wowza Streaming Engine.  This example uses Wowza version 4.4.
  2. Patch the Wowza Server to version 4.4.1.02 (Build18064) or later.  If you are already using version 4.4.1, you will need to obtain the patch from Wowza support.  Later versions may not require the patch.
  3. Using the Wowza administration webpage for the server installed in step 1 (http://<wowza_server_ip>:8088), navigate to the "Applications Tab." 
  4. Under the default "live" application, select Source Security and select Open (no authentication required) for RTSP Sources.


Configure a Live Entry in KMC or KMS, or a Webcast Event in KMS

  1. Configure the live entry or webcast entry per your normal method.
  2. Note the URL and Stream Name provided once the entry is created.  This example uses the following details from a live entry in KMC:

Configure the Device to Broadcast via RTSP to the Wowza Streaming Engine

  1. Note the Stream Name chosen when configuring <the device> . In this example the stream name is "dhmc".  You will need this when configuring the Stream Target on the Wowza server later.
  2. <Insert Screenshot from D-H's TCS when you get it>
  3. If you have the device configured correctly for broadcasting, you should see something similar to this in the Wowza administration interface, and you will be able to preview the stream from the Wowza server:


Note:  For testing, it is unlikely you have a CiscoTCS available.  As an alternative, You may use ffmpeg to broadcast RTSP instead of CiscoTCS.  An example ffmpeg syntax using "dhmc" as the stream name to do this is:
ffmpeg -r 30 -f avfoundation -i "0:0" -c:v libx264 -headers 'User-Agent: "FMLE/3.0 (compatible; FMSc/1.0)"' -f rtsp -rtsp_transport udp rtsp://wowza_server_ip:1935/live/dhmc

Configure the Stream Target on the Wowza Server

  1. Using the Wowza Server administration interface, navigate to the "Stream Targets" section of the default live application.
  2. Enable Stream Targets if necessary, this may require restarting the live application instance.
  3. Add a Stream Target.

  4. Select the Destination.
    Choose Generic RTMP as the destination type and click Next.
  5. Use the following settings to map the incoming live source stream to the stream target destination.

    Note: If you change the settings for a stream target that has an active stream, the stream target will be restarted.

    Stream Target Name

    The name of the stream target. Use a name to help you identify it from other stream targets. For example, name a stream target to indicate its destination, protocol, and rendition (myDestination-RTMP-720p). The name must be unique and can't contain less-than (<), greater-than (>), colon (:), quotation (' and "), forward slash (/), backslash (), pipe (|), question mark (?), asterisk (*), double-dot (..), and tilde (~) characters.

    Source Stream Name

    The name of the incoming source stream that will be sent to the destination.

    Destination Application Name

    The name of the application that you provisioned at this stream target's destination. The stream target will send the stream to this application.

    Destination Application Instance

    The name of the application instance that you provisioned at this stream target's destination. The stream target will send the stream to this application instance, or if none is specified, to the default application instance. Leave blank.

    Destination Host

    The hostname or IP address of the destination server that the source stream will be sent to.

    Destination Port

    The port on the destination server that the source stream will be sent to. The Destination Port is always 1935.

    Destination Stream Name

    The name of the stream that the stream target will send to the destination. Some destinations will require that you use a specific stream name, which you must enter here.  The Destination Stream Name is the stream name from the Live Entry or Webcast Entry from KMS/KMC.

    User Name

    The user name to access the destination, if the destination server authenticates the connection. Leave blank.

    Password

    The password to access the destination server, if the destination server authenticates the connection. Leave blank.

  6. Configure the following parameters:
    1. For stream Target Name, choose a logical name for your usage. 
    2. Source Stream Name:  Use the stream name you created in the Cisco TCS above.  
      In this example the Source Stream Name is dhmc.
    3. Destination Application Name:   kLive/ with the query string parameters.
      in this example, this is kLive/?p=2033951&e=1_w3j5oy6n&i=0&t=f2736f0f
    4. Destination Application Instance:  Leave Blank.
    5. Destination Host:  The IP address or DNS name of the target server
      In this example, this is pa-publish.kaltura.com
    6. Destination Port is always 1935
    7. Destination Stream Name is the stream name from the Live Entry or Webcast Entry from KMS/KMC.
      In this example, it is 1_w3j5oy6n_1
    8. User Name -  leave blank.
    9. Password -  leave blank.
  7. Alternately, you can manually edit the PushPublishMap.txt configuration file in <wowza_install_dir>/conf/live/
    The configuration appended to that file in this example is:
    dhmc={"entryName":"DHMCTest_Wowza", "profile":"rtmp", "application":"kLive/?p=2033951&e=1_w3j5oy6n&i=0&t=f2736f0f", "destinationName":"wowzastreamingengine", "host":"pa-publish.kaltura.com", "streamName":"1_w3j5oy6n_1", "debugLog":"true"}

 

When the stream target is correctly configured and the RTSP source is broadcasting the following screen is displayed:

Was this article helpful?
Thank you for your feedback!
In This Article
Related Articles
Back to top

Never miss a thing!

Subscribe to our customer newsletter and our release notes updates, so you always get the best out of Kaltura.
Newsletter