It can be difficult to know where to start with Red5 if like me you have a reasonable level of experience with Flash/Flex/Flash Media Server, but zero experience with Java.
I had a bit of a hard time trying to find relevant tutorials that worked for me as a PC user, and consequently had a lot of difficulty getting to my first Hello World Red5 app.
The following post then details what I’d wished I’d known when I started:
Resources:
The definitive resource for everything Red5 (as defined by the Red5 team) is http://wiki.red5.org/
Installing the Red5 Server:
Download the Tarball of Red5 Server 0.8 Release Candidate 1 from here.
The reason for downloading the Tarball version rather than the Windows Installer version is that the latter has been known to have issues and may not work for you.
Un-tar (extract) the Red5 files and folders. The root folder will be called “dist”. Rename it “Red5″ and move it to “C:\Program Files\”.
Within the Red5 folder there is a file named “Red5.bat”. Double clicking this file will start the Red5 server running in a DOS Prompt window. Closing this window will stop the server running.
While the server is running, go to http://localhost:5080/. If you can see the Red5 page you know your server is running. Have a click around and play with the various demos.
Installing the Eclipse IDE for Java Developers:
Download and install the Eclipse IDE for Java EE Developers. You can find it here. You will need this to create and deploy your Red5 apps.
Installing the FlexBuilder Eclipse Plug-in:
If you haven’t done so already you may want to switch over to the Eclipse Plug-in version of FlexBuilder for the most seamless development experience when creating Red5 apps. You can find that here.
Installing the Red5 Eclipse Plug-in:
Download the plug-in from here and follow the installation instructions. If you’re using the Ganymede version of Eclipse or the installation instructions are confusing for any other reason, the “Installing Red5 Eclipse Plug-in” section of this post may help you. Make sure to download the version that targets v0.8 of the server.
Creating your first Red5 Project:
I recommend watching this video for instructions on how to create your first Red5 project, though you may want to skip the first 5 mins as its basically an introduction bringing you to the stage you should have already reached by this point, and I wouldn’t worry about changing the default code in the first instance, just see if you can get it running “as is” to begin with. Again I found that the experience using Ganymede is slightly different to the experience outlined in the video, so the “Creating a Red5 Web Project in Eclipse” section of this post should help you to fill in the blanks.
Deploying your first Red5 Project locally:
If you skip 26 minutes into the example video you’ll see how to setup and run your server. Make sure to set your Runtime Directory for the server to “C:\Program Files\Red5″. The same goes for the next paths in the setup, see the “Running your server-side app in Eclipse” section of this post for details.
The main problem that you will more than likely run into is that you can’t get the server to actually run within Eclipse. This doesn’t really matter though as you can still run the server from the “Red5.bat” file as explained above. The important thing is that in creating this instance of the Red5 server within Eclipse you’ve created a means of easily deploying your app to your Red5 installation. The first stage in attempting to run the server should have successfully copied your app over to “C:\Program Files\Red5\webapps\”, which is a pretty neat feature.
In future if you want to redeploy your app, while in the Java EE Perspective in Eclipse go to “Window/Show View/Servers”, where you should see your instance of the Red5 server. Right click on the server and select “Clean…”, this should redeploy your app(s) to the server installation for you.
Running your first Red5 Project locally:
Now that your Red5 app is deployed, run the Red5 server by double clicking the “Red5.bat” file as explained above. When testing changes to your app after redeploying it, always remember to stop and restart the Red5 server by closing and reopening the Red5 DOS Prompt window.
Testing your Red5 app:
Now that the server is up and running with your app successfully deployed, your next step is to try and connect to it from your Flex client. Go back to your auto generated Flex project within the Flex Development perspective in Eclipse, right click on the Flex project root and select “Debug As/Flex Application”. This should open your Flex app in a browser window and (all being well) successfully connect to your Red5 app.
So hopefully by now you’ve created your first Hello World app in Red5. It wasn’t entirely straightforward and it didn’t work 100% as you’d expect, but overall it was pretty damn good for a Beta, and the development experience was light years ahead of Flash Media Server.
Please leave me a comment if you’ve read this and it helped you, I’d be happy to hear if you get up and running quickly.
June 13, 2009 at 3:46 pm |
hi
I want to thank you for the great help that your blog offred to me.
I intend to develop a videoconf application with flex/red5 , I tried to download the Tarball of Red5 Server 0.8 Release Candidate 1 but the link is broken , are there an other link ?
anwar
June 15, 2009 at 9:59 am |
Thanks Anwar! Glad its been of use.
Umm.. well I was going to suggest you looked here:
http://osflash.org/red5
..but then that just links you off to the Official Download page:
http://jira.red5.org/confluence/display/downloads/Home
..which doesn’t seem to exist..!
The http://wiki.red5.org/ link seems to be pretty useless now too… maybe they’re updating everything at the moment.
I was told by the Red5 team that this was supposed to be the definitive resource for all things Red5, so I’m as confused as you are to be honest..
Haven’t had a chance to play with this lately so I’m afraid I’m a bit out of the loop. If all else fails you might want to sign up to the Red5 mailing list (http://osflash.org/mailman/listinfo/red5_osflash.org) and ask what’s going on.
cheers
rob
June 18, 2009 at 8:19 pm |
Hi Rob,
I’m getting started with RED5 and i’m looking for a tutorial or something like that about how to stream video to a running server so that anyone who logs into a page could see that video being streamed. I did some searchs on google and couldn’t find anything about it. If you could help me on this i’d appreciate. Thanks in advance.
September 3, 2009 at 10:18 am |
Good job!!!
thanks