Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

JWP + Red5 + Live Video: Some guidance needed


I'm the systems administrator for ...I'm the systems administrator for a nonprofit media organization and we're looking to replace our current streaming video setup. After much research, it seems like JW Player might be the player we need. I have successfully assembled a prototype for H.264 on demand video with lighttpd and I am very happy with it. However, I'm having trouble finding the details I need to put together a prototype for streaming live video, which we also need to do.

To the best of my understanding, JW Player can read a live stream from Red5 via RTMP. But I'm having a hard time determining exactly how this is accomplished. I keep running into references to "applications" on the server side that I don't understand. Can anyone give me some pointers?

Thank you very much!

36 Community Answers

JW Player

User  
0 rated :

Here are a couple of pages that demonstrate how to use the JW Flv Player to capture your camera output and send it to a RTMP server (I use Red5) and then use the JW FLV Player to receive tht live stream.

One page is a single player that is selectable as camera or rtmp (player). See the example URIs at the top of the page source.

The other page has both the sending and receiving players on the same page.

Selectable:
*http://willswonders.myip.org:8083/php/Camera.html?type=camera
http://willswonders.myip.org:8083/php/Camera.html?type=rtmp*

Double player:
*http://willswonders.myip.org:8083/php/Camera_Player.html*

Look at the page source to see how it is setup.

JW Player

User  
0 rated :

Hi lefTy

The URLs you give are saying 404 - Not found.....

In case anyone else wants to see the camera function being used - visit my site at http://www.tovo.com and try the OnCamera feature.

any ideas?

Thanks in advance
Russell

JW Player

User  
0 rated :

Sorry, my mistake in the URIs. Drop the php.

*http://willswonders.myip.org:8083/Camera_Player.html
http://willswonders.myip.org:8083/Camera.html?type=camera
http://willswonders.myip.org:8083/Camera.html?type=rtmp*

In case any of those don't work, you can find the camera apps. on ports 8081, 8082, or 8084 on other servers.

JW Player

User  
0 rated :

Dear friends,

I am also doing my first tryouts with Red5, in a search for a inhouse alternative to a CDN.

If for live flv streaming the player embed code seems simple, I am not catching it for live video (such as a cam source). In one you have the flv name in the other you should have a stream name...

taking it out from the wizard here I get:

so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=bunny.flv&type=rtmp&streamer=rtmp://edge01.fms.dutchview.nl/botr');so.write('player');


streamer should be rtmp//myRed5IP/oflaDemo
file =?
where do I add the stream name ?


thanks for all the help.

KR,
Rodolfo

JW Player

User  
0 rated :

@RCC,

See the examples posted above.

The value of the *file* flashvar for the player code is the same as the value of the *file* flashvar that you used in the camera code. In those examples, it is *"JWstream"*.

JW Player

User  
0 rated :

hi brokenString, thank you for the quick reply.

witout sounding like a complete noob:
I can't open any of the links above, at least here @ work... So I can't check the camera code (at this point I suspect there is another RCC in this forums :-O)

Anyway:
I managed to make it work as you said, but:

I am using Flash Media Encoder to send the live feed to RED5 - therefore the streamname I use is, e.g., "RC".
it is then "RC" that I use in the file flashvar.

The player works:
http://193.203.106.3/player.html

but there is a huge BUT:
from 10 connections only 2 start instantly. The others take 1 minute to start, or more...

The only error I see on the logs is :
[ERROR] [pool-4-thread-4] org.red5.server.service.ServiceInvoker - Method checkBandwidth with parameters [] not found

I am now going to post a similar thread on RED5, but I am not 100% sure my player code is correct so your help is vital.

JW Player

User  
0 rated :

Does anyone have working links to the files that LefTy has posted?

They are
http://willswonders.myip.org:8083/Camera_Player.html
http://willswonders.myip.org:8083/Camera.html?type=camera
http://willswonders.myip.org:8083/Camera.html?type=rtmp

But they have not worked for several days.
Thanks

JW Player

User  
0 rated :

Those links are working fine for me; I've also tested them from several remote computers.

However, let's not let that stop you guys from moving forward.

Forthwith, the code!

*Camera_Player.html*bc.. <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01//EN""http://www.w3.org/TR/html4/strict.dtd">

<htmllang="en">

<head>

<title>JWFLVMediaPlayerv4.4.x-CameraSend/ReceiveWithRed5</title>

<styletype="text/css">
div.container
{
width:640px;
}

div.container
{
padding:0;
margin:0;
}

div.playercontainer
{
display:inline;
}
</style>

<scripttype="text/javascript"src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>

<scripttype="text/javascript">
varflashvars=
{
'streamer':'rtmp://www.domain.com/oflaDemo',
//...thecamerawillberecordedinthe"streams"directory
'file':'JWstream',
'type':'camera',
'controlbar':'bottom',
'stretching':'none',
'frontcolor':'86C29D',//text&icons(green)
'backcolor':'849BC1',//playlistbackground(blue)
'lightcolor':'C286BA',//selectedtext/trackhighlight(pink)
'screencolor':'FFFFFF',//screenbackground(black)
'id':'playerId1',
'autostart':'true'
};

varparams=
{
'allowfullscreen':'true',
'allowscriptaccess':'always',
'bgcolor':'#FFFFFF'
};

varattributes=
{
'id':'playerId1',
'name':'playerId1'
};

swfobject.embedSWF('player-4.4.202.swf','player1','320','260','9.0.124',false,flashvars,params,attributes);

flashvars.type='rtmp';
flashvars.id='playerId2';

attributes.id='playerId2';
attributes.name='playerId2';

swfobject.embedSWF('player-4.4.202.swf','player2','320','260','9.0.124',false,flashvars,params,attributes);
</script>

</head>

<body>

<divclass="container">
<divid="playercontainer1"class="playercontainer"><aid="player1"class="player"href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">GettheAdobeFlashPlayertoseethisvideo.</a></div>
<divid="playercontainer2"class="playercontainer"><aid="player2"class="player"href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">GettheAdobeFlashPlayertoseethisvideo.</a></div>
</div>

</body>

</html>




*Camera.html*bc.. <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01//EN""http://www.w3.org/TR/html4/strict.dtd">

<htmllang="en">

<!--callwith:http://www.domain.com/path/Camera.html?type=camera-->
<!--callwith:http://www.domain.com/path/Camera.html?type=rtmp-->
<!--callwith:http://www.domain.com/path/Camera.htmldefaultstortmp-->

<head>

<title>JWFLVMediaPlayerv4.4.x-CameraSend/ReceiveWithRed5</title>

<styletype="text/css">
playercontainer
{
display:inline;
}
</style>

<scripttype="text/javascript"src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>

<scripttype="text/javascript">
vartype=null;

if(!(type=swfobject.getQueryParamValue('type')))
{
//...defaultstortmp
type='rtmp';
}

varflashvars=
{
'streamer':'rtmp://www.domain.com/oflaDemo',
//...thecamerawillberecordedinthe"streams"directory
'file':'JWstream',
'type':type,
'controlbar':'bottom',
'stretching':'none',
'frontcolor':'86C29D',//text&icons(green)
'backcolor':'849BC1',//playlistbackground(blue)
'lightcolor':'C286BA',//selectedtext/trackhighlight(pink)
'screencolor':'FFFFFF',//screenbackground(black)
'id':'playerId',
'autostart':'true'
};

varparams=
{
'allowfullscreen':'true',
'allowscriptaccess':'always',
'bgcolor':'#FFFFFF'
};

varattributes=
{
'id':'playerId',
'name':'playerId'
};

swfobject.embedSWF('player-4.4.202.swf','player','320','260','9.0.124',false,flashvars,params,attributes);
</script>

</head>

<body>

<divid="playercontainer"class="playercontainer"><aid="player"class="player"href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">GettheAdobeFlashPlayertoseethisvideo.</a></div>

</body>

</html>



JW Player

User  
0 rated :

Thank you brokenString

JW Player

User  
0 rated :

@brokenString

If I want to insert your code , using the embed/object code , which code I must to use?

Thanks for your help

Best regards

Pierpaolo

JW Player

User  
0 rated :

RCC, how you do connection Adobe Media Encoder with the Red 5 ? I'm trying do life stream from WebCam to the client throw Red5. I send stream to the Red5 (rtmp:\\localhost\live, streamname: livestr) But after that i can't read this stream from client's side. I'm trying do something with player, but nothing happend. Red5 is working. Media Encoder too. Plz can you explain, or say where i can find documentation or information about configure Red5 with Adobe Media Encoder

JW Player

User  
0 rated :

Just to conferm that the links to the files that LefTy has posted are not working.

Those can be usefull links

thanks

JW Player

User  
0 rated :

See: *http://www.longtailvideo.com/jw/?search=rtmp+publish
*

This thread: *http://www.longtailvideo.com/support/forum/General-Chat/16066/How-to-stream-live-to-red5*

JW Player

User  
0 rated :

Dear Sir,

Please help me, I have a video file. How to streaming this file in server and client will see this file. I don't know how to do that. I want to have a live TV in my website.

Thanks.

Ethan Feldman

JW Player Support Agent  
0 rated :

Can you provide a link to where you are running this?

JW Player

User  
0 rated :

@Ethan LongTail

I can use ManyCam + red5 to stream via a virtual webcam but it's so difficult to play video in manycam. And now, I don't want to use ManyCam + red5 to stream but I don't know how to do that. Is there any code for server stream and client receive.

I installed: Red5 0.9.1 Final.
I want to build a live tv (play video or play list), which code can I do that.

Thanks.

Ethan Feldman

JW Player Support Agent  
0 rated :

@Phuc Phan – Please refer to – http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12535/video-delivery-rtmp-streaming

You will need to have the file flashvar, the streamer flashvar, and the provider flashvar (rtmp) set.

If you can provide a link, that would help. Thanks.

JW Player

User  
0 rated :

I copy code camera.html to this:

http://phantruongphuc.com/camera.html?type=camera

ANd has error.

If I use FME, Red5 and ManyCam (virtual to play video), I can see the video in client but I can't listen anything.

http://phantruongphuc.com/final.html

Is there any way for me to have a live video.

Ethan Feldman

JW Player Support Agent  
0 rated :

The issue is that you have:

‘type’: type,

It needs to be:

‘type’: ‘rtmp’,

Now, it should work.

JW Player

User  
0 rated :

Hi, my server have no recorder (such as microphone), can I use this server for live video stream? Thank.

Ethan Feldman

JW Player Support Agent  
0 rated :

@John, as long as the server is set up correctly, yes.

JW Player

User  
0 rated :

I am having Red5 working on my localhost following code I tried
bc.. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>JW Player for Flash</title>

<style type="text/css">
body { background-color: #fff; padding: 0 20px; color:#000; font: 13px/18px Arial, sans-serif; }
a { color: #360; }
h3 { padding-top: 20px; }
ol { margin:5px 0 15px 16px; padding:0; list-style-type:square; }
</style>
<script type='text/javascript' src='swfobject.js'></script>

</head>
<body><div id='mediaspace'>This text will be replaced</div>

<script type='text/javascript'>
var so = new SWFObject('player.swf','mpl','470','290','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('file','avatar.flv');
so.addVariable('streamer','rtmp://localhost/oflaDemo');
so.write('mediaspace');
</script>


</body>
</html>


Which did not worked.

Ethan Feldman

JW Player Support Agent  
0 rated :

@Tapas – Can you provide a link to where you are running this?

JW Player

User  
0 rated :

@Ethan LongTail: I've been setup red5, with code or software or anything can I use for play video realtime. I want to play a video from server and client watch that video real time. Thank.

Ethan Feldman

JW Player Support Agent  
0 rated :

Can you provide a link to where you are running this?

JW Player

User  
0 rated :

This is my site, but I can't listen anything.
http://video.vietnamfriendly.com/

Please help me how to fix this. Thanks

Ethan Feldman

JW Player Support Agent  
0 rated :

@Phuc Phan – Your video is playing correctly.

JW Player

User  
0 rated :

My video is playing correctly but I can't listen anything? How can I fix this. Thanks

Ethan Feldman

JW Player Support Agent  
0 rated :

I would check your audio settings of the streaming server.

JW Player

User  
0 rated :

How to check audio setting of streaming server? In server, I can't settign because my server don't have recorder ao anything else. Do you have any solution for me?

Ethan Feldman

JW Player Support Agent  
0 rated :

How do you have your server set up? I have never personally used Red5 before, but I would figure there would be something available to you in terms of audio configuration.

JW Player

User  
0 rated :

it says
//...the camera will be recorded in the "streams" directory

do i need to create a 'streams' directory on the red5 server or the build folder.

ssshammi@hotmail.com

Ethan Feldman

JW Player Support Agent  
0 rated :

Not sure what you mean, can you please clarify?

JW Player

User  
0 rated :

any news for the RED5 server live streaming from Adobe flash Media live Encoder 3.1 and play it in mediaplayer-5.3 Seamless failover between the Flash and HTML5 players. any code that I can use to do this.

I mean I looked through this tread hoping to find the answer just to get to a dead end. I tried most of the code above and it just does not work.

I am able to see the live stream in the RED5 demos/publisher.html and it works great. Now to take it an place it in a player on any website.

I know the file name, I know the rtmp and I have the player :) now to make it work. I don't really want to place my info on this site, seeing I am little unsure about what info not to show and what is okay. So please just dump me a demo code to try out.

I have the <script type="text/javascript" src="/jwplayer/jwplayer.js"></script> on it's place and the player on my server in the same folder. would like if i could hide it a little more in the code and that it is not open to all to see :)

Thanks


JW Player

User  
0 rated :

Wow my very next try and it worked, I will take the risk and place my code here, and try to hide what I think is not for all. But I would still like to know how to encode it so that it is not so easy for others to understand my rtmp and folder paths, so if someone could help me with that it will be great. Here is the code that worked for me:

bc.. <script type="text/javascript" src="/jwplayer/jwplayer.js"></script>

<div id='mediaspace'>This text will be replaced</div>

<script type='text/javascript'>
var so = new SWFObject('/jwplayer/player.swf','mpl','470','290','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('file','StreamDemo');
so.addVariable('streamer','rtmp://66.96.XXX.XXX/oflaDemo');
so.write('mediaspace');
</script>


Now the file name "streamDemo" is also the stream name in the Adobe Flash Media Live Encoder 3.1

bc.. so.addVariable('file','StreamDemo');


Then the streamer is the host ip/oflaDemo were the RED5 server is installed. It is also the FMS URL that your Adobe Flash Media Live Encoder streams to.

bc.. so.addVariable('streamer','rtmp://66.96.XXX.XXX/oflaDemo');


This is little risky it seems because any one could access those and use if when you not looking. So your server could run for others. Does anyone know how to secure that?

Well that is all for me then.

Thanks

Ethan Feldman

JW Player Support Agent  
0 rated :

Glad you got it working.

Here is some more information about security – http://www.longtailvideo.com/support/blog/13088/securing-your-content

This question has received the maximum number of answers.