The HParams service provides encoding parameters for video production in a media session using the Mediasoup library. It includes a default configuration for RTP encoding parameters designed for handling high-quality video streams.

import { HParams } from './path/to/h-params.service';

constructor(private hParamsService: HParams) {
console.log(this.hParamsService.hParams);
}
const hParams: HParamsType = {
encodings: [
{
rid: 'r8',
maxBitrate: 240000, // Max bitrate for this encoding (in bps)
scalabilityMode: 'L1T3', // Scalable video coding mode
scaleResolutionDownBy: 4.0, // Scale down the resolution by a factor of 4
},
{
rid: 'r9',
maxBitrate: 480000,
scalabilityMode: 'L1T3',
scaleResolutionDownBy: 2.0, // Scale down the resolution by a factor of 2
},
{
rid: 'r10',
maxBitrate: 960000,
scalabilityMode: 'L1T3',
},
],
codecOptions: {
videoGoogleStartBitrate: 320, // Initial bitrate for the Google codec
},
};

The default hParams includes three encoding configurations with different resolutions and bitrates. The configurations are optimized for scalable video encoding, allowing for adaptive bitrate streaming based on network conditions.

The video parameters for use in video producer configuration.

Constructors

Properties

Constructors

Properties

hParams: HParamsType = ...