Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Embedding flash player for Red5

78 replies [Last post]

Hi there,

I've searched through many tutorials, and am having a real problem understanding how to embed a .FLV file onto an HTML page to play through this (or any) swf flash player - using red5 streaming server.

(the red5 server is located in /usr/lib/red5/

My host installed red 5 on a linux , and i've placed the flv i wish to play in the streams folder of the oflaDemo folder.

Currently my embed code looks like:

<embed src="http://www.mydomain/seantest/flv_demo.swf" FlashVars="file=rtmp://127.0.0.1/oflaDemo&id=turningofthetide" quality="high" bgcolor="#ffffff" width="330" height="270" name="turningofthetide" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

What am i doing wrong?

I have also read the FAQ's.

Sorry for such a newbie question, but any help would be REALLY appreciated!

maybe a forum search for [url=http://www.jeroenwijering.com/?search=Red5]red5[/url] have a solution?

I can't find anything that helps there.

What really confuses me, is that many of the tutorials tell you how to use the streaming server on your LOCAL machine...

What about real life examples when its installed on a remote server that people on the internet are going to view? How do you reference the flv file thats on a remote server contained within a directory that's not in a public html folder? :s

How do you reference the flv file thats on a remote server contained within a directory that's not in a public html folder?

im not sure that is possible, for security reasons...

So does this mean that the default installation for red5 is wrong?

By default it installs in /usr/lib/red5 on a linux server.

What is the practical use of this, when many people are going to use it to stream flash videos to their website visitors?

sorry, i might have misunderstood...
i have no experience with red5, -
but i have noticed that one can not access local files from an online player and vice versa...

Ah ok,

So an online website wishing to run red5 to serve video content to their visitors will basically not work?

Is this server just for people wishing to play around with it on their local machine or internal networks, and NOT for real websites?

What is the point of the red5 server then? Seems really weird to me to have such a server that cannot serve outside of the local machine!! :s :$

my definite impression is that red5 can serve files online for online players, but alas i havent tried...

Here are four examples of various online/offline combinations using the Red5 RTMP streaming server.

<html>

<head>

  <title>Sean - Red5 - Online-Offline</title>

</head>

<body>

  <h3>Online - Online</h3>
  <embed          src="http://my.domain.com/php/mediaplayer.swf"
              quality="best"
              bgcolor="#ffffff"
                width="330"
               height="270"
                 name="player"
                align="middle"
    allowScriptAccess="sameDomain"
                 type="application/x-shockwave-flash"
          pluginspage="http://www.macromedia.com/go/getflashplayer"
            flashvars="file=rtmp://my.domain.com/oflaDemo&id=videofilename&width=330&height=270"
  />

  <h3>Online - Offline</h3>
  <embed          src="http://my.domain.com/php/mediaplayer.swf"
              quality="best"
              bgcolor="#ffffff"
                width="330"
               height="270"
                 name="player"
                align="middle"
    allowScriptAccess="sameDomain"
                 type="application/x-shockwave-flash"
          pluginspage="http://www.macromedia.com/go/getflashplayer"
            flashvars="file=rtmp://127.0.0.1/oflaDemo&id=videofilename&width=330&height=270"
  />

  <br />

  <h3>Offline - Online</h3>
  <embed          src="http://127.0.0.1:8085/php/mediaplayer.swf"
              quality="best"
              bgcolor="#ffffff"
                width="330"
               height="270"
                 name="player"
                align="middle"
    allowScriptAccess="sameDomain"
                 type="application/x-shockwave-flash"
          pluginspage="http://www.macromedia.com/go/getflashplayer"
            flashvars="file=rtmp://my.domain.com/oflaDemo&id=videofilename&width=330&height=270"
  />

  <h3>Offline - Offline</h3>
  <embed          src="http://127.0.0.1:8085/php/mediaplayer.swf"
              quality="best"
              bgcolor="#ffffff"
                width="330"
               height="270"
                 name="player"
                align="middle"
    allowScriptAccess="sameDomain"
                 type="application/x-shockwave-flash"
          pluginspage="http://www.macromedia.com/go/getflashplayer"
            flashvars="file=rtmp://127.0.0.1/oflaDemo&id=videofilename&width=330&height=270"
  />

</body>

</html>

It doesn't work. The demo's that come with red5 play fine through their swf's...

So i just don't get it, why it would not play when i embed the code...

Anyone? 8)

Do you have a test stream available?

Have you opened port 1935 for RTMP in your firewall?

I noticed two mistakes in my sample code above.

This line should point to your media player:

<embed src="http://127.0.0.1:8085/php/mediaplayer.swf"

Something like this:

<embed src="http://127.0.0.1/path-to-file/mediaplayer.swf"

Or this:

<embed src="http://my.domain.com/path-to-file/mediaplayer.swf"

The Red5 server works fine both online and offline, so there is something in your configuration that needs changing.

I've figured it was a falty configured swf player, rather than pointing to it.

However, as a security precaution is there a way of only accessing the .flv file via localhost in the address in flashvars, rather than putting in the ip/hostname?

I've noticed that i can copy the embed code and put it onto another website and it will play the swf and flv file that sits on my red5 server. Obviously this is giving people the opportunity to steal bandwidth and video's which i only want to play on the site.

Do you know where i'd look to configure that?

"I've searched through many tutorials, and am having a real problem understanding how to embed a .FLV file onto an HTML page to play through this (or any) swf flash player - using red5 streaming server."

the idea of streaming a file is to watch while you download you shouldnt embed the flv (also i think is not posible to embed an flv using rtmp) , you should get the flv throught red5 and flash using NetConnection object.

You should try reading basic red5 application with Flash to get idea over this problem. Try here

http://sunil-gupta.blogspot.com

Hey Sean,

I am having the same problem of accessing my red5 application outside of the localhost. I have been reading and searching but found no answer.

Is it possible to reference my application???

my server is for example: 123.456.22.22

in my localhost I can simply do : http://123.456.22.22/oflaDemo or http://localhost/oflaDemo or rtmp://123.456.22.22/oflaDemo

... and from a different server I cannot do any of the above.. I trie changing the virtual hosts for oflaDemo and nothing!!! I really need a solution.

Make sure that port 1935 for the RTMP is open in your firewall.

If you are using Red5 to serve the HTML, SWF, XML, etc. on port 5080 (the default), make sure that port is open in yur firewall.

Here are 10 quick reason of why to choose Red5 over FMS.

http://red5flashserver.blogspot.com/2008/04/10-quick-reasons-of-why-to-choose-red5.html

Hi,
i have check this code but here is not run in my script. here is using my code below

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="<? echo $gamewidth;?>" height="<? echo $gameheight;?>" id="FlashContent">
<param name="movie" value="<?=$gamefile;?>" />
<param name="quality" value="high" />
<param name="AllowScriptAccess" value="never" />
<param name="wmode" value="opaque" />
<embed width="<?=$gamewidth;?>" height="<?=$gameheight;?>" src="<?=$gamefile;?>" quality="high" name="FlashContent" allowscriptaccess="never" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="opaque"></embed>
</object>

Hi,

I have tried embedding a flv that I recorded to the Red5 server. The ones that are pre-recorded examples i.e. IronMan, Spiderman etc. play fine with the code but the ones I have captured using the webcam with flex don't play video they only play sound. I am trying to understand what the difference is between the two files that prevents the one that is being saved to the server via webcam from playing properly.

This is my code:

<embed src="http://mysite/player.swf" bgcolor="#ffffff" width="330" height="270" name="player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="file=rtmp://mysite/myvideo.flv&width=330&height=270"/>

Is there a flashvar that can be set? Or am I not capturing the adaquate data when I save the file to the server for it to be played back by the flash player?

Please help!

Thanks,

Sarah

hi i am new to red5 i need how to embedd flv video on html for streaming
i tried above but it is not working
can any one help me out from this
Thanks

@Girish,

Post your player code so someone can help you further.

this is my player code

<embed type="application/x-shockwave-flash" src="http://www.jeroenwijering.com/upload/player.swf" style="" id="pl2" name="pl2" bgcolor="#ffffff" quality="high" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="rtmp://localhost/oflaDemo/DarkKnight.flv" width="420" height="250"/>

<embed type="application/x-shockwave-flash" src="http://www.jeroenwijering.com/upload/player.swf" style="" id="pl2" name="pl2" bgcolor="#ffffff" quality="high" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="streamer=rtmp://localhost/oflaDemo/&file=DarkKnight.flv" width="420" height="250"/>You need to specify the stream source for the streamer flashvar and the file name for the file flashvar.

Please review the v4.x player supported flashvars here: http://code.jeroenwijering.com/trac/wiki/FlashVars

Hi KLink

Thank you very much

it is working well

Hi kLink

How to get best performance for streaming videos in red5 server

I greatly appreciate your time

Thanks in advance

Encode the video at the same size as you want to display in the player; for example 320x240.

Encode at a reasonable bitrate for "good enough" quality; probably about 512kbps.

Encode at a sensible framerate; about 20fps.

Don't make too many keyframes; one every 3-5 seconds is usually enough.

In general, don't make the video stream so large that it overloads the available bandwidth and don't ever re-size on the client.

As soon as Red5 with MP4/H.264 streaming is available (probably v.9 early 2009), start using MP4s encoded with H.264 video.

Thank you very much

After installing Red5 server when I visit the URL(http://localhost:5080/), I get following error

"HTTP ERROR: 404NOT_FOUND
RequestURI=/
Powered by jetty://"

I'm facing this issue only in one pc. Its working fine in other pcs. I re-installed the red5 server couple of times but it did not help.

I greatly appreciate your time

Thanks in advance

Hi
kLink

is it possible to stream from subdirectories other than from a fixed root path? We have a file structure with different directories and want to stream based on the path passed to the application from the client

Thanks in advance

You can easily stream from subdirectories of oflaDemo/streams, like oflaDemo/streams/Movies or oflaDemo/streams/Videos.

'streamer':                  'rtmp://www.mydomain.com/oflaDemo',
'file':                      'Movies/The Last Son.flv',
 —OR—
'file':                      'Videos/The Funny Moment.flv',

Hi kLink

Thanks a lot

Hi kLink

i am facing problem in embedding a flash video
your code is working in firefox but in ie6 all other browsers not working

Please provide a link to the test page that doesn't work in IE6 and all other browsers.

Hi kLink

this is my code to embedd flash player

<object type="application/x-shockwave-flash" data="player.swf"/> <param name="quality" value="high">
<param name="wmode" value="opaque"> <param name="flashvars" value="streamer=rtmp://localhost/jym/&file=">"

this code displays flash player in all browsers except in IE
flash player is not visible in IE

IE needs a different form of the object code, often referred to as double-object code. You cna see examples here:

      http://code.google.com/p/swfobject/wiki/documentation

deano posted a form of the object code that works in all browsers here:

      http://www.longtailvideo.com/support/forum/Setup-Problems/3615/XHTML-Validation#msg93251

I am using same code used by the deano

http://www.longtailvideo.com/support/forum/Setup-Problems/3615/XHTML-Validation#msg93251

i am unable to view the player in IE

if i right click on the place where embed the player
it is displaying movie not loaded.. ,About Adobe Flash Player 10 ..

The object/embed code is very problematic. I would suggest that you use swfobject v2 and JavaScript to embed your Flash Player.

But i need to embedd code in javascript only ...is it possible to call this function from javasript file then how

Thanks

@Girish,

Sorry, I can't understand your question.

"But i need to embedd code in javascript only ...is it possible to call this function from javasript file then how"

Please explain, in greater detail, what you want to do.

now in my website using javascript i am embedding flash player code dynimically for each thumbnail to streaming their corresponding video

@Girish,

Can you post a link to your website?

It would be helpful if I could see just where you are and what the difficulty is.

Hi kLink
That problem is solved

In youtube streaming , video buffers then playing
In youtube once video buffers we can play video in many times with intruption

what my question is

How can we stream video like youtube
Is this flash player feature or we have to write program in red5 server

Youtube uses LightTPD servers, probably with highly optimized mod_xxxx_streaming modules.

So install LightTPD and then hire lots of developers.

If you are running *nix on your servers, the LightTPD mod_h264_streaming works well, it will be available for Windows soon.

Hi kLink

can you tell me how to achieve buffering in red5 server

Thanks

Hi kLink

can you tell me how to achieve buffer streaming in red5 server

Thanks

Hi,

Is it possible to buffer video stream on client side player, when it is being streamed by Red5 Media Server, like YouTube does... If yes, how can we do it...

Thanks In Advance,
Girish

Hi Girish

I would just like to know how you solved your problem with

"now in my website using javascript i am embedding flash player code dynimically for each thumbnail to streaming their corresponding video"

I am having that same problem now...

Thanks

Also does anyone know if remote storage is possible with red5?

What i mean is, is it possible to separate the flv files with the red5 server?

Instead of placing the videos on

C:\ProgramFiles\Red5\webapps\oflaDemo\streams it would be place on another server? would still be possible to stream those files with red5?

Hi,
I have correctly installed red5 and it is working;

I have 4 web-cam that play their output using Zoneminder and Cambozola;

I am interested to understand how to play that real time streaming video into a flash website .swf

Help me please.

Thank you in advance.

Hi Guys,

Thanks for your valuable inputs and I was able to make it work on IE6 and Firefox. However only one works at a time, the second one buffers and waits at 39.

Once you stop the first, restart the second it works.

Is it single threaded?

Appreciate your help.

- Soum.

Hi, im new in this i have sucessfully installed red5 and java on my local machine...

My demos are working fine, but i tried to embed flash player to stream a video... but it gives me a message: Server not found: rtmp://localhost:5080/demos/

The code i'm using is

<embed type="application/x-shockwave-flash" src="player.swf" style="" id="pl2" name="pl2" bgcolor="#ffffff" quality="high" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="streamer=rtmp://localhost:5080/demos/&file=video.flv" width="420" height="250"/>

For Red5 RTMP, the streamer application is:

streamer=rtmp://localhost/oflaDemos

No port number is needed, the player will use 1935 for RTMP, so make sure that 1935 in open in your firewall if you want to stream to the Internet.

Your media files should be placed in oflaDemo/streams or subdirectories of streams

Red5 uses port 5080 to serve HTML, XML, images, basically everything except the RTMP stream.

Thanks for the reply...

I have change but the error is the same :

<embed type="application/x-shockwave-flash" src="player.swf" style="" id="pl2" name="pl2" bgcolor="#ffffff" quality="high" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="streamer=rtmp://localhost/oflaDemos/&file=video.flv" width="420" height="250"/>

i'm calling the html file like this : http://localhost:5080/demos/test.html

the file test.html is located in red5/webapps/root/demos/

and all the ports used are ok...

Have you tried one of the Red5 demo applications to see if it streams via the RTMP protocol?

Sometimes, the localhost doesn't work, you might try 127.0.0.1 or 192.168.0.nnn if you are on a LAN.

Look in the streams directory to see if Red5 created the medadata file; it should be named video.flv.meta

In your code, you use oflaDemos with an "s" at the end. On my Red5 installation the directory is named oflaDemo with no "s". Check yours.

embed type="application/x-shockwave-flash" src="player.swf" style="" id="pl2" name="pl2" bgcolor="#ffffff" quality="high" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="streamer=rtmp://localhost/oflaDemos&file=video.flv" width="420" height="250"/>

never use backslash at the end of oflademos and it will solve the problem

How about if i embed video playlist with red5 as the server?

You can use links to a Red5 RTMP server in a playlist.

Post a link to your test page — or at the VERY least — your player code & playlist, if you're stuck.

Anybody got an example of how to embed a live Red5 stream into HTML page?

 
@Puzzled,

I've posted many examples of Red5 livestreaming here:

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

This thread is probably the most current:

    http://www.longtailvideo.com/support/forum/General-Chat/16066/How-to-stream-live-to-red5-#msg123314

Using FME as the publisher is also covered in the referenced thread. You can also use the Red5 Publisher demo or a JW FLV player (up to v4.2.207) as publishers.

Hey guys I finally got thing baby to work even treaming to my page...one little thing .How can I get a better clearer video specially when I do live ? I notice "quality only go to 100 then if i increase it more then that "1" video slow down I go 10 i only hear video frozen. can any one help please.

KNOWLEDGE SHOULD BE FOR IMPROVEMENT NOT SUBVERSION

embed type="application/x-shockwave-flash" src="player.swf" style="" id="pl2" name="pl2" bgcolor="#ffffff" quality="high" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="streamer=rtmp://localhost/oflaDemos&file=video.flv" width="420" height="250"/>

The streamer value should be "oflaDemo", not "oflaDemos" (the 's' needs to be removed)

embed type="application/x-shockwave-flash" src="player.swf" style="" id="pl2" name="pl2" bgcolor="#ffffff" quality="high" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" flashvars="streamer=rtmp://localhost/oflaDemo&file=video.flv" width="420" height="250"/>

Hey can any help me setup the red5 and flv player please. my mail is patidar16@yahoo.com. If money makes you happy by helping me I will be glad to pay

I am also having trouble adding my flash video recorder and player to my website.
1. My recorder does not always detect my camera like it should and
2. My database may not be set up correct
3. I do not understand how to use Red5

I really need help.

I'd be happy to help.

What are the specific issues??

John

Hello this is my website http://www.picasachat.com , i am getting error of Server not found due to Red5 is not installed. how to install red5 is there any installation file?

i am facing this problem when user logging in to my website. please help

Here is my code of test.html page
Red 5 is running on localhost I have checked by opening a browser http://localhost:5080/demos/ofla_demo.html

But this code has not worked.Any help would be appreciated.
The default Demo application has 4 files in its streams directory
named
avatar.flv
avatar-vp6.flv
toystory3.flv
toystory3-vp6.flv

<html>
<head>
</head>
<body>

<!-- START OF THE PLAYER EMBEDDING TO COPY-PASTE -->

<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="provider=rtmp" />
<param name="flashvars" value="streamer=rtmp://localhost/oflaDemo" />
<param name="flashvars" value="file=avatar.flv" />
<embed
type="application/x-shockwave-flash"
id="player2"
name="player2"
src="player.swf"
allowscriptaccess="always"
allowfullscreen="true"
wmode="opaque"
flashvars="streamer=rtmp://localhost/oflaDemo/&file=avatar.flv"
width="400"
height="315"
/>
</object>

<!-- END OF THE PLAYER EMBEDDING -->

</body>
</html>

But this code snippet has not worked.

Can you please put the page up somewhere? (not localhost). Thanks!

I have checked a Remote Server on LAN if not localhost I replaced localhost by the IP of the server and still that did not worked.

I read documentation given here
http://www.longtailvideo.com/support/jw-player/13/embedding-flash

http://builddocs.com/server_os_builds/streaming-video-with-red5-oflademo-app/

and

http://www.longtailvideo.com/support/jw-player/13/embedding-flash
and the swfobject.js and player.swf are on same directory where the test.html page I created is present.

@Tapas Mishra - Again, Can you please put the page up somewhere? (not localhost). We can't blindly guess at why it is not working for you without seeing it.

@Tapas Mishra - Again, Can you please put the page up somewhere? (not localhost). We can't blindly guess at why it is not working for you without seeing it.

I'm running into the same problems but mine isn't in regards to streaming video it's setting up a game server. I am using Apache as my htp server on port 80. I have Red5 installed and allowing access to the ports on my router and firewall how can I embed web-based flv games and access Red5 to run them? Red5 runs it just fine locally but not remotely over the internet and there is absolutely no documentation anywhere to guide you through this. Seems like the developers of Red5 are relying on the users to just guess on how to set it up.

Hi, I got every thing working and resolved.

The code on the first post of mine I have not kept it in Document Root of the webserver.
That was the only thing that was stopping things.
I had made all the html code in my home directory.

Also in the line

flashvars="streamer=rtmp://localhost/oflaDemo/&file=avatar.flv"

note above oflaDemo should not end with a / so above is wrong and the correct line is

flashvars="streamer=rtmp://localhost/oflaDemo&file=avatar.flv"

Well even I faced that problem of documentation for Red5 but I hope it will improve in future.

Good, glad you got it working! :-)