• How to re-stream video from an IP camera (RTSP/RTP re-streaming)

    This tutorial provides the basic steps for using Wowza Streaming Engine™ software to re-stream an IP camera that supports H.264 video and AAC or MP3 audio. Use this tutorial to set up an application named live to stream live content to Adobe Flash Player, Microsoft Silverlight player, Apple iOS devices, and RTSP/RTP-based players.

    Contents



    Tutorial

    Troubleshooting


    Related Articles

    Tutorial


    Configuration


    Wowza Streaming Engine Manager configuration
    This section shows you how to set up a live streaming application in Wowza Streaming Engine Manager. Users play the live stream to view an event as it happens. Live streams are sent to the streaming engine from an encoder that delivers a stream in the MPEG-2 Transport Stream (MPEG-TS) format. The example uses an application named live, which is included in default installations of Wowza Streaming Engine software 4.0. The procedure is the same if you want to create a new live streaming application.

    You can use the Streaming Engine manager with the latest versions of most web browsers that support HTML5 and Cascading Style Sheets level 3 (CSS 3). We recommend the Google Chrome browser.

    1. Start Wowza Streaming Engine Manager.

    2. In the manager Welcome page, click Applications at the top of the page.

    3. Configure the live application:

      1. In the contents pane, click live. (This example uses the installed live application. If you want to create a new live streaming application, Click Add, then Live, and then follow the instructions in the UI.)

      2. On the Setup tab, click Edit.


      3. Select the following Playback Types options: MPEG-DASH, Adobe HDS, Apple HLS, Microsoft Smooth Streaming, and RTSP/RTP. Accept the defaults for other settings.


      4. Click Save.

        The following alert will appear after each configuration change. Wait until all changes are complete before you restart.


      5. Configure outgoing (playback) authentication:

        1. In the contents pane, click Outgoing Security.

        2. Click Edit.


        3. Under Client restrictions, select No client restrictions.


        4. Click Save.

      6. Configure encoder publishing authentication:

        1. In the contents pane, click Incoming Security.

        2. Click Edit.



        3. Under RTMP Publishing, select Require password authentication.

        4. Under RTSP Publishing, select Require password authentication.

        5. Under Client Restrictions, select No client restrictions.
        6. Click Save.

      7. Restart the application.



    The application runs whenever Streaming Engine software is running.

    Configuration in XML

    This section provides the basic steps for setting up an application for live streaming and configuring Application.xml.
    Note: If you created your application as described in the previous section, skip this section. Earlier versions of the server software donít support the manager, so you must edit Application.xml in a text editor. If you make changes to Application.xml and youíre using the Streaming Engine software, any supported settings will be displayed in the manager the next time itís started.
    1. Create application folder [install-dir]/applications/live.

    2. Create configuration folder [install-dir]/conf/live and copy [install-dir]/conf/Application.xml to this new folder.

    3. Edit the newly copied Application.xml file and make the following changes (some of these settings may already be present):

      1. Set the Streams/StreamType property to:
        Code:
        <StreamType>live</StreamType>
      2. Set the HTTPStreamers property to:
        Code:
        <LiveStreamPacketizers>cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, 
             mpegdashstreamingpacketizer</LiveStreamPacketizers>
      3. Set the Streams/LiveStreamPacketizers property to:
        Code:
        <LiveStreamPacketizers>cupertinostreamingpacketizer, smoothstreamingpacketizer, 
           sanjosestreamingpacketizer, mpegdashstreamingpacketizer
           </LiveStreamPacketizers>
      4. Set the RTP/Authentication/PlayMethod property to:
        Code:
        <PlayMethod>none</PlayMethod>
        Note: If your camera doesn't support RTSP/RTP interleaved (RTP over TCP), then you must change the RTPTransportMode value from interleave to udp:
        Code:
        <MediaCaster>
             <RTP>
                  <RTSP>
                       <!-- udp, interleave -->
             		<RTPTransportMode>interleave</RTPTransportMode>
                  </RTSP>
             </RTP>
             <!-- Properties defined here will override any properties defined in conf/MediaCasters.xml for any MediaCasters loaded by this application -->
             <Properties>
             </Properties>
        </MediaCaster>
    4. Start the Streaming Engine software.


    Publishing the stream

    This section provides the basic steps for creating a .stream file to publish your live stream to the Streaming Engine software.

    Publishing the Stream in Wowza Streaming Engine manager


    1. Consult your MPEG-TS encoder documentation to configure an outgoing live stream.

    2. Create .stream file:

      1. In the contents pane, click Stream Files.

      2. Under Virtual Host Stream Files, click Add Stream File.



      3. In the Add Stream File dialog box, enter a name for the stream.

      4. Enter the URI of the stream.


      5. Click Add.

      6. In the contents pane, click Startup Streams.

      7. Under Virtual Host Startup Streams, click Add Startup Stream.



      8. In the Add to Startup Streams dialog, enter the name of the stream you created in step c. For Application Name, enter live. Select the Mediacaster Type and the Application Instance.



      9. In the contents pane, click Server Setup.

      10. Restart the server, using the Restart button.




    Publishing the stream in XML


    This section provides the basic steps for creating a .stream file to publish your live stream to the Streaming Engine software.
    Note: If you published a stream as described in the previous section, skip this section. Earlier versions of the server software donít support the Streaming Engine manager, so you must edit Application.xml in a text editor. If you make changes to Application.xml and youíre using the Streaming Engine software, any supported settings will be displayed in the manager the next time itís started.
    1. Use a text editor to create the file [install-dir]/content/camera.stream and set the contents of this file to the full RTSP/RTP URL of the camera. The file must have a .stream filename extension. For this tutorial, the file used is camera.stream.

      Note: SoleraTec has a reference of IP cameras and RTSP URLs.
    2. Using a text editor, edit the [install-dir]/conf/admin.password file and add a username and password that will be used to start and stop the publishing of the camera (below is an example of the file with the username myuser and password mypassword):
      Code:
      # Admin password file (format [username][space][password])
      # username password
      myuser mypassword
    3. Start the Streaming Engine software.

    4. Use Stream Manager to start the stream:

      1. Enter the following URL in a web browser:
        URL: http://[wowza-ip-address]:8086/streammanager

      2. In the Security dialog box, enter your admin username and password from above.

      3. In the Stream Manager webpage, click the [start-receiving-stream] link just below the live application folder.

      4. In the Start Receiving Stream dialog box, select the following MediaCaster Type option: rtp.

      5. In the Stream Name field, enter camera.stream.

      6. Click OK.


    Playback in Wowza Streaming Engine Manager

    1. In the Applications contents pane, click live.

    2. Click Test Players.



    3. Enter Server and Stream.

    4. Click Start.


    The players are also online at www.wowza.com/testplayers

    Example players

    You can also use the players installed at [install-dir]/examples/ to test your streaming applications.

    For more information see the following articles:



    Troubleshooting



    Check your IP camera source using VLC

    It's best to first make sure that your camera can send H.264, AAC, or MP3 content. You can do this by using the VideoLAN VLC player:

    1. Open the VLC player.

    2. Select menu item Media > Open Network Stream, enter your camera's RTSP URL, and then click Play.

    3. After the stream starts playing, select menu item Tools > Codec Information and make sure that one or two of the following
      codecs are listed:

      • H.264 or AVC1 or MPEG4 Part10

      • AAC

      • MP3
    Note: If your camera doesn't support the proper formats, then the stream must be transcoded before it's sent to the Streaming Engine software. See How to use VLC as a live stream encoder with Wowza Streaming Engine (MPEG-TS) for an example that uses VLC.
    RTSP/RTP

    RTSP/RTP streaming is used to stream to Android and BlackBerry mobile devices. Android mobile devices formerly supported Adobe Flash player, but Android no longer supports Flash. Newer Android devices now support Apple HLS. HLS works best on Android 4.0 devices and above.

    To stream to RTSP/RTP, be sure that UDP ports 0-65535 are open and properly mapped to the server that is running Wowza Streaming Engine software.
    Note: To configure Wowza Streaming Engine software properly for RTSP/RTP streaming, carefully follow the instructions provided in How to troubleshoot RTSP/RTP playback.

    Additional property configuration needed for some cameras

    When streaming out using RTSP/RTP, you can force the output to MPEG-TS, which is required by many set-top boxes. For more information, see How to generate and control MPEG-TS output for set-top boxes.

    Some IP cameras may fail when Wowza Streaming Engine software tries to periodically validate the RTSP/RTP connection. The camera will disconnect and then reconnect every 15-30 seconds. You can turn off RTSP/RTP validation by adding the following property to the MediaCaster/Properties container in [install-dir]/conf/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
        <Name>rtspValidationFrequency</Name>
        <Value>0</Value>
        <Type>Integer</Type>
    </Property>
    Some IP cameras send additional application tracks that Wowza Streaming Engine software can't understand. You can filter out these tracks by adding the following property to the MediaCaster/Properties container in [install-dir]/conf/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
        <Name>rtspFilterUnknownTracks</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>

    How to turn on/off audio and video tracks
    Note: Wowza Media Server software 3.0.5 or later is required.
    You can turn off audio or video tracks by adding the following properties to the MediaCaster/Properties container in [install-dir]/conf/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
    	<Name>rtspStreamAudioTrack</Name>
    	<Value>false</Value>
    	<Type>Boolean</Type>
    </Property>
    <Property>
    	<Name>rtspStreamVideoTrack</Name>
    	<Value>false</Value>
    	<Type>Boolean</Type>
    </Property>
    To turn on audio or video tracks, set the above property values to true.

    Missing Audio or Video

    If audio or video is missing from the IP camera, check the logs to see if either of the following warning log statements are present:

    Code:
    RTPSessionDescriptionDataProviderBasicRTSPWorker.b  uildSDPData: SDP data missing rtpmap entry for [audio] track. Try adding MediaCaster/Property rtspDefaultAudioRTPMap with track media information. 
    RTPSessionDescriptionDataProviderBasicRTSPWorker.b  uildSDPData: SDP data missing rtpmap entry for [video] track. Try adding MediaCaster/Property rtspDefaultVideoRTPMap with track media information.
    Add the following property to the MediaCaster/Properties in [install-dir]/conf/[application]/Application.xml with the proper media definition information. For example: for a G.711 mu-law audio track, the entry might look like this:

    Code:
       <Property> 
          <Name>rtspDefaultAudioRTPMap</Name> 
          <Value>PCMU/8000</Value> 
       </Property>
    How to add additional logging for RTSP debugging

    You can log extra debug information to the log file about the RTSP handshake between the Streaming Engine software and the IP camera (RTSP/RTP source) by adding the following property to the MediaCaster/Properties container in [install-dir]/conf/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
        <Name>debugRTSPSession</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>
    Common problems with .stream files

    Many text editors will append a .txt filename extension to the camera.stream filename. This will result in an error message similar to the following:

    SDP file missing: c:/program files/wowzamediasystems/wowzamediaserver[version]/content/camera.stream

    To fix this, go to the [install-dir]/content folder and remove the .txt filename extension from the file.

    Property to change AAC packetization method

    Wowza Streaming Engine software can output AAC audio by using the mpeg4-generic and mp4a-latm (3gpp) packetization methods. The default packetization method is mpeg4-generic. To switch to mp4a-latm (3gpp), add the following property to the RTP/Properties container in [install-dir]/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
        <Name>audioPacketizerAAC</Name>
        <Value>com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LAT  M</Value>
    </Property>
    Flash playback

    Some IP cameras send proprietary data (as part of the H.264 stream) that may cause playback problems (pauses or glitches during playback) in Flash. You can filter out these extensions by adding the following property to the Streams/Properties container in [install-dir]/conf/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
        <Name>nalUnitFilter</Name>
        <Value>13</Value>
        <Type>Integer</Type>
    </Property>
    Problematic SDP files

    Many IP cameras incorrectly publish the H.264 profile-level-id value in the Session Description Protocol (SDP) message. This can cause the video to be either blank or corrupted. You can configure Streaming Engine software to ignore the profile-level-id value in the SDP data and instead derive this value from the sprop-parameter-sets value by adding the following property to the RTP/Properties container in [install-dir]/conf/[application]/Application.xml (be sure to get the correct <Properties> container; there are several in the Application.xml file):
    Code:
    <Property>
        <Name>rtpIgnoreProfileLevelId</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>


    Updated: For Wowza Streaming Engine 4.0.0 on 02-11-2014
    Comments 140 Comments
    1. notreg -
      Why I can't use rtp-live application for other out then rtmp?
    1. rrlanham -
      StreamType "rtp-live" is for live rtsp/rtp streaming.

      Richard
    1. charlie -
      The other streaming protocols (smooth streaming and Apple HTTP Live streaming) require packetization that requires a stream to be constantly running. The auto-startup nature of rtp-live does not make this possible.

      Charlie
    1. notreg -
      What for forceInterleaved is true?
    1. charlie -
      It does not matter. forceInterleaved controls RTSP/RTP interleaving.

      Charlie
    1. wormszer -
      Does this preserve the original H264 encoding made by the RTP/RTSP source. Say an IP camera? And is just packaging it into a new container format?

      Thanks
    1. charlie -
      We do not touch the encoding. We simply repackage.

      Charlie
    1. AndrewT -
      how to start restreaming automatically, just after wowza started, w/o stream manager?
    1. rrlanham -
      Use /conf/StartUpStreams.xml

      http://www.wowzamedia.com/forums/con...tupStreams.xml)

      Richard
    1. studioweb -
      Hi,

      I was wondering if Wowza (and therefore the media server) is accepting incoming IP-camera feed when nobody is watching at that moment? So, can we expect 86400 seconds of data-streaming per camera each day?
    1. rrlanham -
      It is if you start streams with StreamManager or StartupStreams.xml.

      You can avoid that if you only have Flash RTMP clients, you can use StreamType "rtp-live", then you do not have to use StreamManager or StartUpStreams to start the stream. The first Flash RTMP client that plays the stream will start it and it will stop 60 seconds after the last one stops.

      Richard
    1. qdlzheng -
      Hey, Charlie or Richard:

      I have an IPCam that supports rtsp behind my home router. I wonder if Wowza supports a way to allow me push the stream from ipcam to wowza server (remotely in a datacenter). That way, I don't need to open the ports on my router.

      Thanks!
    1. rrlanham -
      You have to pull from IP camera. There is no way around that.

      Richard
    1. digitalfin -
      We're having a problem with an IP camera. The stream can be instantly viewed in both VLC and QuickTime but the Wowza player (using the example "live" application) doesn't show any video. No error comes up either. The xml file is set up exactly as per documentation. Any suggestions? We added the below RTP property too but no luck:

      <Name>rtpIgnoreProfileLevelId</Name>
      <Value>true</Value>
      <Type>Boolean</Type>
    1. rrlanham -
      Follow this guide:

      http://www.wowzamedia.com/forums/con...P-re-streaming)

      And remove that Property. It is possible that is useful, but not likely. Remove for now.

      Richard
    1. lisa_w -
      Added note with required parameters for playback with Microsoft Silverlight (Smooth Streaming). -Lisa
    1. Xantos -
      Using an Axis M1114-camera and testing the Wowza-software.

      The rtsp-stream works ok, so does the iPhone stream. The only thing i can't get to work is the rtmp stream i'm trying to use in the JWPlayer. The JWPlayer screens stays black after pressing the play-button. Only twice i got it to work but that seems an exception. Can someone tell me what could be wrong?

      I'm using the latest developer Wowza-software on a v-server. Because of low memory on this server is set the "setenv.sh" to JAVA_OPTS="-Xmx500M".

      Rick
    1. charlie -
      I would get it working first with our example player ([install-dir]/examples/LiveVideoStreaming/client).The JW Player instructions are here:

      http://www.wowzamedia.com/forums/con...h-Wowza-Server

      Charlie
    1. sysadminguy -
      Quote Originally Posted by digitalfin View Post
      We're having a problem with an IP camera. The stream can be instantly viewed in both VLC and QuickTime but the Wowza player (using the example "live" application) doesn't show any video. No error comes up either. The xml file is set up exactly as per documentation. Any suggestions? We added the below RTP property too but no luck:

      <Name>rtpIgnoreProfileLevelId</Name>
      <Value>true</Value>
      <Type>Boolean</Type>
      I'm having what sounds like the exact same problem. The stream appears to be running successfully but viewing it with the example player or flowplayer shows a blank stream and no errors both in player or in the logs. Using WowzaMediaServer version 2.2.4 build27452 on Ubuntu Linux server 10.04. The camera is a Cisco 4500 series video surveillance IP camera. Using rtsp H.264. I've followed the instructions in this guide (http://www.wowzamedia.com/forums/con...P-re-streaming) and configured it for "live" StreamType.

      Any help would be appreciated.

      --Kevin
    1. randall -
      Try playing it in VLC and checking that the codecs are supported by Wowza. Go to Tools->Codec Information.

      Some users have reported problems regarding proper keyframes. Let's try to figure this out.