Simulcast

Simulcast는 비디오를 다양한 화질로 송신하고, 네트워크 상황에 따라 적절한 화질을 선택하여 수신하는 기능입니다.

자세한 설명은 아래 WebRTC Glossary를 참고해주십시오.

지원범위

방송과 그룹통화만 simulcast를 지원합니다. 1:1 통화는 simulcast를 지원하지 않습니다. Simulcast는 비디오만 관여하고, 오디오는 관여하지 않습니다.

아래와 같이 코덱을 지원합니다. 권장하는 코덱은 VP8 입니다.

웹 브라우저는 최신 Chrome, Firefox를 지원합니다. WebRTC를 지원하는 여타 웹 브라우저에서 simulcast가 동작할 수 있습니다.

규격

송출 시 선택할 수 있는 해상도는 Capture resolution 컬럼의 값을 참고하십시오.

수신 시 선택되는 해상도는 송출 해상도와 layer 선택(HIGH, MEDIUM, LOW)에 따라 정해집니다. Layer 선택은 아래 "수신" 섹션에서 설명합니다.

Simulcast 내부에 대해 자세히 알고 싶으면, 아래 소스코드를 참고하시기 바랍니다.

struct SimulcastFormat {
  int width;
  int height;
  // The maximum number of simulcast layers can be used for
  // resolutions at |widthxheigh|.
  size_t max_layers;
  // The maximum bitrate for encoding stream at |widthxheight|, when we are
  // not sending the next higher spatial stream.
  int max_bitrate_kbps;
  // The target bitrate for encoding stream at |widthxheight|, when this layer
  // is not the highest layer (i.e., when we are sending another higher spatial
  // stream).
  int target_bitrate_kbps;
  // The minimum bitrate needed for encoding stream at |widthxheight|.
  int min_bitrate_kbps;
};
// These tables describe from which resolution we can use how many
// simulcast layers at what bitrates (maximum, target, and minimum).
// Important!! Keep this table from high resolution to low resolution.
// clang-format off
const SimulcastFormat kSimulcastFormats[] = {
  {1920, 1080, 3, 5000, 4000, 800},
  {1280, 720, 3,  2500, 2500, 600},
  {960, 540, 3, 900, 900, 450},
  {640, 360, 2, 700, 500, 150},
  {480, 270, 2, 450, 350, 150},
  {320, 180, 1, 200, 150, 30},
  {0, 0, 1, 200, 150, 30}
};

Chrome의 simulcast 구현

Firefox의 simulcast 구현

송출 (beta)

송출 시 아래와 같이 simulcast: true설정을 적용합니다.

const config = {
  rtc: {
    simulcast: true
  },
  media : {
    video : {
      width: 1280,
      height: 720
    }
  }
}

const remon = new Remon({ config })

Web SDK는 fps를 낮추어 정해진 대역폭에서 움직임을 떨어뜨리고 고화질의 이미지를 보여주거나 maxBandwidth를 낮추어 저화질의 이미지를 보여주는 등의 최적화를 시도할 수 있습니다. 이런 설정은 추가적인 인코더의 연산을 일으키므로 가급적 변경하지 않는 것이 좋습니다. 필요하다면 입력장치의 설정을 변경하는 것이 좋습니다. Android, iOS SDK는 fps, maxBandwidth 등 세부적인 조절은 불가능하며, 내부에 설정된 기준대로만 화질이 선택됩니다.

Simulcast를 적용한 송출은 모바일 기기의 CPU, 배터리 사용량을 다소 높이는 점에 유의하십시오.

수신 (beta)

수신 시 아래와 같이 Simulcast layer를 선택합니다. 선택지는 HIGH, MEDIUM, LOW입니다.

const remon = new Remon()

remon.setVideoQulity('HIGH')
remon.setVideoQulity('LOW')

SDK는 fps, 비디오 특성 등을 참고하여 자동으로 낮은 화질로 변경합니다. 자동으로 높은 화질로 변경하지는 않습니다. 높은 화질로 변경은 앱의 특성에 따라 개발사가 구현하시길 권합니다.

Last updated