Wowza Community

How to play a video on demand file

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

I have a vod file playing fine on android but not on iphone.

iphone link

http://[wowza-address]:1935/vod/mp4:BigBuckBunny_175.mp4/playlist.m3u8

iphone says file not found and wowza console:

INFO stream create BigBuckBunny_175.mp4 -
WARN server comment - HTTPStreamerAdapterCupertinoStreaming.getAppInstance: Stre
am not found [vod/mp4:BigBuckBunny_175.mp4/playlist.m3u8]: BigBuckBunny_175.mp4
INFO stream destroy BigBuckBunny_175.mp4 -
INFO cupertino disconnect 658029436 -
INFO application app-stop _definst_ vod/_definst_

ok edited Application.xml per your last post.

now i get a loading screen but no audio or video.

no error message this time.

console:

INFO cupertino connect 1145542375 -
INFO stream create BigBuckBunny_175.mp4 -
INFO server comment - MediaReaderH264Cupertino.handlePacket: Audio info[vod/_def
inst_/BigBuckBunny_175.mp4]: {AACFrame: size: 0, rate: 48000, channels: 2, sampl
es: 1024, errorBitsAbsent: true, profileObjectType: "LC"}
INFO server comment - MediaReaderH264Cupertino.handlePacket: Video info[vod/_def
inst_/BigBuckBunny_175.mp4]: {H264CodecConfigInfo: profile: "Baseline", level: 3
.0, frameSize: 212x120, crop: l:0 r:6 t:0 b:4}
INFO stream play BigBuckBunny_175.mp4 -
INFO stream stop BigBuckBunny_175.mp4 -
INFO stream destroy BigBuckBunny_175.mp4 -
INFO cupertino disconnect 1145542375 -
INFO application app-stop _definst_ vod/_definst_

Application.xml

<Root>
	<Application>
		<!-- Uncomment to set application level timeout values
		<ApplicationTimeout>60000</ApplicationTimeout>
		<PingTimeout>12000</PingTimeout>
		<ValidationFrequency>8000</ValidationFrequency>
		<MaximumPendingWriteBytes>0</MaximumPendingWriteBytes>
		<MaximumSetBufferTime>60000</MaximumSetBufferTime>
		<MaximumStorageDirDepth>25</MaximumStorageDirDepth>
		-->
		<Connections>
			<AutoAccept>true</AutoAccept>
			<AllowDomains></AllowDomains>
		</Connections>
		<!--
			StorageDir path variables
			
			${com.wowza.wms.AppHome} - Application home directory
			${com.wowza.wms.ConfigHome} - Configuration home directory
			${com.wowza.wms.context.VHost} - Virtual host name
			${com.wowza.wms.context.VHostConfigHome} - Virtual host config directory
			${com.wowza.wms.context.Application} - Application name
			${com.wowza.wms.context.ApplicationInstance} - Application instance name
			
		-->
		<Streams>
			<StreamType>default</StreamType>
			<StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
			<KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
			<!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater -->
			<LiveStreamPacketizers></LiveStreamPacketizers>			
			<!-- Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application -->
			<Properties>
			</Properties>
		</Streams>
		<!-- HTTPStreamers (separate with commas): cupertinostreaming, smoothstreaming -->
		<HTTPStreamers>cupertinostreaming,smoothstreaming</HTTPStreamers>			
		<SharedObjects>
			<StorageDir></StorageDir>
		</SharedObjects>
		<Client>
			<IdleFrequency>-1</IdleFrequency>
			<Access>
				<StreamReadAccess>*</StreamReadAccess>
				<StreamWriteAccess></StreamWriteAccess>
				<StreamAudioSampleAccess></StreamAudioSampleAccess>
				<StreamVideoSampleAccess></StreamVideoSampleAccess>
				<SharedObjectReadAccess>*</SharedObjectReadAccess>
				<SharedObjectWriteAccess>*</SharedObjectWriteAccess>
			</Access>
		</Client>
		<RTP>
			<!-- RTP/Authentication/[type]Methods defined in Authentication.xml. Default setup includes; none, basic, digest -->
			<Authentication>
				<PublishMethod>digest</PublishMethod>
				<PlayMethod>none</PlayMethod>
			</Authentication>
			<!-- RTP/AVSyncMethod. Valid values are: senderreport, systemclock, rtptimecode -->
			<AVSyncMethod>senderreport</AVSyncMethod>
			<MaxRTCPWaitTime>12000</MaxRTCPWaitTime>
			<!-- Properties defined here will override any properties defined in conf/RTP.xml for any depacketizers loaded by this application -->
			<Properties>
			</Properties>
		</RTP>
		<MediaCaster>
			<!-- Properties defined here will override any properties defined in conf/MediaCasters.xml for any MediaCasters loaded by this applications -->
			<Properties>
			<Property>
					<Name>forceInterleaved</Name>
					<Value>true</Value>
					<Type>Boolean</Type>
				</Property>
			</Properties>
		</MediaCaster>
		<MediaReader>
			<!-- Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this applications -->
			<Properties>
			</Properties>
		</MediaReader>
		<LiveStreamPacketizer>
			<!-- Properties defined here will override any properties defined in conf/LiveStreamPacketizers.xml for any LiveStreamPacketizers loaded by this applications -->
			<Properties>
			</Properties>
		</LiveStreamPacketizer>
		<HTTPStreamer>
			<!-- Properties defined here will override any properties defined in conf/HTTPStreamers.xml for any HTTPStreamer loaded by this applications -->
			<Properties>
			</Properties>
		</HTTPStreamer>
		<Repeater>
			<OriginURL></OriginURL>
			<QueryString><![CDATA[]]></QueryString>
		</Repeater> 
		<Modules>
			<Module>
				<Name>base</Name>
				<Description>Base</Description>
				<Class>com.wowza.wms.module.ModuleCore</Class>
			</Module>
			<Module>
				<Name>properties</Name>
				<Description>Properties</Description>
				<Class>com.wowza.wms.module.ModuleProperties</Class>
			</Module>
			<Module>
				<Name>logging</Name>
				<Description>Client Logging</Description>
				<Class>com.wowza.wms.module.ModuleClientLogging</Class>
			</Module>
			<Module>
				<Name>fastplay</Name>
				<Description>Fast Play</Description>
				<Class>com.wowza.wms.module.ModuleFastPlay</Class>
			</Module>
			<Module>
				<Name>flvplayback</Name>
				<Description>FLVPlayback</Description>
				<Class>com.wowza.wms.module.ModuleFLVPlayback</Class>
			</Module>
		</Modules>
		<!-- Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections -->
		<Properties>
		<Property>
	<Name>smoothStreamingMediaMajorVersion</Name>
	<Value>2</Value>
	<Type>Integer</Type>
</Property>
		</Properties>
	</Application>
</Root>

If anyone could point me to a potential cause of the problem, this would greatly be appreciated. I am finishing a contract where people can upload videos, they are converted to .f4v (h.264) using mencoder, and then streamed with Wowza (rtmp).

It works fine on a Flash browser, but I can’t seem to make it work with an iPhone. I don’t have an iPhone at home, so I can’t test, but I ran some tests with a person at the company, and even .m4v files we encoded using mencoder could not be streamed to the iPhone, but Extremists.m4v, which comes with Wowza, works fine.

My question is, what are the potential problems with a .f4v or .m4v that could make it unstreamable to an iPhone, but perfectly viewable on Flash? Could it have something to do with metadata information that would have to be moved at the beginning of the file using flvtool2? I had the impression Wowza would make me avoid such problems. The iPhone is a pain in the arse!

Thanks in advance.

Thanks Richard, I’ll look into mencoder, its h.264 codec and anything related to “baseline 3 profile”, whatever that is!

Thanks a lot! I appreciate.

I love Wowza, and just made another client purchase it, but I find the ‘marketing’ of this ‘one source plays everywhere’ a bit irrealistic, there are many “ifs” for it to become true. At the end of the day, you definitely want two sources for the same movie, one for portables, and one for PC browsers.

Hi,

I am trying to rtsp a .3gp file. But it doesn’t play on my VLC.

What’s the URL pattern for a .3gp file? I tried rtsp://server:1935/vod/3gpp:test.3gp and rtsp://server:1935/vod/mp4:test.3gp and they both failed. The sample /vod/mp4:Extremists.m4v does play and the local .3gp file plays too.

Thanks a lot!

Thanks a lot Richard!