How to increase audio and video quality in flash video chat applications
1) Increase the video and audio quality settings (obviously 🙂 ):
As a webmaster you most probably have control over the audio and video encoding settings used by your video chat software. These encoding settings directly affect the audio and video quality.
In what regards sound, you should be able to change the sound rate (the higher the better). 44 is the maximum audio quality setting supported by Flash Player when capturing audio from mics but it also consumes the most bandwidth with 88kbits/s! Other values for the sound rate are 22 (44kbits/s) 11 (22kbits/s) and 8 (16kbits/s).
In what regards the video quality you should have more control! You should be able to change at least the resolution, the fps, the picture quality and the maximum bandwidth to use!
Also remember that video quality is mostly influenced by the quality of the camera! You will never get from a consumer webcam the quality you get from a DV camcorder! Also good lightning (like natural light) helps A LOT! With consumer webcams in low light you will not get too many frames per second!
2) Use a dedicated FMS/Red5 server/FMS hosting close to where your users are located:
A media server closer to your users will mean lower latency (audio/video data travels faster between the users computer and the media server) and higher peak bandwidth between your users computer and the media server (more audio and video streams can be exchanged between a user and the media server without affecting delivery quality) .
3) Configure the media server properly (FMS only)
Flash Media Server by default aggregates audio and video data into larger chunks that it sends out to users. This means that audio/video data is not sent to the users as soon as it arrives to the media server , which translates into higher latency for audio/video streams. In one to many scenarios this is not as important but when you have a 2 way audio/video discussion latency is VERY important.
You can dsiable packet aggregating by editing the Application.xml file found in FMS3.5conf_defaultRoot__defaultVHost_ and set <Queue enabled=”false”>.
This will however affect performance of the media server so if your website is driving large traffic you might want to test first or try some of the other settings in the file related to queuing and packet aggregating.
The lowest sustained latency we have achieved with a remote FMS server is 30ms for video streams and 150ms for audio+video streams.
WHATEVER YOU DO, DON’T FORGET ABOUT THE BANDWIDTH USAGE:
If a user broadcasts his webcam/mic to the media server and he uses high quality sound (44Khz which uses about 88Kbits/s of bandwidth) and low quality video (160×120@15fps at about 168kbits/s) he will consume 88+168=256kbits/s . If he watches another similar audio/video stream he will be using another 256kbits/s for a total of 512kbits/s.
If you increase the bandwidth usage for one audio+video stream to 512kbits/s, your user will now need a full 1Mbit/s of bandwidth between their computer and the media server to send and view a stream at the same time without interruptions!
If the bandwidth used by the stream(s) consumed by a user is just a little higher than the available bandwidth between the users computer and the media server, the user will start to experience breaks in frame rate, delays in delivery, frozen frames, breaks in sound, etc… .