TRTCStreamEncoderParam class

The encoding parameters

Constructors

TRTCStreamEncoderParam({int videoEncodedWidth = 0, int videoEncodedHeight = 0, int videoEncodedFPS = 0, int videoEncodedGOP = 0, int videoEncodedKbps = 0, int audioEncodedSampleRate = 0, int audioEncodedChannelNum = 0, int audioEncodedKbps = 0, int audioEncodedCodecType = 0, int videoEncodedCodecType = 0, String videoSeiParams = ""})

Properties

audioEncodedChannelNum int
  • Description: The sound channels of the stream to publish.
  • Value: Valid values: 1 (mono channel); 2 (dual-channel). Default: 1.
  • getter/setter pair
    audioEncodedCodecType int
  • Description: The audio codec of the stream to publish.
  • Value: Valid values: 0 (LC-AAC); 1 (HE-AAC); 2 (HE-AACv2). Default: 0.
  • Note:
    • The audio sample rates supported by HE-AAC and HE-AACv2 are 48000, 44100, 32000, 24000, and 16000.
    • When HE-AACv2 is used, the output stream can only be dual-channel.
  • getter/setter pair
    audioEncodedKbps int
  • Description: The audio bitrate (Kbps) of the stream to publish.
  • Value: Value range: 32,192. Default: 50.
  • getter/setter pair
    audioEncodedSampleRate int
  • Description: The audio sample rate of the stream to publish.
  • Value: Valid values: 48000, 44100, 32000, 24000, 16000, 8000. Default: 48000 (Hz).
  • getter/setter pair
    hashCode int
    The hash code for this object.
    no setterinherited
    runtimeType Type
    A representation of the runtime type of the object.
    no setterinherited
    videoEncodedCodecType int
  • Description: The video codec of the stream to publish.
  • Value: Valid values: 0 (H264); 1 (H265). Default: 0.
  • getter/setter pair
    videoEncodedFPS int
  • Description: The frame rate (fps) of the stream to publish.
  • Value: Value range: (0,30]. Default: 20.
  • getter/setter pair
    videoEncodedGOP int
  • Description: The keyframe interval (GOP) of the stream to publish.
  • Value: Value range: 1,5. Default: 3 (seconds).
  • getter/setter pair
    videoEncodedHeight int
  • Description: The resolution (height) of the stream to publish.
  • Value: Recommended value: 640. If you mix only audio streams, to avoid displaying a black video in the transcoded stream, set both width and height to 0.
  • getter/setter pair
    videoEncodedKbps int
  • Description: The video bitrate (Kbps) of the stream to publish.
  • Value: If you set this parameter to 0, TRTC will work out a bitrate based on videoWidth and videoHeight. For details, refer to the recommended bitrates for the constants of the resolution enum type (see comment).
  • getter/setter pair
    videoEncodedWidth int
  • Description: The resolution (width) of the stream to publish.
  • Value: Recommended value: 368. If you mix only audio streams, to avoid displaying a black video in the transcoded stream, set both width and height to 0.
  • getter/setter pair
    videoSeiParams String
  • Description: SEI parameters. Default: null.
  • Note: The parameter is passed in the form of a JSON string. Here is an example to use it:
  • getter/setter pair

    Methods

    noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    toString() String
    A string representation of this object.
    inherited

    Operators

    operator ==(Object other) bool
    The equality operator.
    inherited