red5 open source

17
Saturday, May 24, 2008 09:25 GMT Red5 Open Source Red5-An open source flash server http://red5flashserver.blogspot.com/ Save Video Images To Server Using Red5 and Flex Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 1 of 17

Upload: sunil-gupta

Post on 13-Nov-2014

2.659 views

Category:

Documents


7 download

DESCRIPTION

Red5 is an open source flash serverhttp://red5flashserver.blogspot.com

TRANSCRIPT

Page 1: red5 open source

Saturday, May 24, 2008 09:25 GMT

Red5 Open Source

Red5-An open source flash serverhttp://red5flashserver.blogspot.com/

Save Video Images To Server Using Red5 and Flex

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 1 of 17

Page 2: red5 open source

Here is a small tutorial telling how to save video preview images from Flex client to Red5 server.

The work is to take a snapshot of a video stream from the client and some how get it to be a saved image onthe server. There are ways to acheive this using ffmpeg or using a scripting language in combination withRed5. But this is the simplest one as it does not require any additional library. Flex does everything.

You can get a PNG or JPEG file saved to the Red5 server the following way-

Client Side (Development took place on Free flex sdk 3.0.0.477)

So lets assume that you already have a netconnection to your serverside application. You also have acamera opened and attached to a UI component in the browser. I have it so when a button called "Takesceen shot" is clicked the function "handleScreenShot" is called.

NOTE: SharedVideo is a public var of type Video. When I attached the video from the camera to the UI, Icopied it into Shared video.

private function handleScreenShot():void {

// Clear out any previous snapshots

pnlSnapshot.removeAllChildren();

var snapshotHolder:UIComponent = new UIComponent();

var snapshot:BitmapData = new BitmapData(320, 240, true);

var snapshotbitmap:Bitmap = new Bitmap(snapshot);

snapshotHolder.addChild(snapshotbitmap);

pnlSnapshot.addChild(snapshotHolder);

snapshot.draw(SharedVideo);

pnlSnapshot.visible = true;

// Here is how you encode the bitmapimage to a png or jpeg ByteArray and send it to the server

//var jpgEncoder:JPEGEncoder = new JPEGEncoder(75);

//var jpgBytes:ByteArray = jpgEncoder.encode(snapshot);

var pngEncoder:PNGEncoder = new PNGEncoder();

var pngBytes:ByteArray = pngEncoder.encode(snapshot);

nc.call("Save_ScreenShot", null, pngBytes);

}

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 2 of 17

Page 3: red5 open source

Server Side

Ok now the server side code for the function "Save_ScreenShot". I have this right inside the main java file ofmy Red5 applicationNOTE: You must import the following classes.

import org.red5.io.amf3.ByteArray import javax.imageio.ImageIOimport java.io.ByteArrayInputStreamimport java.awt.image.BufferedImage

public String Save_ScreenShot(ByteArray _RAWBitmapImage) { // Use functionality in org.red5.io.amf3.ByteArray to get parameters of the ByteArray int BCurrentlyAvailable = _RAWBitmapImage.bytesAvailable(); int BWholeSize = _RAWBitmapImage.length(); // Put the Red5 ByteArray into a standard Java array of bytes byte c[] = new byte[BWholeSize]; _RAWBitmapImage.readBytes(c); // Transform the byte array into a java buffered image ByteArrayInputStream db = new ByteArrayInputStream(c); if(BCurrentlyAvailable > 0) { System.out.println("The byte Array currently has " + BCurrentlyAvailable + " bytes. The Buffer has " +db.available()); try{ BufferedImage JavaImage = ImageIO.read(db); // Now lets try and write the buffered image out to a file if(JavaImage != null) { // If you sent a jpeg to the server, just change PNG to JPEG and Red5ScreenShot.pngto .jpeg ImageIO.write(JavaImage, "PNG", new File("Red5ScreenShot.png")); } } catch(IOException e) {log.info("Save_ScreenShot: Writing of screenshot failed " + e); System.out.println("IOError " + e);} } return "End of save screen shot";

This is one way, You can also make it working for the other way i.e. getting images from server to client.

Thanks to Charles Palen for posting the snippet of this code in Red5 community.Technology Update

http://red5flashserver.blogspot.com/2008/05/save-video-images-to-server-using-red5.html

Red5 And RTMFP( Real Time Media Flow Protocol): Will It Be?

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 3 of 17

Page 4: red5 open source

Just two days back, Adobe made a prerelease of Adobe Flash Player 10. There are many new significentfeatures, improvements. Some of the features like RTMFP(Real Time Media Flow Protocol) just discussedbut not shared the deatil yet by Adobe.

This prerelease from Adobe gave great news to Open Source Flash community( http://osflash.org), moreSpecifically red5 community and they already started talking about it here and here.

What is p2p RTMFP?

You can get good idea about it here at - http://www.flashcomguru.com/index.cfm/2008/5/15/player-10-beta-speex-p2p-rtmfp and http://justin.everett-church.com/index.php/2008/05/16/rtmfp-in-flash-player-10-beta/

But from the release notes, it seems that many new features will be available only to FMS users with futurerelease of FMS, so it will be another challenge for the red5 team.Technology Update

http://red5flashserver.blogspot.com/2008/05/red5-and-rtmfp-real-time-media-flow.html

Building Red5 Applications- Video

I found a video of Chris Allen that walks you through getting started actually using Red5 server, so i thoughtof sharing it here.

This video will help you to better understand what is Red5 and how can you start building applications usingRed5.

Reference:-Building Red5 Applications Technology Update

http://red5flashserver.blogspot.com/2008/05/building-red5-applications-video.html

Embedded Tomcat In RED5

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 4 of 17

Page 5: red5 open source

The development of Red5 server is on the fast track. Red5 developers are adding more and morefunctionality in order to make Red5 server, a tough competitor of FMS.

Paul Gregoire from Red5 has worked on Embedded Tomcat in Red5. Now we have a choice between Jettyand Tomcat as a web container, Previously Jetty was the only web container with Red5.

Though emebeded Tomcat won't impact your application in terms of functionality. But it gives you the optionto choose between web containers and an advantage that it will now be easier to run the Edge/ Origin setupfrom the embedded Tomcat as opposed to the Tomcat standalone container.

How to change the settings to make it working with Tomcat?

Go to red5.xml in conf directory and comment the jetty server and uncomment the Tomcat server like below-

 

 

         

                      

                              

                               

             ${http.port}          ${https.port}

          false       

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 5 of 17

Page 6: red5 open source

                     

                                   

                                           

                                 

                                                  

                                                     

                    

   

 The discussion over embeded Tomcat in Red5 is going on Red5 mailing list.Technology Update

http://red5flashserver.blogspot.com/2008/05/embedded-tomcat-in-red5.html

Open Source SIP Phone With Red5 And Flex3

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 6 of 17

Page 7: red5 open source

Few days back, i wrote an interesting post talking about implementation of open source SIP phone with Red5and Flex3.

This was possible with latest release of Red5 plugin for Openfire that features a completely open-sourceimplementation of a web-based SIP softphone written in Flex3.

The below diagram shows how the implementation works-

More detail information over its working and the technologies behind its implementation are available here at-Flash-based Audio in Openfire part IITechnology Update

http://red5flashserver.blogspot.com/2008/05/open-source-sip-phone-with-red5-and.html

Red5 Showcase-- Applications Using Red5 Continues...

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 7 of 17

Page 8: red5 open source

In my previous post of Red5 showcase, I shared the information of many applications that are using Red5 media server as a part of their development. This post will showcase few more such applications.

Pixelquote(http://pixelquote.com/) is an application based on Red5. It's a huge Pixelwall where visitors cansimply add Pixels with their Messages.

http://www.ligachannel.com/ is a website of Italian singer. The website uses Red5 VOD Protected Streamingand audio/video recording widgets.

Dimdim(http://www.dimdim.com/) is an open source web conferencing system that uses Red5. Dimdim isavailable for free so everyone- not just big companies with big budgets - can use it. And Dimdim is availableas open source software so you can extend and improve it freely.

ePresence (http://epresence.tv/) is both a webcasting and web conferencing system that supports full duplex,multi-point audio and video conferencing + desktop sharing. This new functionality has been added byintegrating an Open Source real-time communications platform Red 5 with ePresence Server.

Gchats Visichat(http://www.gchats.com/red5chat/visichat/) is a live video chat community that connects youwith people from around the world. Connecting is easy with public and private chat rooms. With breakthroughvideo and voice technology which gives you a real and natural experience.

Zingaya(http://www.zingaya.jp/) is a VOIP server built on Red5 for Flashphone.

Sticko(http://www.sticko.com/) is a multimedia content manager. You can manage your live video webcasts,photos, and videos from one place. Its a video portal with widgets for popular social networking sites likefacebook, mySpace, Blogger, LiveSpace, WordPress, vBulletin and more.

Sprasia(http://www.sprasia.com/) is a website where you can edit videos and can add effects on top of it andshare it with whole world. You can directly import videos from YouTube and can apply cool effects on top ofthese videos. Red5 is being used as a part of their development.

VPlace(http://www.vplace.com.br/) is an E-Learning system with Flex and Red5 with features like file sharing,nice laser pointer, chat, etcetera and live Screen Sharing feature in process. The website is in Portuguese.

Red5 is hot and many companies around the world are showing interest in building applications based onRed5. I will again showcase Red5 based applications as soon as I hear any new.

You can also contribute to Red5 showcase, if you are aware of any application that is based on Red5 and notlisted here, just drop a comment with little details, I will include that in Red5 showcase.

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 8 of 17

Page 9: red5 open source

Related Posts:-New Version Of Dimdim's Open Source Community Edition Going To ReleaseSprasia Now Open For All- Public Beta Released

Previous Post- Red5 ShowCase:-Red5 Showcase-- Applications using Red5Technology Update

http://red5flashserver.blogspot.com/2008/05/red5-showcase-applications-using-red5.html

10 Quick Reasons Of Why To Choose Red5 Media Server Over Flash Media Server

Why to choose Red5, an open source flash media server over Adobe Flash Media server. few weeks back,Red5 has released version 0.7.0 final which has many new features and bugfixes. The complete changelog ishere.

Here is a quick list of why to choose Red5 over FMS.

1. Red5 can stream as well as Flash Media Server.

2. No delay in Audio/Video brodcast with latest versions.

3. The server side is Java, much more popular than Adobe server side action scripting for flash media server.

4. Strong community support for Red5 as you can see in Red5 showcase, some of the big companies arealso working on Red5 based application.

5. Red5 is not just a streaming server, its much more powerful, You can build many useful applications( whiteboard, Chat, Poll, Desktop Sharing, ...) over Red5, which does things more than just streaming.

6. Red5 uses MRTMP now to cluster the stream data with Terracotta, now you can do a load balancing withred5.

7. Red5 team is working to release the version of Red5 which will support H.264.

8. There are good Red5 support and hosting companies now available which can provide support and canhost your Red5 based applications.

9. Red5 is an open source project(http://osflash.org/red5), so you can contribute to its development.

10. Red5 is fun, Red5 is free.

So if someone is in dilemma of selection between Red5 and FMS, share this information with him. You arewelcome to put comments or suggest some more points to add to this list.

Reference:-Red5 HomepageTechnology Update

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

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 9 of 17

Page 10: red5 open source

Red5 And Load Balancing - Not The Load Balancer Way

In one of my previous post, I discussed about the load balancing of stream data using Terracotta. There aremany red5 users who do not want this solution because this soulution is too advance for them. They donthave such a huge load on their server that they need this soultion.For those who just want to keep distributing the incoming requests to any of the available server they have,Lets call it static load balancing, because we know to which server we have to map the request. We will not use any kind of load balancer like Pound or something else.

Below is simple way to acheive the load balancing of Red5 without using any load balancer.

Round-Robin:-Suppose we have 4 Red5 servers and we want to distribute the incoming client request to one of theseserver in Round-robin fashion. So the possible table could be like below-

Request Red5-1 Red5-2 Red5-3 Red5-41 Yes No No No2 No Yes No No3 No No Yes No4 No No No Yes------------------------------------5 Yes No No No-----------------------------------

As you can see the fifth request will again map to first red5 server and so on.

This was the simplest solution to distribute the load on Red5 server but it has some limitations.This approach does not know which server is loaded much or exhausted. it simply passes the incomingrequest to any of the server based on round-robin.

The other efficient way to load balance red5 could be-

1. Add in your application a function that returns the amount of rooms/instances/scopes and connected users. 2a. Develop a (php-)script that calls that function on your red5 server(s) using AMFPHP via cron(job) once every xx minutes.2b. Calculate the result (e.g. server A has 70 users and server B has 120 users) and store it in a small status-file (or db). 3a. Have your flash-client-application call the (php-)script 3b The script reads the status-file or db. 3c The script returns 'go connect to server A.4 The flash client connects to server A , thus offloading server B.

The second solution is taken from the discussion in Red5 forum over load balancer.

See Also:-

Red5 clustering of stream data with TerracottaMRTMP- Red5 load balancingTechnology Update

http://red5flashserver.blogspot.com/2008/04/red5-and-load-balancing-not-load.html

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 10 of 17

Page 11: red5 open source

Red5 With MySQL

Red5 flash server with MySQL database.

A very good tutorial that you can follow to start working with Red5 and MySQL 5.0 was posted few monthsback on actionscript.org by Milan Toth.

Read more about this good post here.

It's very detailed article with both client and server side sample code. Hope it will help for those who arelooking for MySQL along with red5 flash server.Technology Update

http://red5flashserver.blogspot.com/2008/03/red5-with-mysql.html

Create a Poll application in Red5 and Flash

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 11 of 17

Page 12: red5 open source

Red5 flash server is not just a server written to deliver the streaming of media.it's much more powerful server.

Here i am writing about how we can create a shared poll application using Red5 flash server which can be apart of Video conference application.

Note:-This article assumes that you have working knowledge of Red5 server and Flash.

Lets assume a typical video conference application , where a host and few other users are participating. Hosthas given access to create a poll. As soon as host creates a poll, it will broadcast to every user including host in that conference and every userwill participate in poll.

Flash Client Side Work:-

Create a user interface for creating the Poll. A typical user interface for 3 kinds of Poll ( Single Answer, Multiple Answer and Free Text ) could be similar tothe below diagrams.

Sample Poll creation window

When host click on next after selecting single answer or multiple answer. the screen may be like this.

For Free Text type, It may be like below screen.

All these screens will give the idea of a sample Poll user interface.

Now we move to second step, the XML representation of this UI. XML description of UI could be like this.

The above XML will be created when host will select either Single Answer or Multiple Answer question. Wewill pass this XML String to Red5 server.

For Free text type question we can use the XML like below.

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 12 of 17

Page 13: red5 open source

Red5 server Side Work:-

Now we move to Red5 server side. Red5 side application will pick this XML and will distribute this XML among all users including Host.

Flash Client Side Work:-

Once again this XML is on the flash client side with every user of the conference. Now client application willparse this application and build the user interface for participating in Poll based on type of question andnumber of options. A sample poll participation screens for the above XML could be same as in below diagram.

Sample for Single answer type.

For Multiple answer type, we can replace the radio buttons with check boxes.

Sample for Free Text answer

For collecting the result data, we can use XML again. This way we can build a shared poll application withRed5 and Flash.

Note:- For distributing XML string to every user in conference, we can use the concept of sharedobject in Red5.

Interested to create a shared whiteboard application using Red5 and Flash? It is hereTechnology Update

http://red5flashserver.blogspot.com/2008/03/create-shared-poll-application-in-red5.html

Red5 Showcase-- Applications using Red5

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 13 of 17

Page 14: red5 open source

Today many of well known applications are using Red5 flash server. Few of them are listed below.

http://www.snappmx.com/ - a Rapid Application Development System that supports the creation of Red5applications.

http://code.google.com/p/openmeetings - Open source video Conference. Detail post about openmeetings is here.

http://www.dokeos.com Dokeos is a learning management system used in more than 600 companies andpublic administrations to manage e-learning and blended learning programmes.

http://spreed.comMeet and Present Any Time, Any Where - At a Push of a Buttonspreed is the world´s first free web meeting service. spreed provides a free and worldwide Web 2.0 meetingservice for consumers and professionals.

http://www.videokent.com/videochat.php Video Chat

http://blipback.com BlipBack is a video comment widget that you can embed on any number of social networksites or blogs you have. Blipback lets you or your friends record short video comments directly to your page.

http://artemis.effectiveui.com/ Bridge AIR applications to the Java runtime.

http://facebook.com/video Facebook is a social utility that connects people with friends and others who work,study and live around them. People use Facebook to keep up with friends, upload an unlimited number ofphotos, share links and videos, and learn more about the people they meet.Videouploading/recording/messaging system that allows you to record a video on the upload page or send aprivate message to another user and attach a video.

http://www.streamingvideosoftware.info/ Streaming video chat software script is a RED5 based system thatallows you to build a comprehensive pay per minute / pay per view video chat site.

http://nonoba.com/chris/fridge-magnets - Classical fridge magnet toy.

http://www.quarterlife.com - Video blogging application

http://www.avchat.net - Red5 Flash Audio/Video Chat Software

http://www.avchat.net/fms-bandwidth-checker.php - Red5 bandwidth checker with upload/download andlatency tests

http://www.justepourrire-nantes.fr - Red5 Flash Video streaming

http://www.nielsenaa.com/TV/tv.php - Red5 Flash Php/MySql/Ajax driven scheduled & streamed multichannel TV

http://www.videoflashchat.com - VideoFlashChat - Red5 version for Web Based Video Chat

http://www.videogirls.biz - VideoGirls BiZ - Red5 version for Pay Per View Video Chat Software.

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 14 of 17

Page 15: red5 open source

For detail list of applications using Red5, visit at red5 official showcase page here.Technology Update

http://red5flashserver.blogspot.com/2008/03/red5-showcase-applications-using-red5.html

Red5 Project Roadmap

Red5 flash server is a free alternate of Flash Media server and its gaining popularity among open sourceusers. Below is the project roadmap of the Red5 server development.

RED5 ? Project RoadmapCurrent Release: 0.7.0Next Release: 0.7.1

0.1 Echo, Echo, EchoReleased Early October 2005

Proof of concept release showing RTMP and AMF support.

Standalone serverSpring and Mina integrated to form server baseAMF data encoding and decodingRTMP packet encoding and decodingService invocation layerEcho service exposed using RTMP

Read more at Red5 official roadmap page hereTechnology Update

http://red5flashserver.blogspot.com/2008/03/red5-project-roadmap.html

Red5 support and Hosting service

Red5 is an open source flash server with a large community of users behind it.

red5server.com provides complete Red5 support and hosting service. They have dedicated and clustersolution for supporting many simultaneous connections.They have solutions for disk space and Bandwidthtransfer also.Their service works from anywhere in the world.To know more about red5 hosting and support, follow the linkof red5server here.Technology Update

http://red5flashserver.blogspot.com/2008/03/red5-support-and-hosting-service.html

Red5 and RTMPE -- Just a thought

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 15 of 17

Page 16: red5 open source

Adobe released the Flash media server 3 and it features RTMPE(Real time messaging protocol withencryption), an enhanced version of RTMP for higher performance and 128 bit encryption to increase thesecurity of streamed media. It's going to be very important feature for every FMS user who is concern about the security of his content.Good post about DRM feature of flash media server from flashcomguru is here. Just a thought, Will Red5 flash server( The open source alternate to FMS) support this new protocol.Technology Update

http://red5flashserver.blogspot.com/2008/03/red5-and-rtmpe-just-thought.html

Red5 Tutorials

Below is the link from where you can download many good Red5 tutorials in pdf format.

Download Red5 Tutorials

Enjoy!!Technology Update

http://red5flashserver.blogspot.com/2008/03/red5-tutorials.html

Red5 clustering of stream data with Terracotta

Red5 is an open source flash server and alternate of flash media server from Adobe.Red5 load balancingwas required to cluster the stream data.For this Red5 team has worked with Terracotta and now they havecomeup with load balancing of Red5 in the red5 v 0.7.0 final release using MRTMP(Multiplex RTMP).More information on reference links.

1.Terracotta Red52.Red5 and Terracotta POC3.Clustering Red54.Edge origin solution on TerracottaTechnology Update

http://red5flashserver.blogspot.com/2008/03/red5-clustering-of-stream-data-with.html

Red5 now in V0.7.0 Final

Red5 has released the version 0.7.0 final. Below are the details of the changes.Red5 v0.7.0 final 02.23.2008The Red5 Team is proud to announce the release of Red5 0.7.0

Major changes since 0.6.3:

Initial Edge/Origin clustering support for multiple Edges with a single Origin New Flex admin toolAdded a multi-threaded ApplicationAdapter that allows multiple clients to connect simultaneously to the sameapplicationAdded stream listeners that can get notified about received packets Fixed a critical memory leak bug in networking due to MINA ExecutorFilterAdded new Flash Player 9 statuses NetStream.Play.FileStructureInvalid andNetStream.Play.NoSupportedTrackFoundTechnology Update

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 16 of 17

Page 17: red5 open source

http://red5flashserver.blogspot.com/2008/03/red5-now-in-v070-final.html

Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 17 of 17