Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateCLIFlags(existingFlags []cli.Flag, hidden bool) ([]cli.Flag, error)
- func InitLoggerFromConfig(config *LoggingConfig)
- func SetLogger(l logger.Logger)
- type APIConfig
- type AudioConfig
- type CodecSpec
- type Config
- type CongestionControlChannelObserverConfig
- type CongestionControlConfig
- type CongestionControlProbeConfig
- type CongestionControlProbeMode
- type ForwardStatsConfig
- type IngressConfig
- type LimitConfig
- type LoggingConfig
- type NodeSelectorConfig
- type PLIThrottleConfig
- type PlayoutDelayConfig
- type RTCConfig
- type RegionConfig
- type RoomConfig
- type SIPConfig
- type SignalRelayConfig
- type StreamTrackerConfig
- type StreamTrackerFrameConfig
- type StreamTrackerPacketConfig
- type StreamTrackerType
- type StreamTrackersConfig
- type TURNConfig
- type TURNServer
- type VideoConfig
- type WebHookConfig
Constants ¶
View Source
const ( CongestionControlProbeModePadding CongestionControlProbeMode = "padding" CongestionControlProbeModeMedia CongestionControlProbeMode = "media" StreamTrackerTypePacket StreamTrackerType = "packet" StreamTrackerTypeFrame StreamTrackerType = "frame" StatsUpdateInterval = time.Second * 10 TelemetryStatsUpdateInterval = time.Second * 30 TelemetryNonMediaStatsUpdateInterval = time.Minute * 5 )
Variables ¶
View Source
var ( ErrKeyFileIncorrectPermission = errors.New("key file others permissions must be set to 0") ErrKeysNotSet = errors.New("one of key-file or keys must be provided") )
View Source
var DefaultConfig = Config{ Port: 7880, RTC: RTCConfig{ RTCConfig: rtcconfig.RTCConfig{ UseExternalIP: false, TCPPort: 7881, ICEPortRangeStart: 0, ICEPortRangeEnd: 0, STUNServers: []string{}, }, PacketBufferSize: 500, PacketBufferSizeVideo: 500, PacketBufferSizeAudio: 200, StrictACKs: true, PLIThrottle: PLIThrottleConfig{ LowQuality: 500 * time.Millisecond, MidQuality: time.Second, HighQuality: time.Second, }, CongestionControl: CongestionControlConfig{ Enabled: true, AllowPause: false, NackRatioAttenuator: 0.4, ExpectedUsageThreshold: 0.95, ProbeMode: CongestionControlProbeModePadding, ProbeConfig: CongestionControlProbeConfig{ BaseInterval: 3 * time.Second, BackoffFactor: 1.5, MaxInterval: 2 * time.Minute, SettleWait: 250 * time.Millisecond, SettleWaitMax: 10 * time.Second, TrendWait: 2 * time.Second, OveragePct: 120, MinBps: 200_000, MinDuration: 200 * time.Millisecond, MaxDuration: 20 * time.Second, DurationOverflowFactor: 1.25, DurationIncreaseFactor: 1.5, }, ChannelObserverProbeConfig: CongestionControlChannelObserverConfig{ EstimateRequiredSamples: 3, EstimateRequiredSamplesMin: 3, EstimateDownwardTrendThreshold: 0.0, EstimateDownwardTrendMaxWait: 5 * time.Second, EstimateCollapseThreshold: 0, EstimateValidityWindow: 10 * time.Second, NackWindowMinDuration: 500 * time.Millisecond, NackWindowMaxDuration: 1 * time.Second, NackRatioThreshold: 0.04, }, ChannelObserverNonProbeConfig: CongestionControlChannelObserverConfig{ EstimateRequiredSamples: 12, EstimateRequiredSamplesMin: 8, EstimateDownwardTrendThreshold: -0.6, EstimateDownwardTrendMaxWait: 5 * time.Second, EstimateCollapseThreshold: 500 * time.Millisecond, EstimateValidityWindow: 10 * time.Second, NackWindowMinDuration: 2 * time.Second, NackWindowMaxDuration: 3 * time.Second, NackRatioThreshold: 0.08, }, }, }, Audio: AudioConfig{ ActiveLevel: 35, MinPercentile: 40, UpdateInterval: 400, SmoothIntervals: 2, }, Video: VideoConfig{ DynacastPauseDelay: 5 * time.Second, StreamTracker: StreamTrackersConfig{ Video: StreamTrackerConfig{ StreamTrackerType: StreamTrackerTypePacket, BitrateReportInterval: map[int32]time.Duration{ 0: 1 * time.Second, 1: 1 * time.Second, 2: 1 * time.Second, }, PacketTracker: map[int32]StreamTrackerPacketConfig{ 0: { SamplesRequired: 1, CyclesRequired: 4, CycleDuration: 500 * time.Millisecond, }, 1: { SamplesRequired: 5, CyclesRequired: 20, CycleDuration: 500 * time.Millisecond, }, 2: { SamplesRequired: 5, CyclesRequired: 20, CycleDuration: 500 * time.Millisecond, }, }, FrameTracker: map[int32]StreamTrackerFrameConfig{ 0: { MinFPS: 5.0, }, 1: { MinFPS: 5.0, }, 2: { MinFPS: 5.0, }, }, }, Screenshare: StreamTrackerConfig{ StreamTrackerType: StreamTrackerTypePacket, BitrateReportInterval: map[int32]time.Duration{ 0: 4 * time.Second, 1: 4 * time.Second, 2: 4 * time.Second, }, PacketTracker: map[int32]StreamTrackerPacketConfig{ 0: { SamplesRequired: 1, CyclesRequired: 1, CycleDuration: 2 * time.Second, }, 1: { SamplesRequired: 1, CyclesRequired: 1, CycleDuration: 2 * time.Second, }, 2: { SamplesRequired: 1, CyclesRequired: 1, CycleDuration: 2 * time.Second, }, }, FrameTracker: map[int32]StreamTrackerFrameConfig{ 0: { MinFPS: 0.5, }, 1: { MinFPS: 0.5, }, 2: { MinFPS: 0.5, }, }, }, }, }, Redis: redisLiveKit.RedisConfig{}, Room: RoomConfig{ AutoCreate: true, EnabledCodecs: []CodecSpec{ {Mime: webrtc.MimeTypeOpus}, {Mime: "audio/red"}, {Mime: webrtc.MimeTypeVP8}, {Mime: webrtc.MimeTypeH264}, {Mime: webrtc.MimeTypeVP9}, {Mime: webrtc.MimeTypeAV1}, }, EmptyTimeout: 5 * 60, DepartureTimeout: 20, MaxRoomNameLength: 256, MaxParticipantIdentityLength: 256, }, Logging: LoggingConfig{ PionLevel: "error", }, TURN: TURNConfig{ Enabled: false, }, NodeSelector: NodeSelectorConfig{ Kind: "any", SortBy: "random", SysloadLimit: 0.9, CPULoadLimit: 0.9, }, SignalRelay: SignalRelayConfig{ RetryTimeout: 7500 * time.Millisecond, MinRetryInterval: 500 * time.Millisecond, MaxRetryInterval: 4 * time.Second, StreamBufferSize: 1000, }, PSRPC: rpc.DefaultPSRPCConfig, Keys: map[string]string{}, }
Functions ¶
func GenerateCLIFlags ¶ added in v1.3.0
func InitLoggerFromConfig ¶ added in v1.4.2
func InitLoggerFromConfig(config *LoggingConfig)
Types ¶
type APIConfig ¶ added in v1.3.2
type APIConfig struct {
// amount of time to wait for API to execute, default 2s
ExecutionTimeout time.Duration `yaml:"execution_timeout,omitempty"`
// min amount of time to wait before checking for operation complete
CheckInterval time.Duration `yaml:"check_interval,omitempty"`
// max amount of time to wait before checking for operation complete
MaxCheckInterval time.Duration `yaml:"max_check_interval,omitempty"`
}
func DefaultAPIConfig ¶ added in v1.3.2
func DefaultAPIConfig() APIConfig
type AudioConfig ¶
type AudioConfig struct {
// minimum level to be considered active, 0-127, where 0 is loudest
ActiveLevel uint8 `yaml:"active_level,omitempty"`
// percentile to measure, a participant is considered active if it has exceeded the ActiveLevel more than
// MinPercentile% of the time
MinPercentile uint8 `yaml:"min_percentile,omitempty"`
// interval to update clients, in ms
UpdateInterval uint32 `yaml:"update_interval,omitempty"`
// smoothing for audioLevel values sent to the client.
// audioLevel will be an average of `smooth_intervals`, 0 to disable
SmoothIntervals uint32 `yaml:"smooth_intervals,omitempty"`
// enable red encoding downtrack for opus only audio up track
ActiveREDEncoding bool `yaml:"active_red_encoding,omitempty"`
// enable proxying weakest subscriber loss to publisher in RTCP Receiver Report
EnableLossProxying bool `yaml:"enable_loss_proxying,omitempty"`
}
type Config ¶
type Config struct {
Port uint32 `yaml:"port,omitempty"`
BindAddresses []string `yaml:"bind_addresses,omitempty"`
PrometheusPort uint32 `yaml:"prometheus_port,omitempty"`
RTC RTCConfig `yaml:"rtc,omitempty"`
Redis redisLiveKit.RedisConfig `yaml:"redis,omitempty"`
Audio AudioConfig `yaml:"audio,omitempty"`
Video VideoConfig `yaml:"video,omitempty"`
Room RoomConfig `yaml:"room,omitempty"`
TURN TURNConfig `yaml:"turn,omitempty"`
Ingress IngressConfig `yaml:"ingress,omitempty"`
SIP SIPConfig `yaml:"sip,omitempty"`
WebHook WebHookConfig `yaml:"webhook,omitempty"`
NodeSelector NodeSelectorConfig `yaml:"node_selector,omitempty"`
KeyFile string `yaml:"key_file,omitempty"`
Keys map[string]string `yaml:"keys,omitempty"`
Region string `yaml:"region,omitempty"`
SignalRelay SignalRelayConfig `yaml:"signal_relay,omitempty"`
PSRPC rpc.PSRPCConfig `yaml:"psrpc,omitempty"`
// Deprecated: LogLevel is deprecated
LogLevel string `yaml:"log_level,omitempty"`
Logging LoggingConfig `yaml:"logging,omitempty"`
Limit LimitConfig `yaml:"limit,omitempty"`
Development bool `yaml:"development,omitempty"`
}
func (*Config) IsTURNSEnabled ¶ added in v1.2.1
func (*Config) ToCLIFlagNames ¶ added in v1.3.0
func (*Config) ValidateKeys ¶ added in v1.3.2
type CongestionControlChannelObserverConfig ¶ added in v1.4.5
type CongestionControlChannelObserverConfig struct {
EstimateRequiredSamples int `yaml:"estimate_required_samples,omitempty"`
EstimateRequiredSamplesMin int `yaml:"estimate_required_samples_min,omitempty"`
EstimateDownwardTrendThreshold float64 `yaml:"estimate_downward_trend_threshold,omitempty"`
EstimateDownwardTrendMaxWait time.Duration `yaml:"estimate_downward_trend_max_wait,omitempty"`
EstimateCollapseThreshold time.Duration `yaml:"estimate_collapse_threshold,omitempty"`
EstimateValidityWindow time.Duration `yaml:"estimate_validity_window,omitempty"`
NackWindowMinDuration time.Duration `yaml:"nack_window_min_duration,omitempty"`
NackWindowMaxDuration time.Duration `yaml:"nack_window_max_duration,omitempty"`
NackRatioThreshold float64 `yaml:"nack_ratio_threshold,omitempty"`
}
type CongestionControlConfig ¶ added in v0.15.2
type CongestionControlConfig struct {
Enabled bool `yaml:"enabled,omitempty"`
AllowPause bool `yaml:"allow_pause,omitempty"`
NackRatioAttenuator float64 `yaml:"nack_ratio_attenuator,omitempty"`
ExpectedUsageThreshold float64 `yaml:"expected_usage_threshold,omitempty"`
UseSendSideBWE bool `yaml:"send_side_bandwidth_estimation,omitempty"`
ProbeMode CongestionControlProbeMode `yaml:"probe_mode,omitempty"`
MinChannelCapacity int64 `yaml:"min_channel_capacity,omitempty"`
ProbeConfig CongestionControlProbeConfig `yaml:"probe_config,omitempty"`
ChannelObserverProbeConfig CongestionControlChannelObserverConfig `yaml:"channel_observer_probe_config,omitempty"`
ChannelObserverNonProbeConfig CongestionControlChannelObserverConfig `yaml:"channel_observer_non_probe_config,omitempty"`
DisableEstimationUnmanagedTracks bool `yaml:"disable_etimation_unmanaged_tracks,omitempty"`
}
type CongestionControlProbeConfig ¶ added in v1.4.4
type CongestionControlProbeConfig struct {
BaseInterval time.Duration `yaml:"base_interval,omitempty"`
BackoffFactor float64 `yaml:"backoff_factor,omitempty"`
MaxInterval time.Duration `yaml:"max_interval,omitempty"`
SettleWait time.Duration `yaml:"settle_wait,omitempty"`
SettleWaitMax time.Duration `yaml:"settle_wait_max,omitempty"`
TrendWait time.Duration `yaml:"trend_wait,omitempty"`
OveragePct int64 `yaml:"overage_pct,omitempty"`
MinBps int64 `yaml:"min_bps,omitempty"`
MinDuration time.Duration `yaml:"min_duration,omitempty"`
MaxDuration time.Duration `yaml:"max_duration,omitempty"`
DurationOverflowFactor float64 `yaml:"duration_overflow_factor,omitempty"`
DurationIncreaseFactor float64 `yaml:"duration_increase_factor,omitempty"`
}
type CongestionControlProbeMode ¶ added in v0.15.5
type CongestionControlProbeMode string
type ForwardStatsConfig ¶ added in v1.6.2
type IngressConfig ¶ added in v1.2.0
type LimitConfig ¶ added in v0.15.0
type LoggingConfig ¶ added in v0.15.3
type NodeSelectorConfig ¶ added in v0.12.3
type NodeSelectorConfig struct {
Kind string `yaml:"kind,omitempty"`
SortBy string `yaml:"sort_by,omitempty"`
CPULoadLimit float32 `yaml:"cpu_load_limit,omitempty"`
SysloadLimit float32 `yaml:"sysload_limit,omitempty"`
Regions []RegionConfig `yaml:"regions,omitempty"`
}
type PLIThrottleConfig ¶ added in v0.9.14
type PlayoutDelayConfig ¶ added in v1.4.5
type RTCConfig ¶
type RTCConfig struct {
rtcconfig.RTCConfig `yaml:",inline"`
TURNServers []TURNServer `yaml:"turn_servers,omitempty"`
StrictACKs bool `yaml:"strict_acks,omitempty"`
// Deprecated: use PacketBufferSizeVideo and PacketBufferSizeAudio
PacketBufferSize int `yaml:"packet_buffer_size,omitempty"`
// Number of packets to buffer for NACK - video
PacketBufferSizeVideo int `yaml:"packet_buffer_size_video,omitempty"`
// Number of packets to buffer for NACK - audio
PacketBufferSizeAudio int `yaml:"packet_buffer_size_audio,omitempty"`
// Throttle periods for pli/fir rtcp packets
PLIThrottle PLIThrottleConfig `yaml:"pli_throttle,omitempty"`
CongestionControl CongestionControlConfig `yaml:"congestion_control,omitempty"`
// allow TCP and TURN/TLS fallback
AllowTCPFallback *bool `yaml:"allow_tcp_fallback,omitempty"`
// force a reconnect on a publication error
ReconnectOnPublicationError *bool `yaml:"reconnect_on_publication_error,omitempty"`
// force a reconnect on a subscription error
ReconnectOnSubscriptionError *bool `yaml:"reconnect_on_subscription_error,omitempty"`
// force a reconnect on a data channel error
ReconnectOnDataChannelError *bool `yaml:"reconnect_on_data_channel_error,omitempty"`
// max number of bytes to buffer for data channel. 0 means unlimited
DataChannelMaxBufferedAmount uint64 `yaml:"data_channel_max_buffered_amount,omitempty"`
ForwardStats ForwardStatsConfig `yaml:"forward_stats,omitempty"`
}
type RegionConfig ¶ added in v0.13.5
type RegionConfig struct {
Name string `yaml:"name,omitempty"`
Lat float64 `yaml:"lat,omitempty"`
Lon float64 `yaml:"lon,omitempty"`
}
RegionConfig lists available regions and their latitude/longitude, so the selector would prefer regions that are closer
type RoomConfig ¶ added in v0.10.1
type RoomConfig struct {
// enable rooms to be automatically created
AutoCreate bool `yaml:"auto_create,omitempty"`
EnabledCodecs []CodecSpec `yaml:"enabled_codecs,omitempty"`
MaxParticipants uint32 `yaml:"max_participants,omitempty"`
EmptyTimeout uint32 `yaml:"empty_timeout,omitempty"`
DepartureTimeout uint32 `yaml:"departure_timeout,omitempty"`
EnableRemoteUnmute bool `yaml:"enable_remote_unmute,omitempty"`
MaxMetadataSize uint32 `yaml:"max_metadata_size,omitempty"`
PlayoutDelay PlayoutDelayConfig `yaml:"playout_delay,omitempty"`
SyncStreams bool `yaml:"sync_streams,omitempty"`
MaxRoomNameLength int `yaml:"max_room_name_length,omitempty"`
MaxParticipantIdentityLength int `yaml:"max_participant_identity_length,omitempty"`
}
type SignalRelayConfig ¶ added in v1.4.0
type StreamTrackerConfig ¶ added in v1.3.3
type StreamTrackerConfig struct {
StreamTrackerType StreamTrackerType `yaml:"stream_tracker_type,omitempty"`
BitrateReportInterval map[int32]time.Duration `yaml:"bitrate_report_interval,omitempty"`
PacketTracker map[int32]StreamTrackerPacketConfig `yaml:"packet_tracker,omitempty"`
FrameTracker map[int32]StreamTrackerFrameConfig `yaml:"frame_tracker,omitempty"`
}
type StreamTrackerFrameConfig ¶ added in v1.3.3
type StreamTrackerFrameConfig struct {
MinFPS float64 `yaml:"min_fps,omitempty"`
}
type StreamTrackerPacketConfig ¶ added in v1.3.3
type StreamTrackerType ¶ added in v1.3.3
type StreamTrackerType string
type StreamTrackersConfig ¶ added in v1.3.3
type StreamTrackersConfig struct {
Video StreamTrackerConfig `yaml:"video,omitempty"`
}
type TURNConfig ¶
type TURNConfig struct {
Enabled bool `yaml:"enabled,omitempty"`
Domain string `yaml:"domain,omitempty"`
CertFile string `yaml:"cert_file,omitempty"`
KeyFile string `yaml:"key_file,omitempty"`
TLSPort int `yaml:"tls_port,omitempty"`
UDPPort int `yaml:"udp_port,omitempty"`
RelayPortRangeStart uint16 `yaml:"relay_range_start,omitempty"`
RelayPortRangeEnd uint16 `yaml:"relay_range_end,omitempty"`
ExternalTLS bool `yaml:"external_tls,omitempty"`
}
type TURNServer ¶ added in v0.15.4
type VideoConfig ¶ added in v0.15.6
type VideoConfig struct {
DynacastPauseDelay time.Duration `yaml:"dynacast_pause_delay,omitempty"`
StreamTracker StreamTrackersConfig `yaml:"stream_tracker,omitempty"`
}
type WebHookConfig ¶ added in v0.12.1
Click to show internal directories.
Click to hide internal directories.