Your SlideShare is downloading. ×
0
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Red5 Open Source Flash Server
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Red5 Open Source Flash Server

12,753

Published on

Red5 is an open source flash server

Red5 is an open source flash server

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
12,753
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
247
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 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
  • 2. 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 on the server. There are ways to acheive this using ffmpeg or using a scripting language in combination with Red5. 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 a camera opened and attached to a UI component in the browser. I have it so when a button called quot;Take sceen shotquot; is clicked the function quot;handleScreenShotquot; is called. NOTE: SharedVideo is a public var of type Video. When I attached the video from the camera to the UI, I copied 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(quot;Save_ScreenShotquot;, null, pngBytes); } Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 2 of 17
  • 3. Server Side Ok now the server side code for the function quot;Save_ScreenShotquot;. I have this right inside the main java file of my Red5 applicationNOTE: You must import the following classes. import org.red5.io.amf3.ByteArray import javax.imageio.ImageIO import java.io.ByteArrayInputStream import 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(quot;The byte Array currently has quot; + BCurrentlyAvailable + quot; bytes. The Buffer has quot; + 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.png to .jpeg ImageIO.write(JavaImage, quot;PNGquot;, new File(quot;Red5ScreenShot.pngquot;)); } } catch(IOException e) {log.info(quot;Save_ScreenShot: Writing of screenshot failed quot; + e); System.out.println(quot;IO Error quot; + e);} } return quot;End of save screen shotquot;; 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
  • 4. Just two days back, Adobe made a prerelease of Adobe Flash Player 10. There are many new significent features, improvements. Some of the features like RTMFP(Real Time Media Flow Protocol) just discussed but not shared the deatil yet by Adobe. This prerelease from Adobe gave great news to Open Source Flash community( http://osflash.org), more Specifically 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 future release 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 thought of sharing it here. This video will help you to better understand what is Red5 and how can you start building applications using Red5. 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
  • 5. The development of Red5 server is on the fast track. Red5 developers are adding more and more functionality 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 Jetty and 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 option to choose between web containers and an advantage that it will now be easier to run the Edge/ Origin setup from 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
  • 6. 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
  • 7. Few days back, i wrote an interesting post talking about implementation of open source SIP phone with Red5 and Flex3. This was possible with latest release of Red5 plugin for Openfire that features a completely open-source implementation 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
  • 8. 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 can simply add Pixels with their Messages. http://www.ligachannel.com/ is a website of Italian singer. The website uses Red5 VOD Protected Streaming and audio/video recording widgets. Dimdim(http://www.dimdim.com/) is an open source web conferencing system that uses Red5. Dimdim is available for free so everyone- not just big companies with big budgets - can use it. And Dimdim is available as 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 by integrating 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 you with people from around the world. Connecting is easy with public and private chat rooms. With breakthrough video 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 like facebook, 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 and share it with whole world. You can directly import videos from YouTube and can apply cool effects on top of these 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 on Red5. 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 not listed 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
  • 9. Related Posts:- New Version Of Dimdim's Open Source Community Edition Going To Release Sprasia 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 is here. 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 are also 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 with red5. 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 can host 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 are welcome 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
  • 10. 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 are many red5 users who do not want this solution because this soulution is too advance for them. They dont have 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 these server in Round-robin fashion. So the possible table could be like below- Request Red5-1 Red5-2 Red5-3 Red5-4 1 Yes No No No 2 No Yes No No 3 No No Yes No 4 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 incoming request 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 Terracotta MRTMP- 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
  • 11. 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 months back 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 are looking 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
  • 12. 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 a part 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. Host has 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 user will 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 to the 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. We will 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
  • 13. 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 will parse this application and build the user interface for participating in Poll based on type of question and number 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 with Red5 and Flash. Note:- For distributing XML string to every user in conference, we can use the concept of shared object 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
  • 14. 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 Red5 applications. 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 and public administrations to manage e-learning and blended learning programmes. http://spreed.comMeet and Present Any Time, Any Where - At a Push of a Button spreed is the world´s first free web meeting service. spreed provides a free and worldwide Web 2.0 meeting service 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 network sites 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 of photos, share links and videos, and learn more about the people they meet.Video uploading/recording/messaging system that allows you to record a video on the upload page or send a private message to another user and attach a video. http://www.streamingvideosoftware.info/ Streaming video chat software script is a RED5 based system that allows 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 and latency 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 multi channel 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
  • 15. 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 source users. Below is the project roadmap of the Red5 server development. RED5 ? Project Roadmap Current Release: 0.7.0 Next Release: 0.7.1 0.1 Echo, Echo, Echo Released Early October 2005 Proof of concept release showing RTMP and AMF support. Standalone server Spring and Mina integrated to form server base AMF data encoding and decoding RTMP packet encoding and decoding Service invocation layer Echo 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 cluster solution for supporting many simultaneous connections.They have solutions for disk space and Bandwidth transfer also. Their service works from anywhere in the world.To know more about red5 hosting and support, follow the link of 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
  • 16. Adobe released the Flash media server 3 and it features RTMPE(Real time messaging protocol with encryption), an enhanced version of RTMP for higher performance and 128 bit encryption to increase the security 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 balancing was required to cluster the stream data.For this Red5 team has worked with Terracotta and now they have comeup 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 Red5 2.Red5 and Terracotta POC 3.Clustering Red5 4.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.2008 The 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 tool Added a multi-threaded ApplicationAdapter that allows multiple clients to connect simultaneously to the same application Added stream listeners that can get notified about received packets Fixed a critical memory leak bug in networking due to MINA ExecutorFilter Added new Flash Player 9 statuses NetStream.Play.FileStructureInvalid and NetStream.Play.NoSupportedTrackFoundTechnology Update Saturday, May 24, 2008 09:25 GMT / Created by RSS2PDF.com Page 16 of 17
  • 17. 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

×