Category Archives: Red5

Testing Media Server Latency

Remus Negrota,
Product Manager

Published by Remus on | No Comments

AVChat 3, Flash Media Server, Red5, Research, Wowza

Latency and especially high latency is one of the main problems when it comes to real time communication between a client and a server, so we decided to do some testing that would ultimately tell us which of the 3 main media-servers (AMS, Wowza and Red5) can achieve the lowest latency.

The Testbed

The testing was done using our flagship product, AVChat 3, for both client and server side as application.

The client side of AVChat was installed on a local machine in Romania. The local machine has the following processing and memory specifications: Intel i5 CPU @ 3.30Ghz and 8 GB of RAM, on a Windows 7 x64 OS.

For the media server I’ve used a VPS located in New York and one in Amsterdam, both with the following specifications: 4 CPUs and 8 GB of RAM, on a Linux CentOS 6.5 x64 OS.

This test was done using just one connected client.

The delay was probed in two ways:

  1. Using an implemented  ’ping’ like call from the client to the server that measured the round trip time (RTT) of the message:
  2. Turning on the live-stream and measuring the delay between the broadcast and the viewing of the stream by simply holding a stopwatch app in front of the camera and measuring the difference that was shown between the 2 videos, like so:

delay

Notice that in the image above there is a time difference of 120 ms between the two videos, which corresponds approximately with the RTT, shown in the green box, of 99 ms. The difference between the two obtained values of 21 ms can be accounted by the time it takes to encode the video on the broadcasters side and to decode the video on the viewer’s side.

The Actual Results

I’ve made a comparison table for all the 3 media-servers tested for both the RTT and the delay between broadcast stream and viewing stream and here are the results:

Media Server
RTT
Stream Delay
AMS 5.0.3 default settings146 - 229 ms390 ms - 520 ms
AMS 5.0.3 tweaked settings140 - 160 ms390 ms - 780 ms
Red5 1.0 RC1140 - 192 ms240 - 390 ms
Wowza Streaming Engine 4.0.3139 - 221 ms390 - 580 ms

The tweaked AMS settings mentioned in the table above are the ones Adobe recommends for obtaining lower latencies:

  • StreamManager/Live/Queue/MaxQueueSize  in Application.xml. Setting the MaxQueueSize to lower values reduces latency but is less efficient performance wise.
  • StreamManager/Live/Queue/MaxQueueDelay in Application.xml.  Decreasing the queue size reduces latency but is less efficient.

Overall these settings are designed to scale better with more clients connected at once. In this case is not really applicable as there is only one client connected.

The number of clients connected at any given time also plays a major role when it comes to latency. Some media-servers scale better in this regard but this is not the focus of our current experiment.

With that being said as you can see there are no major differences between the 3 media-servers when it comes to either RTT or stream delays.

To further the experiment I’ve made the same tests with an identical VPS only this time located in Amsterdam, so the connection was Romania – Amsterdam, instead of Romania – New York as previously tested, and here are the results:

Media Server
RTT
Stream Delay
AMS 5.0.3 default settings58 - 82 ms90 - 130 ms
Wowza Streaming Engine 4.0.362 - 87 ms80 - 140 ms
Red5 1.0 RC159 - 91 ms100 - 150 ms

After this final testing we can draw the following conclusion: the most important aspect when it comes to latency between client and server is the location of the server in relation to the location of the client.

Different technologies and tweaks may help with decreasing the latency but ultimately the distance between client and server will be the determining point.

Recording high quality (HD) video over slow connections with Red5 is now possible

Octavian Naicu,
Founder

Published by naicu on | No Comments

Builds, HDFVR, Red5

HDFVR Recording a HD video using Red5

Recording a HD video using our special Red5 build and HDFVR

Lo and behold, high quality HD video recording over slow connections is finally possible with Red5.

But 1st… some history.

Video recording with Red5 has been plagued for a long time by various issues. All this time developers and their clients had to resort to rather expensive Adobe Media Server and Wowza licenses to add quality video recording to their website.

Here’s a recent excerpt from a discussion on the Red5 mailing list about it’s recording capabilities:

From: Angry Red5 User & Developer
Subject: Does anybody succeed in recording valid FLV videos in ANY version of Red5?
Date: Feb 13 2014

I am fighting with Red5 recording from about 2-3 yers. And the sad truth is, that it propably NEVER worked.

Dont achieve simple succesful recording in any single version – it is a shame.

The last nail in the coffin with Red5 1.0.x

We’ve experienced our own issues in the past but none were as painful as the no-video-only sound-in-flv’s bug we experienced when recording video over slow connections in Red5 1.0.x . The resulting flv video files were devoid of video content. Entire 1 minute clips were turning out to contain just 1 or 2 video keyframes, the rest was audio (we were using yamdi to extract the keyframe data from .flv files).

On top of that, this was happening only when fileconsumer.delayed.write was turned on in conf/red5.properties. The delayed write mechanism was introduced in Red5 1.0 to account for Flash Player’s prioritisation of audio packets over video packets when broadcasting over slow connections but in Red5 1.0.x it was clearly not working. Instead of waiting more for the video packets and mix & sort them with the audio packets, it was doing more harm resulting in flv files devoid of any video data.

Giving back to open source

So, last week, after Red5′s official 1.0.2 release – which didn’t fix the issue – , we’ve finally decided give it a try and investigate the no-video-only sound-in-flv’s issue. Because the way of open source is such that you can download the source code and play with it, we did just that and downloaded the latest Red5 source code from GitHub and started looking at the video recording classes (src/main/java/org/red5/server/stream/consumer/FileConsumer.java).

12 hours later:

Our patch is now part of the Red5 source code and it will be included in the next Red5 build. Until then you can download the build below compiled by us and give recording another chance:

Red5-server-1.0.3-SNAPSHOT_with_recording_fixed.zip  (Download 45.9MB)

This Red5 build includes:

  1. Our patch for the video recording process
  2. fileconsumer.queue.size is set to 120 (in conf/red5.properties) which should be enough for 2 minutes of HD video recording.

You can find more info about what fileconsumer.queue.size is in the updated “Recording HD Video With Red5″ HDFVR documentation.

This Red 5 build produces:

  • crisp HD video over slow connections
  • flv files with synchronised and properly distributed audio and video frames

[DEMO] You can test this build at:

For any developer new to doing video recording here are the 4 steps you need to take to record high quality, crisp, properly synchronised, HD videos with Red5:

  1. Download and install Red5-server-1.0.3-SNAPSHOT_with_recording_fixed.zip
  2. Download HDFVR ( 1.1 build 609 or later needed )
  3. Install HDFVR using the Red5 1.0.2 hdfvr web apps folder (in the HDFVR archive)
  4. Open http://yourwebsite.com/hdfvr/VideoRecorder-hd.html and record a HD video
  5. Done, you now have new crisp HD video content for your website

New version of HDFVR (build 567) fixes the black boxes issue and more

Octavian Naicu,
Founder

Published by naicu on | 1 Comment

Flash Media Server, HDFVR, Red5, Wowza

Today we’re releasing a new version of HDFVR which was made primarily to fix the black boxes issue. however, during development, it quickly grew into something bigger.

Here are all the changes explained in great detail:

1. We’ve implemented the H264+AAC recording to MP4 using the Wowza Transcoder AddOn in the main build (until now we had a separate build – build 508- that had to be used for that).

This means:

  • we’ve added the Wowza+Transcoder AddOn option (h264_w_t) to all the video quality .xml profiles

  • we’ve tested it with Wowza 3.0.3+patch,3.0.4, 3.1.0, 3.1.1, 3.5 and 3.6

  • the Wowza server-side files now contain the hdfvr_play app (used only with h264_w_t) and the hdfvr.xml transcoder template

  • we’ve updated the Recording MP4 files (with H.264 video and AAC audio) article to:

    • contain instructions for build 508 and 567

    • contain instructions for Application.xml from 508 and 567

    • add the results from our Transcoder tests with different Wowza versions (from 3.0.3 to 3.6)

2. We’ve added a way to flip the video preview horizontally during recording (flipImageHorizontally in avc_settings.xxx). The final video will not be flipped.

3. The kfps setting from the video quality profile files is now used by HDFVR. All kfps values default to 15 which means one full frame (key frame) every 15 frames.

4. The streamPrefix option in avc_settings.xxx now has the default value  of “videoStream_” assigned from avc_settings.xxx, not from inside HDFVR.

5. Renamed duplicate trans-unit id=”037″ in the en.xml file to 037b (caused no issue).

6. The files for .NET servers (avc_settings.aspx and avc_settings.aspx.cs) have been included in this build.

7. We’ve also updated the documentation throughout avc_settings.php and the video quality .xml  profile files.

8. We’ve removed the documentation from avc_settings.asp, avc_settings.php is now the only reference for the options available in the avc_settings.xxx files.

9. We’ve added an automatic outgoing buffer increase mechanism on the client side which will prevent the outgoing buffer from becoming full and causing Flash Player to drop the entire buffer content causing big gaps in the video. You can still set the initial buffer size trough outgoingBuffer in avc_settings.xxx but if it ever becomes more than 90% full, HDFVR will now double it automatically. This feature will help a lot those trying to record high quality videos over slow connections.

10. We’ve also found out that Flash Player 11.3.300.257 released on the 8th of June 2012 removed the dreaded internal streaming limit (when publishing/broadcasting audio/video) found in previous versions of Flash Player, so the only limit now is your actual upload bandwidth with the media server. So we’ve:

11. And here are the fixed issues:

  • We’ve managed to prevent the black boxes at the end of the recording process. This started to happen with a certain Flash Player version. We’ve managed to properly fix the issue by keeping the last frame on-screen when pressing STOP.
  • Pause not working during playback, in build 508, when using Wowza + Transcoder (h264_w_t).

  • When recording a second video (pressing record a second time), the video started with a few seconds of black video

Download and upgrade

You can download the new HDFVR build from your private client area.

If you’re upgrading from a previous version:

  • most of the client side files have changed, so make a backup and replace them with the new ones (make sure your connection string is still set)
  • the Wowza server-side have changed so, if you’re using Wowza, you will want to replace the old files with the new ones and restart Wowza

Trial users do not yet have access to this build.

New phpFox build adds mobile support integration for AVChat3 (build 2202)

Stefan Nour,
Integrations Specialist

Published by stefan on | No Comments

AVChat 3, Builds, Flash Media Server, Integrations, phpFox, Red5

Hello everyone,

As I promised , I updated the phpFox integration kit for AVChat to support the latest changes (ex. mobile version) that were made to our video chat (find out more). Here is a list of what was updated in the phpFox module:

  • Never miss a new message from now. New browser tab notification lets you see how many new messages you received if you are in another browser tab.
  • Detect if the browser is mobile or desktop and provide the appropriate content.
  • Detect if you installed the AVChat files into the component directory.
  • Facebook Application ID field integration in backend.

Remember that you need the latest build of AVChat (build 2170) to have access to these great features and also Red5 or FMS media server. This update is currently available only for phpFox 3, but if users demand, we will support other version of phpFox also.

You can download the latest version(build 2202) from you private client area.

Have a great day!

AVChat Build 2160 has arrived.

Remus Negrota,
Product Manager

Published by Remus on | 2 Comments

AVChat 3, Builds, Mobile, Red5

We are proud to bring you this year’s first build of AVChat that has a lot of major changes and a heap of improvements for both the Flash client and the HTML5 client

Here are the new features:

1. Red5 support for the mobile AVChat 3 client is here.

Setting it up: The mobile client requires a Web Server: A  web server with at least PHP 5.3.10  hosting the chat. 

Socket support must be enabled. You can use phpinfo(); to check if sockets are enabled.

After a normal installation, open avchat3.properties and change the webServerIp setting (new setting) to reflect the IP  of your web server.

Also you might want to disable some of the red5 logs, because when someone connects from the mobile client, Red5 will generate a lot of logs. To do this go in the installation directory of your Red5 server -> conf – > logback.xml, and here edit the following 2 settings:

<logger name="org.red5.io">
<level value="DEBUG" />
</logger>.

Change the level value from “DEBUG” to “INFO” in the code above..

<logger name="org.red5.server.adapter.MultiThreadedApplicationAdapter" >
<level value="OFF"/>
</logger>

Change the level value from “DEBUG” to “OFF” in the code above.

2. Updated .aspx files

upload.aspx, avc_settings.aspx and style.aspx have been brought up to date to their .php counterparts so now they pull all the configuration data from  avc_settings.xml, file_types.xml and style.xml .

3. New mechanism for removing empty rooms automatically

A new delete rooms mechanism has been implemented.  Previously the rooms were  automatically deleted  as soon as the last person left the room as described in the documentation

The media server now constantly checks for empty rooms and if:

  • deleteRoomsWhenTheyBecomeEmpty = true ,
  • the room is not protected (not included in the doNotDeleteTheseRoomsWhenTheyBecomeEmpty array) and
  • is inactive for more than the number of hours expressed by a new setting ( deleteEmptyInactiveRoomsOlderThan ), then the room is deleted.

4. Better UI for when used in narrow spaces

AVChat now fits correctly in narrow spaces, this was a problem well known with some integrations. Here’s a quick view of it

5. New feature: CHAT HISTORY (for copying the entire chat history)

Added new button (Chat history) that opens up a new window with the whole chat history of the rooms it is opened in. This feature also take into account the setting autoAddIpToUsername. Here’s how it looks:

6. New ability to block all requests for access to a private stream

We added a new button that can be used to block all the view private stream requests.

 

7. Lots of improvements for the AVChat 3 Mobile Client:

 

  1. The mobile client now supports emote icons. The path to the icons is stored in the same setting as for the flash client (emoticonsurl).

  2. The mobile client now displays distinct icons for users that come from other mobile clients or from the desktop flash client.

    The camera/microphone icons now have 3 states: active ( icons are shown normal), inactive (icons are shown faded), and hidden(user has no cam/mic).

  3. The connect button on the mobile client is now disabled unless a username with a least 3 characters is typed in.

  4. Welcome message has been added to the chat room upon entry.

  5. Pinch-zoom has been disabled for the mobile client to avoid unwanted scaling of the elements.

  6. Fixed an issue with the mobile client that caused the Login button from the rooms list to not work after it was clicked if the rooms list was reloaded

 

8. The following issues have been fixed on the Flash client:

  1. We implemented a cleanup for  the rooms list on connect for all media servers, to check if all the rooms contained in the rooms list are still physically on the disk, if not we delete them. This was discovered to cause the empty text chats and empty users list problem.
  2. The background of the uploaded images when shown in the top right corner of the text chat area now scale according to the image size.

  3. The user’s own camera no longer launches in another separate window if autoStartMyCamera and autoStartCameras are set to true.
  4. Fixed issue with error messages that could not be seen entirely when the chat window was too narrow, here’s how it looks now:

  5. Fixed small issue with owner name of a room being filled with the room name instead, in the users__.xml file on FMS.
  6. Fixed issue with rotating text chat messages when leaving all rooms.
  7. Fixed issue with the aligning of elements on the Y axis after an image that wasn’t square shaped was uploaded ( the issue was all other elements left a gap between the image and the next element )
  8. Fixed padding for welcome messages and rotating messages.

  9. Fixed issue with emoticons being  replaced when formed with the “event:” string used by FP and a username like this “event:paula” where “:p” would be seen as an emoticon and replaced with spaces, redirecting to an empty html link instead of triggering an event.
  10. Fixed issue with search in users list working only in the first room that was joined.
  11. Fixed small issue with shadow direction on the tab bar when flipTabMenu was set to true.

How to download and upgrade?

You can download this new build of AVChat from your client area. As a trial user you do not yet have access to this build.

Steps to upgrade an old installation:

  1. overwrite all old client side files (You can keep your old language files. The missing phrases will default to English until you add them to your existing language XML file.)
  2. overwrite the media server files and restart the media server

If you have issues with it after upgrading make sure you clear your browser’s cache. If you still have issues after doing that send us an email at support@avchathq.com.

If you want us to upgrade your AVChat installation for you you can purchase our additional AVChat Installation Service from here: http://avchat.net/buy-now#services .  Once you make the purchase just email us at contact@avchathq.com .