metaRTC 8.0: A Completely Redesigned WebRTC SDK Library
metaRTC 8.0 represents the most substantial architectural overhaul since the project's open-source launch, serving as the foundational technology for high-performance solutions like metaIPC 3.0. This is not an incremental upgrade from metaRTC 7.0, but a full redesign, with new modules added for QoS, voice intercom, memory optimization, and video file recording/reading. It delivers marked improvements in weak network resilience, voice communication quality, and memory footprint. Over more than a year of development, the project has undergone nearly 200 iterative updates, with the community edition scheduled for release in mid-2025.
New Features
All newly added modules are implemanted in pure C and reside in the libmetartccore8 project.
YangIce
YangIce implements the WebRTC FULL-ICE protocol stack, optimized for establishing cross-network connections over the public internet. Key capabilities include:
- Candidate collection
- Candidate pair exchange
- Candidate pair generation
- Connectivity checks
- Candidate pair nomination
YangPushData
This module uses zero-copy architecture to eliminate most redundant memcpy operations, significantly reducing per-connection memory usage. For example, new IPC connections consume under 20KB of memory each. It serves as the core data foundation for the YangPacer module.
YangFile Video Recording and Playback
A pure C implementation with no external library dependencies, supporting recording and playback of H.264, H.265, OPUS, G.711, and AAC media streams. When combined with YangPacer, it enables video file streaming and WebRTC on-demand playback.
YangTls Encryption Module
Implements TCP TLS encryption for secure data transmission, supporting HTTPS, MQTT, and raw socket secure connections.
YangTwcc (Transport-wide Congestion Control)
Forms the basis of Sender Side BWE, a proven high-performance congestion control algorithm widely used in WebRTC deployments. The YangTwcc module collects packet loss and latency metrics, which serve as input data for bandwidth estimation calculations.
YangBandWidth Bandwidth Estimation
Implements Sender Side BWE, calculating real-time network congestion status using round-trip time (RTT) data alongside packet loss and latency metrics from the YangTwcc module.
YangPacer Module
Adjusts outgoing transmission rates based on congestion data from YangBandWidth, ensuring uniform distribution of video stream packets. For WebRTC on-demand file playback, it aligns packet transmission with media timestamps and current network conditions.
YangFec Module
Since H.264 does not support ULP FEC, this module exclusively uses FlexFEC (RFC 8627) for forward error correction, implementing 1-D Interleaved (Column) FEC protection.
YangCodec Coding Control Module
Supports dynamic adjustments to frame rate, bitrate, and resolution, plus intelligent big/small stream adaptation. All adjustments are based on real-time congestion data from the YangBandWidth module.
YangNetEQ Module
Mitigates the impact of network jitter on audio transmission to ensure smooth, consistent call quality. It includes three core sub-components:
- YangJitter: Reduces audio jitter
- YangPLC: Packet loss concealmant
- YangFec: Opus in-band FEC support
YangAudioProcess Module
A pure C audio processing suite with no external dependencies, including the following components:
- YangAec Acoustic Echo Cancellation: Monitors and cancels echo signals between speaker output and microphone input to eliminate echo and delay for improved voice intercom quality.
YangAcousticEchoCanceler *aec_handler; // Algorithm selection: 0 = speexdsp AEC, 1 = WebRTC AEC, 2 = built-in custom AEC yang_create_aec_canceler(aec_handler, session->aec_session, aec_algo); aec_handler->submit_playback_signal(aec_handler->session, playback_pcm); aec_handler->submit_capture_signal(aec_handler->session, input_pcm, processed_pcm); - YangAgc Automatic Gain Control: Automatically adjusts audio signal volume to prevent inconsistent levels, ensuring stable audio capture and playback.
YangAutoGainController *gain_controller; gain_controller->apply_gain(gain_controller->session, audio_pcm_buffer); - YangAns Background Noise Suppression: Detects and eliminates fixed-frequency background noise such as fan or air conditioner hum to improve audio clarity.
YangBackgroundNoiseSuppressor *noise_suppressor; noise_suppressor->run_preprocessing(noise_suppressor->session, raw_audio_pcm); - YangVad Voice Activity Detection: Detects human speech segments, which can be used as a reference for other audio processing workflows.
YangVoiceActivityDetector *vad_detector; vad_detector->detect_voice(vad_detector->session, audio_frame, frame_samples, sample_rate); - YangCng Comfort Noise Generation: Generates background noise during periods of silence in voice calls, typically used when no speech is detected by YangVad.
YangComfortNoiseGenerator *noise_generator; noise_generator->generate_comfort_noise(noise_generator->session, silent_audio_buffer, frame_sample_count, sample_rate);