Optimize video-stuck problems in video calls

Source: Internet
Author: User

Everyone in the video chat often appear mosaic or video temporary stuck, such as the network is often caused by instability such as packet loss, jitter and so on.

General audio and video technology will be added to the packet loss retransmission, Jitter optimization and other measures can be avoided due to the occasional deterioration of the network effect on the audio and video call effect but when the network bandwidth is not enough or the network status continues to deteriorate, the following describes one of the cross-platform audio and video Instant Messaging SDK Technology-anychat Interactive Platform The Anychat core provides an API interface to enable the upper layer according to its own application Choose which treatment plan

Scenario one turn on smooth playback mode continues playback when drops occur in this mode but the interface will appear mosaic disappears when you receive the next video keyframe

Scenario Two "default" turn off smooth playback mode pause playback When drops occur in this mode when the next video Keyframe arrives and then continues to play the interface will not appear mosaic but the degree of "card" is related to the network condition.

Processing video Mosaic API interface definition

///< smooth Play mode parameter int type 0 off [default], 1 open

#define Brac_so_stream_smoothplaymode

61

C + + Call the sample code to initialize the SDK after the completion of the call

// turn off smooth playback mode to prevent the mosaic from appearing dwordbsmoothplaymode = 0; Brac_setsdkoption (Brac_so_stream_smoothplaymode, (constchar*) &bsmoothplaymode, sizeof (DWORD));

// turn on smooth play mode to prevent video from being stuck but mosaic

DWORD Bsmoothplaymode = 1;

Brac_setsdkoption (Brac_so_stream_smoothplaymode, (constchar*) &bsmoothplaymode, sizeof (DWORD));

Second, set the buffer time of the audio and video stream

Audio and video calls in the process of receiving the other side of the audio and video streaming data stream data will enter buffer buffer to a certain time before the start of playback this can eliminate the impact of network jitter on calls the greater the buffering time, the greater the ability to respond to network jitter, but the greater the latency, different network environments can set different buffer times.

Anychat The kernel automatically evaluates the network status during a call to dynamically adjust the buffering time based on the different network states. Buffering time is minimized when the network is in good condition to ensure the real-time of the call process when the network status is poor, the buffer time will be increased to keep the communication process smooth.

Setting the stream buffer Time API interface definition

///< Max Stream Buffer time parameter is int type unit millisecond value range 500 ~ 5000 default

#define Brac_so_stream_maxbuffertime

60

C + + Call the sample code to initialize the SDK after the completion of the call

// set the maximum buffer time for the audio and video stream

DWORD dwmaxbuffertime = 2000;

Brac_setsdkoption (Brac_so_stream_maxbuffertime, (constchar*) &dwmaxbuffertime, sizeof (DWORD));

The maximum stream buffer time is set to allow the kernel to adjust the buffer time limit when the network conditions are very bad, the buffer time is reached when the network conditions allow the kernel to do its utmost to ensure the real-time interaction of the buffer time. In short, increase the buffer time to cope with network jitter, the ability to drop packets, but there are some delays when the network becomes worse.

Common applications maintain the default settings of the Anychat kernel when the application environment network is unstable and the real-time requirements are not high for occasions such as 3G, such as satellite communication can appropriately increase the buffer time of the stream as to whether to use the default smooth play mode or to turn off the smooth playback mode, according to the actual application to decide that the network is usually more stable in the case of the network is poor to turn on the smooth playback mode needs to turn off the smooth playback mode.


This article is from the "audio and video Instant messenger" blog, make sure to keep this source http://yinshipin1.blog.51cto.com/9620924/1587520

Optimize video-stuck problems in video calls

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.