Re-stream video from an IP camera (RTSP/RTP re-streaming) in Wowza Streaming Engine

Publish a live stream from an IP camera to Wowza Streaming Engine™ media server software for playback on a wide variety of players.

Video tutorial: Send video from an IP camera to Wowza Streaming Engine


See how to use an IP camera to stream to Wowza Streaming Engine.

Before you start


You should complete the following tasks:

Configure playback authentication


  1. In the contents panel for your application, click Playback Security, and then click Edit.
  2. On the Playback Security page, select No client restrictions, and then click Save.

  3. Click Restart Now.
     

Publish the stream in Wowza Streaming Engine Manager


Now create a .stream file to publish your live stream to Wowza Streaming Engine.

  1. Consult your camera's documentation to configure an outgoing live stream.
     
  2. Create the .stream file:
     
    1. In the Server contents panel, click Stream Files, and then click Add Stream File.

      Note: You can also start the procedure to create a .stream file in the Applications contents panel for the application.
    2. In the Add Stream File dialog box, enter a name for the new stream file, enter Stream URI, and then click Add.

      IP camera manufacturers use proprietary URL syntax. Consult your camera documentation for the URL syntax of the stream and enter this value in Stream URI.

  3. Start the stream:
     
    1. In the Server contents panel, click Stream Files, and then click the Connect icon for the stream file you created in step 2.
    2. In the Connect a Stream File dialog box, select your application in Application Name and rtp in MediaCaster Type, and then click OK.

      Note: Use the rtp-record MediaCaster type for re-streaming while simultaneously recording the stream to a single file in the application's streaming file directory. For more information, see About recording MediaCaster streams.

A message appears indicating the connection is successful.

Configure adaptive bitrate streaming


To implement adaptive bitrate streaming you can ingest camera.stream through Transcoder to create a Synchronized Multimedia Integration Language (SMIL) file. For details, see Stream adaptive bitrate content with Wowza Streaming Engine.

Test playback


Playback URLs

To test playback, you need the playback URLs for your stream and the playback types, or streaming protocols, you want to test. You can get playback URLs from the Test Playback window in Wowza Streaming Engine Manager or by entering information about the stream on the Video Test Players webpage. For more information about playback URLs, see About playing Wowza Streaming Engine streams.

The Test Playback window generates playback URLs for each protocol based on the page you're on when you click Test Playback. You can also edit the Server (IP address or domain name), Stream or Media File Name, and Application fields to update the playback URLs for all protocols as needed.

Test players

To play your stream, enter the playback URL into your player or a mobile browser, depending on the playback type. To learn more about stream playback, see the Players and Playback articles.

You can also test playback using the Video Test Players webpage. Select the tab for the protocol you want to test and enter the playback URL above the player. Entering the server (IP address or domain name), stream name, application name, and application type (VOD or live) will also generate the playback URLs for each protocol. Click Start to play your stream, and then click Stop when you're ready to end your test.

In playback URLs for stream files, the stream name includes the .stream file extension. For example, to use the HLS protocol to play a stream file named camera.stream, use the following playback URL:

http://[address]:1935/myApplication/camera.stream/playlist.m3u8

Troubleshooting


Check your IP camera source

First, make sure your camera can send H.264, H.265, AAC, or MP3 content. You can do this by using the VideoLAN VLC player.

  1. Open the VLC player.
     
  2. On the Media menu, click Open Network Stream, enter your camera's RTSP URL, and then click Play.
     
  3. After the stream starts playing, on the Tools menu, click Codec Information, and make sure that one or two of the following codecs are listed:
     
    • H.264 or AVC1 or MPEG4 Part10
       
    • H.265 or HEVC
       
    • AAC
       
    • MP3

If your camera doesn't support the proper formats, the stream must be transcoded before it's sent to Wowza Streaming Engine.


Change the RTP transport mode

If your camera doesn't support RTSP/RTP interleaved (RTP over TCP), change the RTPTransportMode property from interleave to udp.

Note: The MediaCaster RTPTransportMode property applies to all streams delivered by the application. For information on changing RTSP properties for a single stream, see RTSP stream settings.

To change RTP transport mode for an application, open the Application.xml file for your live application ([install-dir]/conf/[application]) and change the RTPTransportMode property to udp as follows:

<MediaCaster>
   <RTP>
      <RTSP>
         <!-- udp, interleave -->
         <RTPTransportMode>udp</RTPTransportMode>
      </RTSP>
   </RTP>
   ...
</MediaCaster>

Then, restart Wowza Streaming Engine to apply the changes.

Turn off RTSP validation

Some IP cameras may fail when Wowza Streaming Engine tries to periodically validate the RTSP/RTP connection. The camera will disconnect and reconnect every 15 to 30 seconds. You can turn off RTSP/RTP validation by adding the rtspValidationFrequency property to your application.

Note: The MediaCaster rtspValidationFrequency property applies to all streams delivered by the application. For information on changing RTSP properties for a single stream, see RTSP stream settings.
  1. Click the Applications tab and then click the name of your live application in the contents panel.
  2. On the Properties tab of the live application page, click Custom in the Quick Links bar.
  3. In the Custom area, click Edit.
     
  4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:
     
    • Path - Select /Root/Application/MediaCaster
       
    • Name - Enter rtspValidationFrequency
       
    • Type - Select Integer
       
    • Value - Enter 0 (ms). Specifying 0 turns validation off.
  5. Click Save, and then restart the application to apply the changes.

The property is added to the application's Application.xml file within the <MediaCaster>/<Properties> container element as in the following example:

<Property>
   <Name>rtspValidationFrequency</Name>
   <Value>0</Value>
   <Type>Integer</Type>
</Property>

Filter unknown tracks

Some IP cameras send additional application tracks that Wowza Streaming Engine can't understand. You can filter these tracks by adding the rtspFilterUnknownTracks property.

Note: The MediaCaster rtspFilterUnknownTracks property applies to all streams delivered by the application. For information on changing RTSP properties for a single stream, see RTSP stream settings.
  1. Click the Applications tab and then click the name of your live application in the contents panel.
     
  2. On the Properties tab of the live application page, click Custom in the Quick Links bar.
  3. In the Custom area, click Edit.
     
  4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:
     
    • Path - Select /Root/Application/MediaCaster
       
    • Name - Enter rtspFilterUnknownTracks
       
    • Type - Select Boolean
       
    • Value - Enter true
  5. Click Save, and then restart the application to apply the changes.

The property is added to the application's Application.xml file within the <MediaCaster>/<Properties> container element as in the following example:

<Property>
   <Name>rtspFilterUnknownTracks</Name>
   <Value>true</Value>
   <Type>Boolean</Type>
</Property>

Turn audio or video tracks off

You can turn off audio or video tracks by adding the rtspStreamAudioTrack and rtspStreamVideoTrack custom properties.

Notes: These MediaCaster properties apply to all streams delivered by the application. For information on changing RTSP properties for a single stream, see RTSP stream settings.
  1. Click the Applications tab and then click the name of your live application in the contents panel.
     
  2. On the Properties tab of the live application page, click Custom in the Quick Links bar.
  3. In the Custom area, click Edit.
     
  4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:
     
    • Path - Select /Root/Application/MediaCaster
       
    • Name - Enter rtspStreamAudioTrack
       
    • Type - Select Boolean
       
    • Value - Enter false
  5. Repeat Step 4 to add the rtspStreamVideoTrack property using the following values:
     
    • Path - Select /Root/Application/MediaCaster
       
    • Name - Enter rtspStreamVideoTrack
       
    • Type - Select Boolean
       
    • Value - Enter false
  6. Click Save, and then restart the application to apply the changes. 

The properties are added to the application's Application.xml file within the <MediaCaster>/<Properties> container element as in the following example:

<Property>
   <Name>rtspStreamAudioTrack</Name>
   <Value>false</Value>
   <Type>Boolean</Type>
</Property>
<Property>
   <Name>rtspStreamVideoTrack</Name>
   <Value>false</Value>
   <Type>Boolean</Type>
</Property>

Find missing audio or video

To determine if audio or video is missing from the IP camera source, check Wowza Streaming Engine logs for either of the following warning statements:

RTPSessionDescriptionDataProviderBasicRTSPWorker.buildSDPData: SDP data missing rtpmap entry for [audio] track. Try adding MediaCaster/Property rtspDefaultAudioRTPMap with track media information.

RTPSessionDescriptionDataProviderBasicRTSPWorker.buildSDPData: SDP data missing rtpmap entry for [video] track. Try adding MediaCaster/Property rtspDefaultVideoRTPMap with track media information.

If either or both statements are present, add the missing track or tracks.

Add missing tracks in Wowza Streaming Engine Manager

  1. Click the Applications tab and then click the name of your live application in the contents panel.
     
  2. On the Properties tab of the live application page, click Custom in the Quick Links bar.
  3. In the Custom area, click Edit.
     
  4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:
     
    • Path - Select /Root/Application/MediaCaster
       
    • Name - Enter rtspDefaultAudioRTPMap
       
    • Type - Select String
       
    • Value - Enter PCMU/8000
  5. Click Save, and then restart the application to apply the changes.

The property is added to the application's Application.xml file within the <MediaCaster>/<Properties> container element as in the following example:

<Property> 
   <Name>rtspDefaultAudioRTPMap</Name> 
   <Value>PCMU/8000</Value>
   <Type>String</Type>
</Property>

Check the RTSP KeepAlive property

Some IP cameras require a keepalive to be sent as the GET_PARAMETER to keep the connection open. This can be sent by adding the rtspKeepAliveCommand property.
  1. Click the Applications tab and then click the name of your live application in the contents panel.
     
  2. On the Properties tab of the live application page, click Custom in the Quick Links bar.
  3. In the Custom area, click Edit.
     
  4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:
     
    • Path - Select /Root/Application/MediaCaster
       
    • Name - Enter rtspKeepAliveCommand
       
    • Type - Select String
       
    • Value - Enter GET_PARAMETER
  5. Click Save, and then restart the application to apply the changes.

The property is added to the application's Application.xml file within the <MediaCaster>/<Properties> container element as in the following example:

<Property>
   <Name>rtspKeepAliveCommand</Name>
   <Value>GET_PARAMETER</Value>
   <Type>String</Type>
</Property>

More resources