Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageyml
themeRDark
profiles:
 
 -webrtc-144:
  audio:
    type : AudioStreamProfile
    codec : opus
    rate : 48000
    channels : 2
  #this part forces transcoding
  video:
    type : VideoStreamProfile
    width : 256
    height : 144
    codecImpl : OPENH264

...

typeProfile type
ParameterValues availableDescription
Audio parameters
typeAudioStreamProfileProfile type
codec

opus

mpeg4-generic

speex

Audio codec usedto use
bitrateDepends on quality required and bandwith availableAudio bitrate
rate

8000

11025

12000

16000

22050

24000

32000

44100

48000

Audio sample rate, kHz
channels

1

2

Channels quantity: mono or stereo
Параметры видеоVideo parameters
codecVideoStreamProfile

h264

vp8

Video codec to use
bitrateDepends on quality required and bandwith availableVideo bitrate
widthDepends on quality required and bandwith availablePicture width
heightDepends on quality required and bandwith availablePicture height
codeImpl

FF

OPENH264

Video codec used: based on FFmpeg or OpenH.264
gopDepends on quality required and bandwith availableKey frames frequency (GOP)
fpsDepends on quality required and bandwith availableFrames frequency per second
qualityDepends on quality required and bandwith availableVideo quality

When stream is transcoded on Edge server

...

Code Block
languageyml
themeRDark
 -opus-vp8:
  audio:
    type : AudioStreamProfile
    codec : opus
    rate : 48000
    channels : 2
  video:
    type : VideoStreamProfile
    width : 320
    height : 240
    gop : 60
    fps : 30
    codec : vp8
    codecImpl : FF

...

REST query

REST query body example

REST response example

Response states

Description

/cdn/stream/show_routes

Code Block
languagejs
themeRDark
{
 "streamName":"test-webrtc-144"
}
Code Block
languagejs
themeRDark
{
    "1REQUESTED-PROFILE-192.168.1.220": ": [
        "AudioStreamProfileAUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VideoStreamProfileVIDEO{width=0256, height=0144, gop=null, fps=null, bitrate=0, codec='H264h264', codecImpl='nullOPENH264', quality=null}"
    ],
    "1-PROFILE-192.168.1.220": [
        "VideoStreamProfileAUDIO{widthbitrate=3200, heightcodec=180, 'opus', rate=48000, channels=2}",
        "VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='FFnull', quality=null}",
        "VideoStreamProfileVIDEO{width=256320, height=144180, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='OPENH264FF', quality=null}"
],
    "2-STREAM-192.168.1.220": [
        "AudioStreamProfile{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VideoStreamProfile{width=0"VIDEO{width=256, height=0144, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='OPENH264', quality=null}",
    ],
    "VideoStreamProfile{width=320, height=180, gop=null, fps=null, 2-STREAM-192.168.1.220": [
        "AUDIO{bitrate=0, codec='H264opus', codecImplrate='FF'48000, qualitychannels=null2}",
        "VideoStreamProfileVIDEO{width=2560, height=1440, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='OPENH264', quality=null}",
    ],
    "3-NEW-TRANSCODER-192.168.1.220": [],
    "4-PROXY-192.168.1.219": [
        "AudioStreamProfile{VIDEO{width=320, height=180, gop=null, fps=null, bitrate=0, codec='opusH264', ratecodecImpl=48000'FF', channelsquality=2null}",
        "VideoStreamProfileVIDEO{width=0256, height=0144, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='OPENH264', quality=null}"
    ]
}

200 – OK

500 – Internal Server Error

Show CDN stream routes

Parameters

2-STREAM220AudioStreamProfile{bitrate=0, codec='VideoStreamProfile320180FFAudioStreamProfile

Description

Example

Stream name (including transcoding profile if necessary)

test-webrtc-144
Transcoder stream parameters
Transcoding profiles used by Transcoder parameters1-PROFILE
,
    "3-NEW-TRANSCODER-192.168.1.220
Stream pulled from Origin by Transcoder parameters
": [],
    "4-PROXY-192.168.1.
Audio parameters
219": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}
Video parameters (according to transcoding profiles used)
",
        "VIDEO{width=
0, height=
0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='
', quality=null}
Stream parameters that Transcoder can pull from Origin
3-NEW-TRANSCODER-192.168.1.220
Origin stream parameters
Stream published to Origin parameters
4-PROXY-192.168.1.219
Audio parameters
"
    ]
}

200 – OK

500 – Internal Server Error

Show CDN stream routes

Parameters

Description

Example

Stream name (including transcoding profile if necessary)

test-webrtc-144
Transcoding profile requested parameters
Profile requested parameters
REQUESTED-PROFILE
Audio parameters
AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}
Video parameters
VideoStreamProfileVIDEO{width=0256, height=0144, gop=null, fps=null, bitrate=0, codec='H264h264', codecImpl='OPENH264', quality=null}
Transcoder stream parameters
Transcoding profiles used by Transcoder parameters
1-PROFILE-192.168.1.220
Stream pulled from Origin by Transcoder parameters
2-STREAM-192.168.1.220
Audio parameters
AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}
Video parameters (according to transcoding profiles used)
VIDEO{width=320, height=180, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='FF', quality=null}
Stream parameters that Transcoder can pull from Origin
3-NEW-TRANSCODER-192.168.1.220
Origin stream parameters
Stream published to Origin parameters
4-PROXY-192.168.1.219
Audio parameters
AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}
Video parameters
VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='', quality=null}

CDN routes checking examples

Let's look how to check some CDN routes build for stream playback.

For example we use three nodes CDN:

  • 192.168.1.219 - Origin
  • 192.168.1.220 - Transcoder
  • 192.168.1.221 - Edge

WebRTC H264+opus (48 kHz, stereo) stream named test is published to Origin

Stream pulling from Origin without transcoding if publishing and playback profiles are equal

Stream named test is played on Edge by profile

Code Block
languageyml
themeRDark
 -webrtc-opus-video-proxy:
  audio:
    codec : opus
    rate : 48000
    channels : 2
  video:
    codec: h264

The response to this query

Code Block
languagejs
themeRDark
http://192.168.1.221:8081/rest-api/cdn/stream/show_routes
{
    "streamName": "test-webrtc-opus-video-proxy"
}

should be interpreted as follows:

1. Profile requested parameters:

Code Block
languagejs
themeRDark
    "REQUESTED-PROFILE": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='h264', codecImpl='null', quality=null}"
    ],

2. Stream is pulled from Origin:

Code Block
languagejs
themeRDark
    "1-PROXY-PROFILE-192.168.1.219": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='', quality=null}"
    ],

3. Stream can be pulled from Transcoder

Code Block
languagejs
themeRDark
    "2-NEW-TRANSCODER-192.168.1.220": [],

4. But is pulled from Origin because stream publishing parameters are equal to requested playback parameters:

Code Block
languagejs
themeRDark
    "3-PROXY-192.168.1.219": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='', quality=null}"
    ]

Stream pulling from Transcoder with audio transcoding

Stream named test is played on Edge by profile

Code Block
languageyml
themeRDark
 -webrtc-pcma-video-proxy:
  audio:
    codec : pcma
    rate : 8000
    channels : 1

The response to this query

Code Block
languagejs
themeRDark
http://192.168.1.221:8081/rest-api/cdn/stream/show_routes
{
    "streamName": "test-webrtc-pcma-video-proxy"
}

should be interpreted as follows:

1. Profile requested parameters:

Code Block
languagejs
themeRDark
    "REQUESTED-PROFILE": [
        "AUDIO{bitrate=0, codec='pcma', rate=8000, channels=1}"
    ],

2. Transcoding profile is created on Transcoder:

Code Block
languagejs
themeRDark
    "1-PROFILE-192.168.1.220": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='null', quality=null}",
        "AUDIO{bitrate=0, codec='PCMA', rate=8000, channels=1}"
    ],

3. Stream is pulled from Transcoder

Code Block
languagejs
themeRDark
    "2-STREAM-192.168.1.220": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='null', quality=null}",
        "AUDIO{bitrate=0, codec='PCMA', rate=8000, channels=1}"
    ],
    "3-NEW-TRANSCODER-192.168.1.220": [],

4. Stream publishing to Origin parameters:

Code Block
languagejs
themeRDark
    "3-PROXY-192.168.1.219": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='', quality=null}"
    ]

Stream pulling from Transcoder with video transcoding

Stream named test is played on Edge by profile

Code Block
languageyml
themeRDark
 -opus-vp8:
  audio:
    codec : opus
    rate : 48000
    channels : 2
  video:
    width : 320
    height : 240
    gop : 60
    fps : 30
    codec : vp8
    codecImpl : FF

The response to this query

Code Block
languagejs
themeRDark
http://192.168.1.221:8081/rest-api/cdn/stream/show_routes
{
    "streamName": "test-webrtc-opus-vp8"
}

should be interpreted as follows:

1. Profile requested parameters:


Code Block
languagejs
themeRDark
    "REQUESTED-PROFILE": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VIDEO{width=320, height=240, gop=60, fps=30, bitrate=0, codec='vp8', codecImpl='FF', quality=null}"
    ],

2. Transcoding profile is created on Transcoder:

Code Block
languagejs
themeRDark
    "1-PROFILE-192.168.1.220": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='', quality=null}",
        "VIDEO{width=320, height=240, gop=60, fps=30, bitrate=0, codec='VP8', codecImpl='FF', quality=null}"
    ],

3. Stream is pulled from Transcoder

Code Block
languagejs
themeRDark
    "2-STREAM-192.168.1.220": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='', quality=null}",
        "VIDEO{width=320, height=240, gop=60, fps=30, bitrate=0, codec='VP8', codecImpl='FF', quality=null}"
    ],
    "3-NEW-TRANSCODER-192.168.1.220": [],

4. Stream publishing to Origin parameters:

Code Block
languagejs
themeRDark
    "3-PROXY-192.168.1.219": [
        "AUDIO{bitrate=0, codec='opus', rate=48000, channels=2}",
        "VIDEO{width=0, height=0, gop=null, fps=null, bitrate=0, codec='H264', codecImpl='', quality=null}"
    ]

CDN nodes authentication

Nodes trying to connect to CDN can be authenticated by IP address. Node addresses allowed to connect to CDN should be set in the following parameter

Code Block
themeRDark
cdn_allowed_ips=192.168.1.39, 192.168.100.64, 192.168.101.65

This parameter can also set address masks, for example

Code Block
themeRDark
cdn_allowed_ips=192.168.1.39, 192.168.100.0/24

Every CDN node with this setting will only accept CDN connections from nodes whose addresses match those listed, either exactly or by mask. All other CDN connections will be rejected.

Backward compatibility with CDN 2.0

CDN 2.1 backward compatibility with CDN 2.0 is supported in the following cases:

1. Edge 2.0 can pull streams from Origin 2.1

2. Edge 2.1 can pull streams from Origin 2.0

In these cases transcoding works according to codecs and SDP setup as defined for CDN 2.0.

Known limits

1. It is strongly not recommended to publish streams with same name to two Origin servers in the same CDN.

2. A stream published to one of Origin servers should be played on the same Origin server or any Edge server (through Transcoder server if necessary), but should not be played from another Origin server in the same CDN.