Wowza Community

How to play a video on demand file

Use this HTML5 in Safari on Mac instead of direct link:

<html>
<head> 
  <title>Cupertino Streaming</title>
</head>
<body>
<video controls src="http://[wowza-address]:1935/vod/sample.mp4/playlist.m3u8">
</video>
</body>
</html>

Reguard problem with port 1935, check your access log for errors binding to port 1935 when starting. You might have another instance of Wowza already running, or you are running FMS or another application that is already using port 1935.

Does this work in Wowza example SimpleVideoStreaming Flash player?:

Server: rtmp://[wowza-address]:1935/vod

Stream: mp4:sample.mp4

Richard

Another iOS snag is MP3 audio. It has to be Stereo 44100Hz. At least in some versions of IPhone.

Richard

AAC is better. Sorry, I should have made that point. MP3 has to be Stereo 44100Hz, but AAC is better. So, that is not the problem you are having. Stick with AAC.’

Make sure it is h.264 Baseline 3 profile. Main Profile will work in IPad but not IPhone. So that could be the problem.

Richard

BigBuckBunny sample video (sample.mp4) that ships with Wowza works on IPhone.

Richard

Maybe port 1935 is blocked in server firewall or router. Do you see Wowza version and build number in a browser at this address:

http://152.15.100.193:1935

I can’t check because it is internal IP.

Is the IPhone connected to a wifi router that is on the same lan as the Wowza server?

Richard

Wowza can’t support this. Someone else may have some insight.

Richard

I don’t, just saying others might.

Richard

Gennady,

You nee one more step, add the wowzasessionid=1176379876 above to the playlist.m3u8 URL and open in a browser, then you will download another file that lists the segments, which you can download one of in a 3rd step.

As here:

https://www.wowza.com/docs/how-to-test-aes-encryption-for-apple-hls-streams

Richard

Some questions about multibitrate VOD Streaming :

1/ SMIL works great on iPhone. Is there a quick way to see stream switch in action ?

Am I supposed to see an explicit log dealing with stream chosen by WMS regarding client bandwidth ?

2/ I quickly tried SMIL using Flowplayer but it does not work. Don’t know if it can work out-of-the-box by giving SMIL filename as source.

Wowza logs : “MediaReaderFactory: getInstance: Missing definition for smil”. Any idea ?

3/ Same question than for iPhone: is there a quick way to test stream switching using Flash ?

I’ve tried this but I don’t see anything in Wowza logs about stream switching.

The player runs a file from SMIL then nothing else happens. What is this sample supposed to do ?

4/ In first post, you only mention changing bitrates. Could it work if I also change width/height ? Audio bitrates ?

In other words, do the different files only need to share same framerate and same keyframe frequency ?

Thank you …

Here’s my SMIL file :

<smil>
  <head>
  </head>
  <body>
    <switch>
      <video src="SANY0034_1.mp4" system-bitrate="2700000"/>
      <video src="SANY0034_2.mp4" system-bitrate="1200000"/>
      <video src="SANY0034_3.mp4" system-bitrate="700000"/>
    </switch>
  </body>
</smil>

Changes made to MP4 files are only related to resolution and audio/video bitrates (same framerate and 2 ref frames).

I’ve tried this SMIL file on iPhone using WiFi, 3G and Edge. Whatever I’m using, the first file (SANY0034_1.mp4) is always chosen.

It works with WiFi and 3G but using Edge, nothing plays. Regarding bitrate, quite normal I guess …

Am I missing sth ?

Thank you Richard.

My main objective is to make it work on iPhone/iPad. I used Flash only for testing purpose, as Flowplayer has a bwcheck plugin.

What kind of encoder do you use to be sure keyframe timecodes are aligned in all files ?

I’ve used Handbrake, starting by setting highest profile then change frame resolution, bitrates, etc …

What kind of encoder do you use to be sure keyframe timecodes are aligned in all files ?

Any idea ? How did you produce the files you use for your tests ?

Aaaargh … Even if I really know how to use it, I never think to this one first …

I tried Handrake and Sorenson Squeeze 6. For each, I used same settings. But it does not work. And ffmpeg creates files out of sync.

Do you have a tool to check if timecodes are aligned ? Elecard StreamEye ? Will investigate more on this …

If you could send me your 3 files which work, it would be great …

Ok. Actually, WMS always start to playback the stream in the first video tag, whatever the device connection speed. Correct ?

Then it slightly switches to lower/higher bitrate(s) if the device can’t/can handle current/next bitrate. I thought there was a bandwidth evaluation before any playback …

Here’s SMIL file:

When I load the play list file for instance http://stream-sluster.hostname.com/vod/smil:Testvideo.smil/playlist.m3u8

I get back something similar to the following m3u8 file:

#EXTM3U

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=800000

http://cluster-instance1.domain.com/vod/definst/mp4:800k.mp4/playlist.m3u8?wowzasessionid=51460069

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=320000

http://cluster-instance1.domain.com/vod/definst/mp4:320k.mp4/playlist.m3u8?wowzasessionid=51460069

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=160000

http://cluster-instance1.domain.com/vod/definst/mp4:160k.mp4/playlist.m3u8?wowzasessionid=51460069

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=64000

http://cluster-instance1.domain.com/vod/definst/mp4:64k.mp4/playlist.m3u8?wowzasessionid=51460069

The problem is that I need to set a fixed hostname for the playlist file so that it always loads through the load balancer at cluster-stream.domain.com Is this possible?

Video codecs have different ‘Profiles’ and ‘levels’ based on what they can do.

H.264 for example has Profiles of: Baseline, Main & High. Levels range from 1.0 and up.

The profile determins what ‘features’ are available to the codec. The level usually determines video size & bitrate limitations. iPhones and most hand-held devices are restricted to ‘baseline’ profile (which limits cpu intensive features so low-powered devices can handle it) and generally Level 3.0 (since any higher would generally be useless on a small phone screen). if you google “h.264 profiles” you should get a Wikipedia link that shows you what the difference is between them.

mencoder should have command line tags to specify profile & level. Just issue them in there and the iPhone’s should play nice.

–Chris

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.

        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()];
        }

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

Richard

Hi Richard,

How can I control those output message? for example, to guide user to turn on the plugin.

Patrick

Are any files other than .flv or .mp4 supported for VOD playback through Wowza? Specifically can Wowza serve a Transport Stream file through VOD? I have placed a test.ts file in my content folder, but it does not play back through the Flash Player where as Extremists.flv does.

Is this something that should work, or may work in the future? Do I need a special file extension?

The data in the file is exactly the same as a live TS that I would send from my Live Encoder, which will play back through Wowza beautifully… and of course it will play in VLC

thanks

-Pat