Re-streaming an RTSP stream through Wowza Pro (RTSP/RTP)

Step by step instructions for Re-streaming and RTSP stream through Wowza Pro.

  • Download and install Wowza Media Server from the Wowza Store

  • Create a new Wowza Pro application for streaming (may already exist if examples installed)

  • Create the folder [install-dir]/applications/rtplive

  • Create the folder [install-dir]/conf/rtplive

  • Copy the file [install-dir]/conf/Application.xml into this new folder [install-dir]/conf/rtplive

  • Edit the newly copied Application.xml and make the following changes:

  • Change Streams/StreamType to rtp-live

  • Add following properties to Streams/Properties container (there are several containers, be sure to add to correct container)

    <Property>
    	<Name>sortPackets</Name>
    	<Value>true</Value>
    	<Type>Boolean</Type>
    </Property>
    <Property>
    	<Name>sortBufferSize</Name>
    	<Value>500</Value>
    	<Type>Integer</Type>
    </Property>
    
    
  • Add following properties to MediaCaster/Properties container (there are several containers, be sure to add to correct container)

    <Property>
    	<Name>forceInterleaved</Name>
    	<Value>true</Value>
    	<Type>Boolean</Type>
    </Property>
    
    
  • (for iPhone/iPod touch/Silverlight playback): Set the LiveStreamPacketizers to cupertinostreamingpacketizer, smoothstreamingpacketizer:

    <LiveStreamPacketizers>cupertinostreamingpacketizer,smoothstreamingpacketizer</LiveStreamPacketizers>
    
    
  • (for RTSP/RTP playback): Set the RTP/Authentication/PlayMethod to none

    <PlayMethod>none</PlayMethod>
    
  • Smooth Streaming only: Add the following property to the application level container at the bottom of the Application.xml file (be sure to get the correct container - there are several in the Application.xml file)

    <Property>
    	<Name>smoothStreamingMediaMajorVersion</Name>
    	<Value>2</Value>
    	<Type>Integer</Type>
    </Property>
    
    
  • Smooth Streaming only: Using a text editor create the file [install-dir]/conf/clientaccesspolicy.xml with the following content (For more information see the article Network Security Access Restrictions in Silverlight):

    <?xml version="1.0" encoding="utf-8"?>
    <access-policy>
      <cross-domain-access>
        <policy>
          <allow-from http-request-headers="*">
            <domain uri="*"/>
          </allow-from>
          <grant-to>
            <resource path="/" include-subpaths="true"/>
          </grant-to>
        </policy>
      </cross-domain-access>
    </access-policy>
    
    
  • (for iPhone/iPod touch playback): In some cases it might be necessary to follow this guide to Force a non-compliant H.264 live stream to use Baseline level 3 profile

  • Startup the Wowza Pro server

    Playback:

  • To play using Adobe Flash player:

    Double-click [install-dir]/examples/LiveVideoStreaming/client/live.html, enter the information below and click the Play button.

    [b]Server[/b] to [b]rtmp://[server-ip-address]/rtplive[/b]
    [b]Stream[/b] to [b][noparse]rtsp://[encoder-ip-address][/noparse][/b] (Example: [noparse]rtsp://192.168.1.8:554[/noparse])
    
    
  • For IPhone, IPod Touch, IPad, Silverlight and RTSP/RTP players and devices follow these steps first:

  • Use the built-in alias method: Add a text file to the applications’s content folder with a .stream extension, “myRTSPStream.stream”, make its contents the RTSP url. Or, you can use the StreamName Alias package to create an alias. The following steps will assume you are using a .stream file in the content folder named “myRTSPStream.stream”

  • Optionally Change the Application.xml StreamType from “rtp-live” to “live”. (This allows you to be in full control of the stream using the StreamManager in the next step. Otherwise, Flash players that play the stream will start it.)

  • Start the stream in the StreamManager.

  • Open http://[wowza-address]:8086/streammanager (You have to add a username and password to the /conf/admin.password file for access to the StreamManager).

  • Click “Start Receiving Streaming” under the “rtplive” application.

  • Select MediaCaster type “rtp” (default) or “rtp-record” (if you also want to record the stream on the server).

  • Enter “myRTSPStream.stream” in the Stream Name box

  • Click OK

  • To play using iPhone or iPod touch:

    Enter the following URL into the Safari web browser:

    http://[wowza-address]:1935/live/myRTSPStream.stream/playlist.m3u8
    
    
  • To play using Microsoft Silverlight:

  • Download the Smooth Streaming player from here: IIS_Smooth_Streaming_Player_Development_Kit_1.0_Beta_2.exe

  • Double click IIS_Smooth_Streaming_Player_Development_Kit_1.0_Beta_2.exe to extract the player

  • Edit Default.html and change the mediaSource property (line 85) to:

    http://[wowza-address]:1935/live/myRTSPStream.stream/Manifest
    
    
  • Double click Default.html and the video will begin to play.

  • To play using RTSP/RTP player or device:

    Enter the following URL into the RTSP/RTP player:

    rtsp://[wowza-address]:1935/live/myRTSPStream.stream
    
    

    Note: Some cameras do not support RTSP/RTP interleaving (sending the RTP packet data over the RTSP TCP connection) If this is the case then set the forceInterleaved property above to false, restart Wowza Media Server and try to play the stream.

    Note: Some cameras do not send RTCP packets. If you see the warning log message:

    Waiting for RTCP packet. See docs for (Application.xml: RTP/AVSyncMethod and RTP/MaxRTCPWaitTime).

    Edit [install-dir]/rtplive/Application.xml and change the RTP/AVSyncMethod to systemclock.

    Note: If you are re-streaming an H.264 stream from an Axis Communications camera such as the following models (which natively support H.264): M1011(-W), M1031-W, P3301(-V), Q1755, Q6032 the RTSP url take the form:

    rtsp://[camera-ip-address]:554/axis-media/media.amp

    where [camera-ip-address] is the ip adress of the Axis camera.

    You can add a username and password to the RTSP url like this:

    rtsp://username:password@[camera-ip-address]:554/axis-media/media.amp

    Where username and password are the credentials that you have set in the camera’s web interface.

    Note: By default Wowza Pro streams using UDP on ports 6970 - 9999 and TCP port 554. This can be a problem if you are streaming to a Wowza Pro server or Oscar that is behind a firewall on which these ports are blocked. To resolve this issue, you need to open up the UDP port range 6970 - 9999 and TCP port 554 on any firewalls between the Oscar encoder and Wowza Pro. You may also need to adjust the [oscar-ip-address] if the Oscar is behind a router that has provided a NAT address for the device.

    Note: Many players will not accept stream names that look like urls. You can use the built-in alias method (as mentioned above in the Playback section): Add a text file to the applications’s content folder with a .stream extension, make its contents the rtsp url, the reference the stream by the file name, e.g., “myIPCam.stream” Or, you can use the stream name alias package to create an alias for the stream name url. This package can also be used to secure Wowza Pro so that it will only be able to restream urls that you specify. This package can be downloaded from here: StreamNameAlias.

    Note: There is an issue when re-streaming an RTSP/RTP stream that is hosted by Quicktime Streaming Server (Darwin, QTSS) that after 2 minutes of streaming the stream will be dropped by QTSS. This is caused by the fact that Wowza Pro does not send RTCP Receiver Report packets back to QTSS. This causes QTSS to timeout and disconnect the stream based on the rtp_timeout value defined in streamingserver.xml. The current workaround for this issue is to set the rtp_timeout property in QTSS to 0 (zero) which will disable this timeout feature. We are investigating supporting RTCP RR packets in a future release of Wowza Pro.

    Note: If you experience problems getting either the audio or video to play through Flash, double check the version number of the Flash player (Flash player version 9.0.115.0 or above is required). If you still have problems, turn on Wowza Pro debug logging (edit [install-dir]/conf/log4j.properties and change the log4j.rootCategory on the first line from INFO to DEBUG), try the encoder several more times, zip up and send your [install-dir]/logs folder along with screen shots of the encoder setup screens and the LiveVideoStreaming player screen and send a detailed description of your problem to support@wowza.com.

    See this post for troubleshooting tips:

    Troubleshooting live streaming issues

    Charlie

How to play in RTSP/RTP player?

or

What is RTSP/RTP player?

Where to paste that rtsp://address/live/stream url

Try VLC

http://www.videolan.org/vlc/

But for general streaming to the desktop, Flash RTMP or Silverlight smooth client is recommended. RTSP is usually for mobile devices and some STBs.

Richard

In the VLC menu: Media > Open Network Stream. Then enter the RTSP url

Richard

Change the /conf/live/Application.xml /StreamType to “live”, then start the stream in StreamManager. Take a look at this guide:

https://www.wowza.com/docs/how-to-re-stream-video-from-an-ip-camera-rtsp-rtp-re-streaming

Richard

Sander,

Yes, take a look at IRTSPActionNotify:

https://www.wowza.com/docs/how-to-use-the-irtspactionnotify-interface-to-listen-for-rtsp-stream-events

Richard

Sorry, that was the link I thought I was sharing, glad you found it

Richard

I have a working application that restreams an RTSP stream from an AXIS IP Camera. I set the StreamType to rtp-live so that Wowza automatically starts the stream when the first client requests it. Now what I need is some error handling. When the IP camera is not connected (or inaccessible), the Wowza logs show the following errors:

MediaCasterConnection.connect: Failed to connect[cam-ip:cam-port]: org.apache.mina.common.RuntimeIOException: Failed to get the session[ConnectException: null]

RTPSessionDescriptionDataProviderBasic.getStreamInfo: RTSP/RTP re-streaming. Cannot connect to server: rtsp://:@/axis-media/media.amp?videocodec=h264&streamprofile=low

Is there a way to register a handler to catch one of these 2 events?

Sander.

Richard, thank you for your quick reply. I was unable to get this working with the guide you linked. onRTPSessionCreate just never gets called. I tried to add implements-clauses to my class, but I could not get it working. I’m not sure if it’s a problem with my Application.xml or whether I need to do something else.

I had more luck with this guide:

https://www.wowza.com/docs/imediacasternotify2-example

If I add a mediacasterlistener on app start, I can handle the problems in onConnectFailure. The stream name is found in mediaCaster.getMediaCasterId() so I can match it to the requested stream.

Sander.

King,

Most likely the stream has not yet been published to Wowza. Have you started the stream in the stream manager? If so, what do you see in the Wowza console/logs when you start the stream? And, what are the contents of the .stream file?

In the VLC menu: Media > Open Network Stream. Then enter the RTSP url

Richard

Hi

I Made the configurations as per the instructions, But when i try to play the link it is throwing error as “open of `rtsp://[wiwza - ip]:1935/live/myRTSPStream.stream’ failed”

please help.

Thanks in Advance

King,

Most likely the stream has not yet been published to Wowza. Have you started the stream in the stream manager? If so, what do you see in the Wowza console/logs when you start the stream? And, what are the contents of the .stream file?

Hi Randall,

The stream is published in the rtplive application, The stream is published automatically, i didn’t published it manually, in the .stream file rtsp link of the other server.(rtsp://[IP]:554/Channel.sdp)

Please suggest the configurations i need to change.

Thanks in Advance

I Got Errors as,

WARN server comment 2012-05-22 07:39:20 1511828828 192.168.60.212 - 0 0 76198.391 - - – - - - myRTSPStream.stream MediaReaderH264.open[2]: java.lang.Exception: QTUtils.parseQTMediaContainer: File is missing ‘moov’ atom.

WARN server comment 2012-05-22 07:46:29 - - - - - 76630.261 - - - - – - - MediaReaderFLV.open: Metadata appears to be bad: myRTSPStream.stream

WARN server comment 2012-05-22 07:46:54 1586826132 192.168.60.212 - 0 0 26.064 - - - – - - myRTSPStream.stream MediaReaderH264.open[2]: java.lang.Exception: QTUtils.parseQTMediaContainer: File is missing ‘moov’ atom.

WARN server comment 2012-05-22 07:47:06 1959361338 192.168.60.212 - 0 0 37.738 - - - – - - myRTSPStream.stream MediaReaderH264.open[2]: java.lang.Exception: QTUtils.parseQTMediaContainer: File is missing ‘moov’ atom.

WARN server comment 2012-05-22 07:47:16 1195137529 192.168.60.212 - 0 0 47.58 - - - – - - myRTSPStream.stream MediaReaderH264.open[2]: java.lang.Exception: QTUtils.parseQTMediaContainer: File is missing ‘moov’ atom.

Thanks Richard,

How to view output in vlc…

FMLE->wowza->vlc

I Want to play the stream in vlc

Help plz…