Skip to main content
July 29, 2013
Question

How to make video chat application smarter ?

  • July 29, 2013
  • 1 reply
  • 909 views

Hi all,

   I am implementing a video chat application which is working fine in high bandwith, but it is not working well on lower bandwith (200Kbps - 500Kbps). Please help me to over come the above constraint. Please find the video resolution details as below:

     1)  Video resolution : 640 x 480 (24fps , KeyFrame interval 15) -- publishing

     2) Video resolution : 320 x 240 (24fps , KeyFrame interval 15) -- Playback

The above two are freezed. The following are the required to achieve

   1)  If bandwidht is low show an alert to the user

   2)  Detect speakers are not connected to the machine

   3)  Detect download / Upload speed of network

Please help me to achieve the above.

Thanks in advance.

This topic has been closed for replies.

1 reply

sinious
Legend
July 29, 2013

A good start would be pasting in your encoder settings here for us to look at.. Any H264VideoStreamSettings, NetStream videoStreamSettings, metaData object settings you're setting in the stream, etc.

For one, I'd never keyframe "video chat" faster than once per second. It's largely a talking head with a 50/50 chance the background is completely static.

Are you using a media server? For example the old FMS has a bandwidth detection as long as the BandwidthDetection was enabled. You then just called "checkBandwidth" from a NC call and keep stats on the bandwidth returned.

Otherwise bandwidth detection is very faulty. You'd need to monitor the throughput of the video and when you detect the speed lower than desired just show the user a dialog. Nothing more than that is necessary.

You're also not allowed to detect output devices yourself. For example Microsoft doesn't even let apps manage output devices without the user doing it themselves. They consider it a security breach.

July 30, 2013

Hi ,

  Thanks for your reply, helps me alot.

Please find the encoding setting as below,

                var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();

                h264Settings.setProfileLevel( H264Profile.MAIN, H264Level.LEVEL_3 );

                nsPublish.videoStreamSettings = h264Settings;

                // set the buffer time to zero since it is chat

                nsPublish.bufferTime=0;

                /** MetaData information **/

                var metaData:Object = new Object();

                metaData.codec = nsPublish.videoStreamSettings.codec;

                metaData.profile = h264Settings.profile;

                metaData.level = h264Settings.level;

                metaData.fps = _cam.fps;

                metaData.bandwith = _cam.bandwidth;

                metaData.height = _cam.height;

                metaData.width = _cam.width;

                metaData.keyFrameInterval = _cam.keyFrameInterval;

                metaData.language = "English";

Camera settings are as below :

     FPS : 24

     Width : 640

     Height : 480

     KeyFrameInterval : 15

     Band Width :  0

Microphone setting are as below:

     Gain : 60

      Rate : 11

Thanks in advance.

sinious
Legend
July 30, 2013

On your camera are you using setQuality()? That works hand in hand with setting the bandwidth. You may want to try getting consistent video by actually specifying a bytes per second value. Setting it to 0 means it can use all available bandwidth which can change drastically and make the video appear much less consistent.

I also, again, would never set a keyframe interval less than the number of frames for at least 1 second. I'd typically set it 3~5 seconds (so 72 or 96). That'll really take down bandwidth itself.

You can get away with using half the macroblocks of LEVEL_3 (40,500) at 640x480@24 by using H264Level.LEVEL_2_2 (20,250) which supports the same pixel count (414,720). You should try using H264Profile.BASELINE as it was designed for video conferencing. Main is designed for broadcast. You can read about profiles here.

What is your mic audio quality?