Using JW Player 5.x with Wowza Server

Hi Richard,

Thank you posting this tutorial.

Unfortunately, it just doesn’t seem to work for me.

I am repeating your exact steps and the player is appearing but the loading icon just spins indefinitely while no video loads.

i’ll post my code:

	<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="400" height="315">
			<param name="movie" value="player.swf" />
			<param name="allowfullscreen" value="true" />
			<param name="allowscriptaccess" value="always" />
			<param name="Flashvars" value="bufferlength=2&streamer=rtmp://{server-ip}/simplevideostreaming&file=mp4:Extremists.m4v" />
			<embed
				type="application/x-shockwave-flash"
				id="player2"
				name="player2"
				src="player.swf" 
				width="400" 
				height="315"
				allowscriptaccess="always" 
				allowfullscreen="true"
				Flashvars="bufferlength=2&streamer=rtmp://{server-ip}/simplevideostreaming&file=mp4:Extremists.m4v" 
			/>
		</object>
		

{server-ip} is the ip of the built-in Apache server on my Mac.

Looks just like yours as far as i can tell.

I imagine then that the problem has to do with the relative location of the JW player files / Wowza Files. Can you tell me how this should be set up or what the problem might be.

Further down the road i’m aiming to stream a playlist from the wowza server to the JW player. Can you recommend a playlist format and give me a clue as to how I should include it and the flahsvars of each track?

Any help is much appreciated.

Thanks

Hey Richard,

thanks for the fast reply!

Alas, neither of your suggestions worked. I still see endless loading.

Any other ideas? I can’t be the only one. Unless it has to do with my Mac server or the way i have placed my files.

I’m sure it’s a glaring error that i’m overlooking in frustration.

Do i need to create an applicaton called simplevideostreaming in the applications folder? because it’s only in examples for me. I thought that would suffice.

Would it work with a fresh differently-named application or is simplevideostreaming pre-configured in some way to work?

thanks again

tried moving SimpleVideoStreaming from examples to applications folder. No go.

This is very frustrating.

What else could be the problem?

I finally got it to work. I just messed with it for a while and it worked. Wish i could say what did it.

Thanks a lot anyway Richard. Best regards.

quick question Richard:

It seems that xspf playlists require URIs to locate files.

I initially tried a relative path because that was what worked with a single file in the flashvars:

file=tracks/sunroof.mp3

so i tried

tracks/sunroof.mp3

No luck.

So i want to use a URI. However since wowza is installed on my local server, i’m not sure what the path is. It doesn’t seem to be working when i try http://localhost/wowzamediaserver/content/tracks/sunroof.mp3

or http://localhost/~martinhendleman/wowzamediaserver/content/tracks/sunroof.mp3 (since it’s a mac)

do you have any idea what the URI would be?

thanks a million

hey thanks for the quick reply.

I copied your code, added my file in the place of somevideo.mp4 and saved it as playlist.xml

i then added it to the embed:

<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="400" height="315">
			<param name="movie" value="player.swf" />
			<param name="allowfullscreen" value="true" />
			<param name="allowscriptaccess" value="always" />
			<param name="Flashvars" value="bufferlength=2&streamer=rtmp://localhost/vod&file=playlist.xml&playlist=bottom"/>
			<embed
				type="application/x-shockwave-flash"
				id="player2"
				name="player2"
				src="player.swf" 
				width="400" 
				height="315"
				allowscriptaccess="always" 
				allowfullscreen="true"
			        Flashvars="bufferlength=2&streamer=rtmp://localhost/vod&file=playlist.xml&playlist=bottom" 
			/>
		</object>

I don’t understand what happened at that point because the player didn’t load and all i saw was a black screen the size of the player with a no-play sign in the middle. I tried adding provider=rtmp to the embed flashvars… didn’t work, then i tried adding jwplayer:providerrtmp</jwplayer:provider> to the playlist, didn’t work either.

Reverting to my xspf i got the player to reappear, unfortunately the files won’t load. However, when i write gibberish.xspf it tells me the stream is not found. When i write gibberish.xml it gives me black screen and no-play sign.

Does that mean there’s a problem with the xml file extension?

how could that be?

thanks but I already had namespace in the header as per your code, and the player size is not so much the issue as the fact that it is not loading. I know that it recognizes the playlist though because when i type a gibberish name it tells me that it cannot find it.

therefore i assume the problem is in the playlist markup. Still don’t understand why it has a problem with .xml file extension though.

i don’t understand why it’s so difficult:

  • include playlist file instead of media file in flashvar

  • add provider=rtmp

  • add playlist=bottom / size

  • then markup playlist xml as usual with streamer and and url info

what am i missing?

thanks again

I posted something at longtailvideo about an hour ago, still no response. Will let you know for sure when i figure this out. Thanks

Alright so i spent a few days chatting with Ethan over at long tail video, and we finally agreed on the player and playlist code.

However, despite agreeing that the code was correct, my player still doesn’t work.

That’s why i’m convinced that it’s a filepath problem.

hopefully we can get to the bottom of this:

I have a wowza folder installed at the root of the apache server on my Mac. It is a shortcut folder because the Wowza folder actually lives at Library/wowzamediaserver (this is strange because when i go into my library folder i don’t see this wowza folder anywhere). Anyway, my playlist lives in the WowzaMediaServer/content folder and it points to mp3s that live in

WowzaMediaServer/content/tracks

like this:

  <location>tracks/Partners.mp3</location>  

Note that when, in my browser, i try to go to http://localhost/wowzamediaserver/content/playlist.xspf i don’t have permission to access the directory…

So i’m certain that my problem is in the configuration of these folders and files.

Can anyone see a big mistake in the way i’ve set this up?

Thanks Richard.

I moved the playlist out of wowza content and into the root of the web server.

Didn’t solve the problem but i think we’re getting somewhere.

My question is: now that the playlist file is there, how should it link to the files?

If they are in WowzaMediaServer/content/tracks/…

should it just be tracks/example.mp3

or wowzamediaserver/content/tracks/example.mp3

or the complete path?

thanks again

thanks richard i finally got it working!

best

Anyone got dynamic bitrate switching to work with 5.1 and Wowza?

I’m using the following code but it’s not working.

<script type='text/javascript'>
  var so = new SWFObject('player-licensed.swf','mpl','470','290','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','anderenaam.smil');
  so.addVariable('provider','rtmp');
  so.addVariable('rtmp.loadbalance', 'true');
  so.write('mediaspace');
</script>

in combination with the following SMIL

<?xml version="1.0" encoding="UTF-8"?>
<smil>
	<head>
	<meta base="rtmp://10.0.0.128:1935/vod/" />	
</head>
	<body>
	 <switch>
				<video src="Extremists_700.flv"/>
</switch>				
	</body>
</smil>

giving me an java.io.FileNotFoundException: /usr/local/WowzaMediaServer/content (Is a directory)

ERROR server comment - ScheduledRandomAccessReader.bufferMiss[]: Request failed: 13:13 (also get 4092:4)

when i remove the from the SMIL the movie does play but no switching

Richard,

I saw that tutorial and tried it all day but it just doesn’t seem to work that’s why I decided to contact you because maybe you do have a working code example, or maybe you get more questions about this specific problem.

Also I found a page from a developer at jetstream where it also isn’t working.

http://dev1.jet-stream.nl/wowza2/VODPlayers.html

JW player home says it’s trivial to setup with Wowza, yet I’ve spent 2 days already trying to make it work :slight_smile:

Also the example on the tutorial page isn’t working either. When you click the RTMP streaming (dynamic) This time with a Wowza2 Server, it gives a Stream not found: blalbla.mp4

And it’s JW player 4.7 too

Got a reply from Longtail:

Hi Piet,

You are correct. SMIL does not work with Bitrate Switching.

Best Regards,

-Ethan

This is the XML file i’m using and got it to work.

<rss version="2.0"
	xmlns:media="http://search.yahoo.com/mrss/" 
	xmlns:jwplayer="http://developer.longtailvideo.com/trac/wiki/FlashFormats">
	<channel>
		<title>Playlist with bitrate switches</title>
	
		<item>
			
			
			<media:group>
				<media:content bitrate="700" width="1080" url="Extremists_700.flv" />
				<media:content bitrate="350" width="720" url="Extremists_350.flv" />
				<media:content bitrate="200" width="480" url="Extremists_200.flv" />
			</media:group>
			<jwplayer:type>rtmp</jwplayer:type>
			<jwplayer:streamer>rtmp://10.0.0.128/vod</jwplayer:streamer>
			
		</item>
	</channel>
</rss>

If i get it right continuous checking of the bandwidth only works with FMS at the moment? And with Wowza the checks are performed when seeking and resizing?

This is the XML file i’m using and got it to work.

If i get it right continuous checking of the bandwidth only works with FMS at the moment? And with Wowza the checks are performed when seeking and resizing?

Update:

Also fixed this. Was a problem with JW player. Using latest trunk version 5.2.919 and switching goes totally smooth now without having to click.

You can edit our player using Adobe Flash CS3/CS4.

Hey Charlie. Thanks for the idea. After failing to get JWPLayer to compile in ANYTHING (Flash CS4, Ant/Flex SDK, Flash Builder!!) I reverted to editing your nativertp.fla to fit my purposes.

Couple of issues:

  1. It looks like nativertp.fla is slightly scaling the video. It’s just a bit off causing nasty jaggy edges in the video. Fullscreen mode looks perfectly crisp and smooth.

  2. I am using some ghetto code to place an image over the blank video screen while the video buffers (approx 8 seconds). I tried using a timer to remove the picture overlay, but sometimes it buffers for 8 seconds, some times for 15, so there was no good way to time it. So, I put “OnMetaData then remove the overlay”, but sometimes it gets metadata before the stream is finished buffering, so that’s not that great of an option either.

Things I’ve done to your player:

  1. Set the video stage to exactly 640x480 with x/y of 0,0

  2. Fixed some code where it was trying to center the video on the screen or force some weird x/y co-ords.

  3. Hardcoded the server params

  4. Setup the autostart command.

The code:

var loader:Loader = new Loader();
loader.load(new URLRequest("http://my.webcam.info/camera.jpg"));
addChild(loader);

loads the jpeg video overlay, and this code removes it:

	nsPlayClientObj.onMetaData = function(infoObject:Object) 
	{
		trace("onMetaData");
				
		if(MetaDone == "nope"){
	removeChild(loader);
	MetaDone  = "yep";
}

I am hoping that there is a better thing then onMetaData, something like “onBufferComplete” or “onFirstFramePlay” or something. I looked, couldn’t find it :frowning:

My modified FLA file is at http://likestuff.globat.com/nativertp.fla

Examples:

VLC output feed capture (notice how clear the date/time stamp is, how smooth the double yellow lines are in the middle of the road, etc):

nativertp output (notice the right side of the M in Mar):

My main hope is that I can fix the slight video scaling problem. I thought it had to do with the approx 2pixel black border on the flash movie, but I tried enlarging the video scene by 2 pixels and 4 pixels and reducing by the same but the video still looked jaggy.

When I look at the output video stream in vlc player it looks very pretty.

Thanks!

-Jamie M.

Hi

I wonder how to configure the JW player to automatically start a live stream when I start to stream to the wowza server?

If setting the player to autostart and the stream is there, it will start playing with no problems. But if i stop the stream, and then restart it, i would like the player to automatically start the stream again. Is this possible? Not to have to click the play button again?

I have created a playlist, but maybe that is not what is supposed to be used?

also when i dont send a stream, it does present the image that i have, but if the stream isnt present when you first load the webpage, it types “stream not found: live.sdp” and i would prefer if it just showed the picture and not the “error”

im posting my config here (running on an EC2 account om amazon)

index.html file:

This text will be replaced

and playlist.xml:

<?xml version="1.0" encoding="UTF-8"?> Example XSPF playlist for the JW Player

http://developer.longtailvideo.com/trac

Live Stream

trav

Arvika

View the live stream

bild.jpg

live.sdp

rtmp://x.x.x.x:1935/live rtmp

I would be most grateful for any help here!

Best Regards

Perra

ok, thank you, i have also posted this question on the JW player forum now, maybe someone sees it there…

I thought this might be a common thing , but i guess it wasnt as easy as i would have thought …

I guess its possible as other services like ustream do start to play the stream when you feed it with something… but that might be up to the player…

thanks for the fast reply!

Best Regards

Perra