Wowza Media Systems home
Wowza Pro is the best alternative to Adobe Flash Media Server. Try it today.
Now Hiring. Join the Wowza team!

Go Back   Wowza Media Server Forums > Wowza Media Server 2 Forums > Tutorials

Reply
 
Thread Tools Display Modes
  #1  
Old 10-21-2009, 11:50 AM
charlie charlie is offline
Administrator
 
Join Date: Nov 2006
Posts: 9,242
Default How to play a video on demand file

Video On Demand Streaming

Below are the steps to set up an applcation named vod to stream video on demand content to the Adobe Flash player, the Microsoft Silverlight player and the Apple iPhone or iPod touch. For this tutorial we will use the Extremists.m4v sample video file that is located in the [install-dir]/content folder:
  1. Create application folder [install-dir]/applications/vod
  2. Create configuration folder [install-dir]/conf/vod and copy [install-dir]/conf/Application.xml into 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: default
    2. Set the HTTPStreamers property to: cupertinostreaming,smoothstreaming
    3. Set the RTP/Authentication/PlayMethod to: none
  4. Smooth Streaming only: Right click and download clientaccesspolicy.xml to the [install-dir]/conf folder (this file might already exist, if so, no need to update it). Once downloaded, you can test to be sure it is working properly by starting Wowza Media Server, opening a web browser and entering the url http://[wowza-ip-address]:1935/clientaccesspolicy.xml. It should return the following XML (if the web browser page is blank, you may need to select view source in the web browser to see the XML):
    Code:
    <?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>
  5. Start Wowza Media Server 2
  • To play using Adobe Flash player:

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

    Code:
    Server: rtmp://[wowza-address]/vod
    Stream: mp4:Extremists.m4v
  • To play using iPhone or iPod touch:

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

    Code:
    http://[wowza-address]:1935/vod/mp4:Extremists.m4v/playlist.m3u8
    Note: This stream can also be played using the Safari Browser or QuickTime 10.x on a computer running OSX version 10.6 or greater (Snow Leopard).
    Note: This requires video encoded with H.264 format, Baseline 3 profile, or lower, and AAC or MP3 audio

  • To play using Microsoft Silverlight:

    Double-click [install-dir]/examples/SimpleVideoStreaming/clientSilverlight/Default.html, enter the URL below and click the Play button.

    Code:
    http://[wowza-address]:1935/vod/mp4:Extremists.m4v/Manifest
    Note: If you have Wowza Media Server 2.1.1 or older installed, download and unzip the following package and follow the instructions in the README.txt file to install the latest Smooth Streaming example players: SmoothStreamingExamplePlayers.zip

  • To play using RTSP/RTP player or device (Wowza 2.1 or greater):

    Enter the following URL into the RTSP/RTP player:

    Code:
    rtsp://[wowza-address]:1935/vod/mp4:Extremists.m4v
    See Also:
    How to configure QuickTime player ...
    How to configure VLC player ...
    How to best setup an application for RTSP/RTP streaming

    Note: [wowza-address] is the IP address or domain name of the server running Wowza Server.

    Note: To play your own content, copy it into the [install-dir]/content folder and substitute it's file name for the Extremists.m4v file name above.

Multi-bitrate Video On Demand Streaming

Multi-bitrate video on demand streaming to Flash, the iPhone/iPod touch and Silverlight requires that you have multiple files 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 the same for each encoded file. Once 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 we have four files encoded at different four different bitrates bigbuckbunny_15000.mp4 (1500kbps total bitrate), bigbuckbunny_11000.mp4 (1100kbps total bitrate), bigbuckbunny_750.mp4 (750kbps total bitrate) and bigbuckbunny_450.mp4 (450kbps total bitrate). Using a text editor create a SMIL file in the [install-dir]/content folder with the name bigbuckbunny.smil 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 is a <video> entry in the <switch> container for each rendition of the file. The system-bitrate value is set to the total bitrate in bits-per-second for that file.
  • To play using iPhone or iPod touch:

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

    Code:
    http://[wowza-address]:1935/vod/smil:bigbuckbunny.smil/playlist.m3u8
  • To play using Microsoft Silverlight:

    Edit the same Default.html file referenced in the Silverlight section above and change the MediaSource URL (line 254) to:

    Code:
    http://[wowza-address]:1935/vod/smil:bigbuckbunny.smil/Manifest
    Next, open a web browser and enter the URL that loads the Default.html file and the video will begin to play.
  • To play using Adobe Flash player:

    Dynamic Streaming to the Flash player requires a fair amount of work on the client-side. These articles cover the details of 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)

    Also see JW Player Dynamic Streaming and Flowplayer Dynamic Streaming

    Note: JW Player and Flowplayer use a client-side xml file to reference each version not the server-side smil file shown in this tutorial. The both also use the BWCheck module.

    Note: When streaming using Flash dynamic streaming with Wowza Media Server, it is best to turn on dynamic stream markers. These markers in most cases will provide more accurate on the fly bitrate calculations. 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>



You can download the smil file and the videos referenced in this tutorial from these links:
http://www.wowzamedia.com/_h264/bigbuckbunny.smil
http://www.wowzamedia.com/_h264/bigbuckbunny_450.mp4
http://www.wowzamedia.com/_h264/bigbuckbunny_750.mp4
http://www.wowzamedia.com/_h264/bigbuckbunny_1100.mp4
http://www.wowzamedia.com/_h264/bigbuckbunny_1500.mp4

Here is an IPhone set also:
http://www.wowzamedia.com/_h264/bigbuckbunnyiphone.smil
http://www.wowzamedia.com/_h264/bigb...iphone_300.mp4
http://www.wowzamedia.com/_h264/bigb...iphone_400.mp4
http://www.wowzamedia.com/_h264/bigb...iphone_600.mp4

These sample mutiple-rate files where encoded with Microsoft Expression Encoder version 3 and are properly encoded with key frames aligned

Note: Silverlight Smooth Streaming will only switch between the video portion of the files. The audio track of 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 an <audio> entry to the <switch> container for that item (Note: the <audio> item will be ignored by the iPhone/iPod touch). 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="1500000"/>
		</switch>
	</body>
</smil>
Charlie

Last edited by charlie; 08-25-2010 at 04:06 AM.
Reply With Quote
  #2  
Old 12-28-2009, 05:26 AM
asrekik asrekik is offline
Junior Member
 
Join Date: Dec 2009
Posts: 1
Default

Hi,
I'd like to play a video on demand file, I read the appropriate tutorial and I run it using the Extremists.m4v file. but when i past my file "Fichier.mp4" to the folder "Content" and when I try to play the new file using the examples/SimpleVideoStreaming/client/simplevideostreaming.html sample,
I receive the error in the Wowza Media Server Console:
Code:
WARN server comment Fichier.mp4 MediaReaderH264.open[2]: java.lang.Exception: QT
Utils.parseQTMediaContainer: File is missing 'moov' atom.
Have you any idea to solve this problem.
thank you
Reply With Quote
  #3  
Old 12-28-2009, 06:02 AM
charlie charlie is offline
Administrator
 
Join Date: Nov 2006
Posts: 9,242
Default

It sounds like the file is not properly formatted. We can take a look at it. Send a copy to support@wowzamedia.com.

Charlie
Reply With Quote
  #4  
Old 01-10-2010, 02:12 PM
Alexey Alexey is offline
Junior Member
 
Join Date: Jun 2009
Posts: 16
Default

Hi Charlie,

Does described method of Multi-bitrate Video On Demand Streaming supported by latest Flowplayer (3.1.5)?

Here is a part of code from flowplayer.smil-3.1.3 plugin. It seems to be very primitive.

Code:
        private function parseSmil(smilFile:String):Array {
            log.debug("parsing SMIL file " + smilFile);
            var smil:XML = new XML(smilFile);
            return [smil.children()[0].children()[0].@base.toString(), smil.children()[1].children()[0].@src.toString()];
        }
Reply With Quote
  #5  
Old 01-11-2010, 05:39 AM
nandakumar nandakumar is offline
Junior Member
 
Join Date: Dec 2009
Posts: 21
Default

Hello,

I have tired the Multi-bitrate Video On Demand Streaming as per your instructions but it gives following error in log file


ERROR server comment 2010-01-11 06:36:55 - - - - - 1583442.288 - - - - - - - MediaReaderFactory: getInstance: Missing definition for smil


Please let me know the solution to fix this issue.
Reply With Quote
  #6  
Old 01-11-2010, 07:07 AM
rrlanham rrlanham is online now
Senior Member
 
Join Date: Dec 2007
Posts: 9,241
Default

Alexy,

For Flowplayer, you have to try it out, but I think the answer (at this moment) is no. But I am not sure. JW player 4.7 is supposed to work for multi-bitrate, and they are working on multi-bitrate for JW player 5.

Richard
Reply With Quote
  #7  
Old 01-11-2010, 07:46 AM
rrlanham rrlanham is online now
Senior Member
 
Join Date: Dec 2007
Posts: 9,241
Default

Nandakumar,

Please provide more details. You should be using Wowza Server 2. What player technology are you using? If Flash, which player system? Are you prepending "smil:" to stream name?

Richard
Reply With Quote
  #8  
Old 01-13-2010, 07:46 AM
hikalodner hikalodner is offline
Junior Member
 
Join Date: Jan 2010
Posts: 2
Default

The tutorial says:

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

Code:
http://[wowza-address]:1935/vod/mp4:.../playlist.m3u8
Note: This stream can also be played using the Safari Browser or QuickTime 10.x on a computer running OSX version 10.6 or greater (Snow Leopard).

This works very well on an iPod Touch and using the Get URL function in QuickTime Player. However in Safari it downloads the playlist part of the command as an iTunes file with the following content:

"#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=100000
http://161.77.180.51:1935/vod/mp4:Extremists.m4v/playlist.m3u8?wowzasessionid=1565372152"

It does not play the movie.

What can I do to make this work - I ultimately need to be able to place a command in an html document which will play the movie.

Thanks for your advice.
Reply With Quote
  #9  
Old 01-13-2010, 07:50 AM
rrlanham rrlanham is online now
Senior Member
 
Join Date: Dec 2007
Posts: 9,241
Default

On the IPhone, go to Settings > Safari > Plugins. It's probably "OFF". Switch it on and it should work.

Richard
Reply With Quote
  #10  
Old 01-13-2010, 08:37 AM
hikalodner hikalodner is offline
Junior Member
 
Join Date: Jan 2010
Posts: 2
Default Streaming to Safari on Desktop

I should have been clearer. When I described my experience with Safari, I should have said that I meant Safari on a desktop computer. The same result (that download of a file with an iTunes icon) occurs when I use FireFox or Chrome on either of the computers which I have used (Mac Pro and MacBook Pro). If I play the dowloaded file (titled playlist.m3u8) using QuickTime, it makes a brief buzzing sound and then plays the next file in my iTunes music directory. I have also tried this http:// command as suggested in the Tutorial on my wife's Windows computer. It does have iTunes installed and its behavior is the same as on my two Macintosh computers.

I am sorry that I was not clearer in my prior message. I hope this helps. By the way, my Macintosh computers are both running SnowLeopard and my wife's Windows machine is using WindowsXP.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:59 AM.


Copyright © 2006 - 2010, Wowza Media Systems
Wowza Media Systems