• How to set up video on demand streaming

    This tutorial provides basic steps for streaming video on demand (VOD) content through Wowza Media Server® to all supported player technologies.

    Contents



    Tutorial


    Troubleshooting


    Related Articles


    Tutorial



    Configuration


    This tutorial shows you how to set up an application for video on demand (VOD) streaming and how to configure Application.xml. This tutorial use the sample video file [install-dir]/content/sample.mp4.

    Note: A pre-configured application named vod is included in installations of Wowza Media Server 3 and later.

    1. Create application folder [install-dir]/applications/vod.

    2. Create configuration folder [install-dir]/conf/vod 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):

      Note: Right-click HERE to download a pre-configured version of Application.xml.

      1. Set the Streams/StreamType property to:
        Code:
        <StreamType>default</StreamType>
      2. Set the HTTPStreamers property to:
        Code:
        <HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>
      3. Set the RTP/Authentication/PlayMethod to:
        Code:
        <PlayMethod>none</PlayMethod>

    4. Start Wowza Media Server.


    Playback


    Note: In the following examples, [wowza-ip-address] is the IP address or domain name of the server running Wowza Media Server.

    Note: To play your own content, copy it into the [install-dir]/content folder and substitute its filename in place of sample.mp4 in the sample URLs in this section.

    Adobe Flash Player (RTMP)


    In Wowza Media Server 3.5, double-click [install-dir]/examples/VideoOnDemandStreaming/FlashRTMPPlayer/player.html, enter the information below, and then click the Connect button.

    Server: rtmp://[wowza-ip-address]/vod
    Stream: mp4:sample.mp4

    To play the stream from a remote computer, copy the FlashRTMPPlayer folder to a web server, and then connect to: http://<webserver>/FlashRTMPPlayer/player.html.

    Note: In Wowza Media Server 3.1.2 and earlier, double-click [install-dir]/examples/SimpleVideoStreaming/client/simplevideostreaming.html, enter the information below, and then click the Play button.

    Server: rtmp://[wowza-ip-address]/vod
    Stream: mp4:sample.mp4

    To play the stream from a remote computer, copy the client folder to a web server, and then connect to: http://<webserver>/client/simplevideostreaming.html.

    Adobe Flash Player (San Jose/Adobe HDS)


    In Wowza Media Server 3.5, double-click [install-dir]/examples/VideoOnDemandStreaming/FlashHTTPPlayer/player.html, enter the information below, and then click the Connect button.

    Stream: http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/manifest.f4m

    To play the stream from a remote computer, copy the FlashHTTPPlayer folder to a web server, and then connect to: http://<webserver>/FlashHTTPPlayer/player.html.

    Note: In Wowza Media Server 3.1.2 and earlier, double-click [install-dir]/examples/SimpleVideoStreaming/clientOSMF/bin-release/SimpleOSMFPlayer.html, enter the information below, and then click the Play button.

    Stream: http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/manifest.f4m

    To play the stream from a remote computer, copy the clientOSMF/bin-release folder to a web server, and then connect to: http://<webserver>/bin-release/SimpleOSMFPlayer.html.

    Note: The stream can only be played from an OSMF-based Flash player that's embedded in a webpage.

    Apple iOS device (Cupertino/Apple HLS)


    Enter the following URL into the Safari® web browser on the device:

    URL: http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/playlist.m3u8

    Note: The Apple® iPhone® 3GS (and older) and iPod touch® devices require that video be encoded using H.264 format (Baseline profile level 3 or lower) and AAC or MP3 stereo audio.

    Note: This stream can also be played using the Safari web browser or QuickTime 10.x on a computer running Mac OS® X Snow Leopard version 10.6 or later.

    Microsoft Silverlight (Smooth Streaming)


    In Wowza Media Server 3.5, double-click [install-dir]/examples/VideoOnDemandStreaming/SilverlightPlayer/player.html, enter the information below, and then click the Connect button.

    Stream: http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/Manifest

    To play the stream from a remote computer, copy the SilverlightPlayer folder to a web server, and then connect to: http://<webserver>/SilverlightPlayer/player.html.

    Note: In Wowza Media Server 3.1.2 and earlier, double-click [install-dir]/examples/SimpleVideoStreaming/clientSilverlight/Default.html, enter the information below, and then click the Play button.

    Stream: http://[wowza-ip-address]:1935/vod/mp4:sample.mp4/Manifest

    To play the stream from a remote computer, copy the clientSilverlight folder to a web server, and then connect to: http://<webserver>/clientSilverlight/Default.html.

    Note: The Microsoft® Silverlight® player requires that both audio and video be present for playback.

    RTSP/RTP player


    Enter the following URL into the RTSP/RTP player:

    URL: rtsp://[wowza-ip-address]:1935/vod/mp4:sample.mp4

    Playback of content outside of the content root


    To play content that's not in the content root folder ([install-dir]/content), you must add the default application instance name to the playback URL. For example, if the sample.mp4 video file is in [install-dir]/content/myvideos/sample.mp4, the URLs for the different streaming technologies are:

    Adobe Flash Player (RTMP)

    Server: rtmp://[wowza-ip-address]/vod
    Stream: mp4:myvideos/sample.mp4

    Single URL: rtmp://[wowza-ip-address]/vod/_definst_/mp4:myvideos/sample.mp4


    Adobe Flash Player (San Jose/Adobe HDS)

    Stream: http://[wowza-ip-address]:1935/vod/_definst_/mp4:myvideos/sample.mp4/manifest.f4m


    Apple iOS device (Cupertino/Apple HLS)

    URL: http://[wowza-ip-address]:1935/vod/_definst_/mp4:myvideos/sample.mp4/playlist.m3u8


    Microsoft Silverlight (Smooth Streaming)

    Stream: http://[wowza-ip-address]:1935/vod/_definst_/mp4:myvideos/sample.mp4/Manifest


    RTSP/RTP player

    URL: rtsp://[wowza-address]:1935/vod/_definst_/mp4:myvideos/sample.mp4

    Adaptive bitrate streaming


    Adaptive bitrate (ABR) streaming of video on demand content to Adobe® Flash® Player, Apple iOS devices, and Microsoft Silverlight requires that you have multiple files that are pre-encoded to the desired bitrates for streaming. For stream-switching to occur properly, the key frames of each of the files must be aligned. This must be done at encoding time and can be achieved by setting the key frame interval and frame rate values to be the same for each encoded file. After you have the files properly encoded, copy them to the [install-dir]/content folder and create a Synchronized Multimedia Integration Language (SMIL) file that links the files together for playback.

    For example, let's say that we have four files encoded at different bitrates:

    • bigbuckbunny_450.mp4 (450kbps total bitrate)
    • bigbuckbunny_750.mp4 (750kbps total bitrate)
    • bigbuckbunny_1100.mp4 (1100kbps total bitrate)
    • bigbuckbunny_1500.mp4 (1500kbps total bitrate)

    Using a text editor, create a SMIL file named bigbuckbunny.smil in the [install-dir]/content folder with the following content:
    Code:
    <smil>
        <head>
        </head>
        <body>
            <switch>
                <video src="mp4:bigbuckbunny_450.mp4" system-bitrate="450000"/>
                <video src="mp4:bigbuckbunny_750.mp4" system-bitrate="750000"/>
                <video src="mp4:bigbuckbunny_1100.mp4" system-bitrate="1100000"/>
                <video src="mp4:bigbuckbunny_1500.mp4" system-bitrate="1500000"/>
            </switch>
        </body>
    </smil>
    You can see that there's a <video> entry in the <switch> container for each file rendition. The system-bitrate value is set to the total bitrate (in bits-per-second) for that file (both audio and video).

    Microsoft Smooth Streaming will only switch between the video portion of the files. The audio track in the first file listed in the <switch> container will be used. If you want to use a file other then the first file for the audio track, add a <audio> entry to the <switch> container for that item. For example:
    Code:
    <smil>
        <head>
        </head>
        <body>
            <switch>
                <video src="mp4:bigbuckbunny_450.mp4" system-bitrate="450000"/>
                <video src="mp4:bigbuckbunny_750.mp4" system-bitrate="750000"/>
                <video src="mp4:bigbuckbunny_1100.mp4" system-bitrate="1100000"/>
                <video src="mp4:bigbuckbunny_1500.mp4" system-bitrate="1500000"/>
                <audio src="mp4:bigbuckbunny_1500.mp4" system-bitrate="128000"/>
            </switch>
        </body>
    </smil>
    Note: The <audio> item will be ignored when streaming using Adobe HDS (San Jose) or Apple HLS (Cupertino) streaming.

    Note: JW Player™ and Flowplayer use a client-side XML file to reference each file rendition, not the server-side SMIL file that's shown in this tutorial. They both also use the BWCheck module.

    You can download the SMIL file and the videos that are referenced in this section from the links below:



    These sample multi-bitrate files were encoded with Microsoft Expression Encoder 4 and are properly encoded with key frames aligned.

    Adobe Flash Player (San Jose/Adobe HDS)


    In Wowza Media Server 3.5, double-click [install-dir]/examples/VideoOnDemandStreaming/FlashHTTPPlayer/player.html, enter the information below, and then click the Connect button.

    Stream: http://[wowza-ip-address]:1935/vod/smil:bigbuckbunny.smil/manifest.f4m

    Note: In Wowza Media Server 3.1.2 and earlier, double-click [install-dir]/examples/SimpleVideoStreaming/clientOSMF/bin-release/SimpleOSMFPlayer.html, enter the information below, and then click the Play button.

    Stream: http://[wowza-ip-address]:1935/vod/smil:bigbuckbunny.smil/manifest.f4m

    Apple iOS device (Cupertino/Apple HLS)


    Enter the following URL into the Safari web browser on the device:

    URL: http://[wowza-ip-address]:1935/vod/smil:bigbuckbunny.smil/playlist.m3u8

    Microsoft Silverlight (Smooth Streaming)


    In Wowza Media Server 3.5, double-click [install-dir]/examples/VideoOnDemandStreaming/SilverlightPlayer/player.html, enter the information below, and then click the Connect button.

    Stream: http://[wowza-ip-address]:1935/vod/smil:bigbuckbunny.smil/Manifest

    Note: In Wowza Media Server 3.1.2, double-click [install-dir]/examples/SimpleVideoStreaming/clientSilverlight/Default.html, enter the information below, and then click the Play button.

    Stream: http://[wowza-ip-address]:1935/vod/smil:bigbuckbunny.smil/Manifest

    By default Microsoft Smooth Streaming will calculate video and audio bitrates for the manifest data on-the-fly by inspecting the file. If you want to configure Wowza Media Server to use the bitrates in the SMIL file, add the following property to the HTTPStreamer/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>smoothStreamingUseSMILBitrates</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>
    When running in this mode, Wowza Media Server will assume the video and audio system-bitrate values are for the video and audio data only.

    Adobe Flash Player (RTMP)


    Dynamic streaming for Adobe Flash requires a fair amount of work on the client-side. The following articles provide details about how to achieve dynamic streaming in Flash:

    Dynamic streaming in Flash (part 1)
    Dynamic streaming in Flash (part 2)
    Dynamic streaming in Flash (part 3)

    When streaming using Adobe HTTP Dynamic Streaming (Adobe HDS) with Wowza Media Server, it's best to turn on dynamic stream markers, which will provide more accurate on-the-fly bitrate calculations (in most cases). To turn on dynamic stream markers, edit [install-dir]/conf/[application]/Application.xml and add the following property to the Streams/Properties container (be sure to get the correct Properties container - there are several in the Application.xml file):
    Code:
    <Property>
        <Name>enableDynamicStreamMarkers</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>
    Note: Dynamic stream markers are turned on by default in Wowza Media Server 2.2.0 and later.

    Troubleshooting



    RTSP/RTP


    • RTSP/RTP streaming is used to stream to Android™ and BlackBerry® mobile devices. Newer Android-based phones also support Flash player 10.1 or later along with RTMP and Adobe HTTP Dynamic Streaming (Adobe HDS).

    • To stream to RTSP/RTP, be sure that UDP ports 0-65535 are open and properly mapped to the server running Wowza Media Server.

    • It's very important to carefully follow the instructions provided in How to troubleshoot RTSP/RTP playback to properly configure Wowza Media Server for RTSP/RTP streaming.


    Property to force output to MPEG-TS (set-top box)


    When streaming out using RTSP/RTP, you can force the output to MPEG-TS (which is required by many set-top boxes) by adding the following properties 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>forceMPEGTSOut</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>
    <Property>
        <Name>rtpWrapMPEGTS</Name>
        <Value>true</Value>
        <Type>Boolean</Type>
    </Property>

    Property to change AAC packetization method


    Wowza Media Server can output AAC audio 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.RTPPacketizerMPEG4LATM</Value>
    </Property>


    Updated: For Wowza Media Server 3.5.0 on 11-08-2012
    Comments 33 Comments
    1. lisa_w -
      Added note with required parameters for playback with Microsoft Silverlight (Smooth Streaming). -Lisa
    1. tkchen7 -
      I have followed the instruction below and be able to play the video using Safri on my iPad2. However, it does not work with my iPad application. I use the MPMoviePlayController and it does not work at all. However, my application does work with http://devimages.apple.com/iphone/sa...bipbopall.m3u8 provided by Apple. Do I miss something? I need to get this resolve so that I can be ready to purchase your product.
      Calvin
    1. rrlanham -
      Have you tried with HTML video tag as with IPhone?


      Code:
      <html>
      <head> 
        <title>Cupertino Streaming</title>
      </head>
      
      <body>
      <video controls src="http://[wowza-address]:1935/vod/sample.mp4/playlist.m3u8">
      </video>
      
      </body>
      </html>
      I don't know of any testing of MPMoviePlayController. I have not tried it.

      Richard
    1. tkchen7 -
      Richard,

      Thank for the quick response. It actually works with MPMoviewPlayController the objective-c class.

      I check the server console and find out it looks for a file, which does not exist. I rename the filename and now it works.

      It is great to know Wowza is what we are looking for

      Regards,
      Calvin
    1. rrlanham -
      Calvin,

      Great, glad it's working. Now we may refer to this thread re MPMoviewPlayController.

      Thanks for the update,
      Richard
    1. Seunghee Jin -
      To interact the Apple iOS devices, how we can get the audio-only stream from Video on Demand File?

      Regards,
      Seunghee
    1. rrlanham -
      Take a look at this article:

      http://www.wowza.com/forums/content....ppStore-64Kbps)

      Note: This requires AAC audio track for iOS 4 devices; Only iOS 5 devices support 64kbs MP3 audio, as required by AppStore. This technique will work with 128kbs MP3 in iOS 4, but that does meet the AppStore spec.

      Richard
    1. rmavro -
      Can we use the .smil for non-dynamic switching? That is, file1 is low rate, file 2 is high rate, and then expect the server to deliver the best choice without dynamic adaptive rate selection?
    1. rrlanham -
      The players that support this iOS, Silverlight, OSMF, handle the smil as adaptive. It is handled in these clients, not really configurable.

      Richard
    1. apakabartv -
      Hello,

      Our movie consists of several segments.
      Let's say the movie is called "my_movie", and it consists of 5 segment files:
      - segment_1.mp4, which is the beginning of the movie,
      - segment_2.mp4 which starts after segment 1 is finished,
      - segment_3.mp4 which starts after segment 2 is finished,
      - and so on...

      Is there a way to configure Wowza, so that from the viewer's perspective, there is only 1 movie: my_movie.
      i.e. the viewer only needs to click the VOD link once. The player will play segment_1, 2, 3.... and so on.
      And also, if the viewer slides the progress bar, it will play the segment accordingly.
      i.e. if the progress bar is moved to the near the end of the movie, then the player will play the segment file that corresponds to the end of the movie.

      Regards,
      William.
    1. lisa_w -
      William,
      Take a look at this example of creating a vod server-side playlist, http://www.wowza.com/forums/content....insert-Midroll

      -Lisa
    1. rsilva -
      Hello, I normally install the Wowza conseguin with a license for testing, I actually adhere to the software, I run ppretendo some videos of great length, I managed to run through the RTMP protocol with ease using JWplayer but what interests me is the make the videos work over HTTP protocol, ie, there is the loading of the video by pausing the player using it JWplayer. Can anyone help me on how to run the videos with the HTTP protocol JWplayer?
    1. rrlanham -
      Take a look at last example in this article:

      http://www.wowza.com/forums/content....a-Media-Server

      Richard
    1. leduy87vnhn -
      I am starting to build a IPTV system. Now I have problem with the client - how to create a flash client to play the video streamed by server?, could you please share source code of simplevideostreaming.swf ? I need to create a new one which supports to choose the video by clicking on some buttons instead of input a stream address (in simplevideostreaming.swf) but my problem is I don't know how to catch the video stream. I think I can find out the solution by reading source code of simplevideostreaming.swf.
      Thank you very much. Duy
    1. randall -
      Hi,

      The .fla file is there in all the examples, which you can open in Flash Builder.
    1. kumarranganath -
      Can any one give real time live URL where we can check how smil feature works and how videos will switch b/w based on the bit rate and finally for the low bandwidth it play audio - PLease give sample working with a SMIL URL for iphone/ipad with sample video
    1. Lee, Myung-Ho -
      Hello,
      Does wowza can VOD streamming mpeg ts files in local directory of wowza server? (not live stream from outside)
      The ts file contains h.264 video and aac audio stream.
      If it possible, please let me know the start point.(any tutorial URLs or docs)
      I want to make that each of clients want to be able to see(or FF, REW) the selected files.
      Regard,
      Myung-Ho.
    1. ianbeyer -
      .ts is not currently supported for VOD - in order to use that content, you'll need to put it in an MP4 container. Once you have done that, it should work great.
    1. leduy87vnhn -
      Can wowza server manage user priority? Such as user accounts, access control, limitations, user fees...
      I would like to implement those things in wowza server side instead of implement an independent head-end server.
      Thank you very much
      Duy
    1. randall -
      Hello Duy,

      This is something you would setup on your Web Server/CMS/Database, possibly in conjunction with a Wowza Addon. Some parts of what you are looking to do can be done on the Wowza side, such as access control. Take a look at the Media Security package: http://www.wowza.com/forums/content.php?115

      There is no concept of "users" in Wowza, so this is something you'll need to implement.