Real-Time Streaming Systems (WebRTC + Live Data) · Pelajaran

Arsitektur SFU vs. MCU

Pahami perbedaan antara Selective Forwarding Units (SFU) dan Multipoint Control Units (MCU) untuk panggilan WebRTC multipihak.

Pelajaran 1 dari 412 langkah

Arsitektur SFU vs. MCU adalah pelajaran Real-Time Streaming Systems (WebRTC + Live Data) gratis di CoddyKit. Ini adalah pelajaran 1 dari 4. Kamu bisa membaca pelajaran lengkapnya di bawah secara gratis — lalu praktikkan langsung di browser dengan editor kode bawaan dan tutor AI 24/7. Ini adalah bagian dari jalur belajar Real-Time Streaming Systems (WebRTC + Live Data), dan progresmu tersinkronisasi di web dan aplikasi CoddyKit. Kursus Real-Time Streaming Systems (WebRTC + Live Data) mencakup 4 pelajaran total.

Bagian dari pelajaran ini belum diterjemahkan dan ditampilkan dalam bahasa Inggris.

Scaling Multi-Party Calls

Imagine a video call with many people. How do all their video and audio streams connect efficiently? Direct peer-to-peer connections, common in 1-on-1 WebRTC, become complex and inefficient for larger groups.

This lesson explores two main server-side architectures for scaling multi-party calls: MCU and SFU.

Introducing the MCU

MCU stands for Multipoint Control Unit. Think of an MCU as a central 'mixer' for all participants' media streams.

In an MCU architecture, every participant sends their individual audio and video stream to a central server.

How MCU Processes Streams

The MCU server receives all individual streams, decodes them, mixes them together into a single composite stream (e.g., a grid layout of videos), and then re-encodes this single stream.

Finally, the MCU sends this *single, mixed stream* back to *all* participants.

MCU: Client Benefits

A big advantage of the MCU model is that each client only needs to send one stream (their own) and receive one stream (the mixed stream from the server).

This significantly reduces the client's bandwidth and processing requirements, making it suitable for users with weaker internet connections or less powerful devices.

MCU: Server Trade-offs

While beneficial for clients, MCUs place a heavy load on the server. The server has to decode, mix, and re-encode many streams in real-time.

  • Server Intensive: High CPU and memory usage.
  • Quality Compromise: Re-encoding can introduce latency and reduce individual stream quality.
  • Limited Customization: Clients receive a fixed layout determined by the server.

Introducing the SFU

SFU stands for Selective Forwarding Unit. Unlike an MCU, an SFU does not mix or re-encode media streams.

An SFU acts as a smart router, forwarding individual streams from one participant to all others who need to receive them.

How SFU Routes Streams

In an SFU setup, each participant sends their stream to the SFU server. The SFU then forwards each participant's stream *individually* to all other participants.

The SFU can selectively choose which streams to forward and at what quality (e.g., sending a lower resolution to clients with poor bandwidth).

SFU: Client-Side Flexibility

With an SFU, each client receives multiple individual streams (one from each other participant). The client then decodes and renders these streams locally.

This allows for greater flexibility in layout and individual stream control on the client side. For example, a client can choose to display only a few main speakers.

Try running this example:

function simulateSFUClient(numberOfParticipants) {
  console.log("--- SFU Client Simulation ---");
  console.log("Receiving individual streams from server:");
  for (let i = 1; i <= numberOfParticipants; i++) {
    console.log(`  - Stream ${i} (from Participant ${i})`);
    // In a real WebRTC app, this would involve
    // creating a <video> element for each stream.
  }
  console.log("Client renders all streams locally.");
  console.log("----------------------------");
}

simulateSFUClient(3); // Simulate a call with 3 other participants

SFU: Balancing Act

SFUs are highly efficient for the server as they don't decode/re-encode, just forward. This makes them more scalable for many participants.

However, clients need more bandwidth (to receive multiple streams) and more processing power (to decode and render them all locally).

  • Server Efficient: Low CPU/memory per stream.
  • Client Intensive: Higher bandwidth and CPU for clients.
  • Flexible: Clients can customize layout and individual stream visibility.

Choosing the Right Architecture

The choice between MCU and SFU depends on your application's specific needs:

  • MCU: Best for low-bandwidth clients, fixed layouts, and when server cost for processing is acceptable.
  • SFU: Ideal for high-quality, flexible layouts, and when scaling to many participants is critical, assuming clients have adequate resources.

SFU vs. MCU Quiz

Test your understanding of MCU and SFU architectures.

Recap: MCU vs. SFU

We've explored two key architectures for multi-party WebRTC calls:

  • MCU (Multipoint Control Unit): Server mixes streams, sends one composite stream to each client. Good for low-resource clients, but server-intensive.
  • SFU (Selective Forwarding Unit): Server forwards individual streams to clients. Offers better quality and client flexibility, but requires more client bandwidth and processing.

Choosing between them depends on your specific application requirements and user constraints for scalability and quality.

Gratis untuk memulai

Belajar Real-Time Streaming Systems (WebRTC + Live Data) dengan tutor AI — gratis

Tulis dan jalankan kode asli di browser kamu, dapatkan bantuan instan dari tutor AI 24/7, dan lanjutkan di mana kamu tinggalkan di web atau aplikasi.

Kursus
12
Pelajaran
48

Pertanyaan yang Sering Diajukan

Apakah pelajaran “Arsitektur SFU vs. MCU” gratis?

Ya — teks lengkap “Arsitektur SFU vs. MCU” gratis dibaca di sini di web. Untuk praktiknya secara interaktif (editor kode bawaan dan tutor AI 24/7) dan buka sisa kursus Real-Time Streaming Systems (WebRTC + Live Data), upgrade ke CoddyKit PRO. Kursus Real-Time Streaming Systems (WebRTC + Live Data) mencakup 4 pelajaran total.

Apa yang akan aku pelajari di “Arsitektur SFU vs. MCU”?

Pahami perbedaan antara Selective Forwarding Units (SFU) dan Multipoint Control Units (MCU) untuk panggilan WebRTC multipihak. Kamu berlatih Real-Time Streaming Systems (WebRTC + Live Data) dengan kode praktik yang langsung kamu jalankan di browser, dan tutor AI 24/7 menjawab pertanyaanmu saat kamu mengerjakan pelajaran ini.

Apakah aku perlu pengalaman untuk memulai Real-Time Streaming Systems (WebRTC + Live Data)?

Tidak diperlukan pengalaman sebelumnya. Real-Time Streaming Systems (WebRTC + Live Data) di CoddyKit dirancang untuk pemula hingga pelajar tingkat lanjut, jadi kamu bisa memulai di sini atau dari awal dan belajar sesuai kecepatan kamu sendiri. Ini adalah pelajaran 1 dari 4.

Berapa lama pelajaran “Arsitektur SFU vs. MCU” memakan waktu?

Sebagian besar pelajaran CoddyKit memakan waktu sekitar 5–10 menit. Setiap pelajaran ringkas dan interaktif, jadi kamu membuat kemajuan stabil dan melanjutkan dari tempat kamu tinggalkan di web dan aplikasi.

Bisakah aku menulis dan menjalankan kode dalam pelajaran Real-Time Streaming Systems (WebRTC + Live Data) ini?

Ya. Setiap pelajaran Real-Time Streaming Systems (WebRTC + Live Data) menyertakan editor kode bawaan, jadi kamu menulis dan menjalankan kode nyata langsung di browser dan mendapatkan umpan balik AI instan — tidak diperlukan penyiapan lokal.

Semua pelajaran dalam kursus ini

  1. Arsitektur SFU vs. MCU
  2. Penyeimbangan Beban Server Pensinyalan
  3. Layanan STUN/TURN Terdistribusi
  4. SFU Berantai untuk Skala Geografis
← Kembali ke Real-Time Streaming Systems (WebRTC + Live Data)