Skip to main content
Version: 3.x.x

Custom Video Track - Flutter

  • You can create a Video Track using createCameraVideoTrack() method of VideoSDK class.
  • This method can be used to create video track using different encoding parameters, camera facing mode, and optimization mode.

Parameters

  • cameraId:

    • type: String
    • required: false
    • It will be the id of the camera from which the video should be captured.
  • encoderConfig:

    • type: CustomTrackVideoConfig

    • required: false

    • default: h720p_w1280p

    • The video resolutions listed below are common encoder configuration options supported across All Platforms.

Encoder ConfigResolutionFrame RateOptimized (kbps)Balanced (kbps)High Quality (kbps)
h144p_w192p192x14415 fps60100150
h240p_w320p320x24015 fps120200350
h480p_w640p640x48025 fps300500750
h720p_w960p960x72030 fps80012001600
h1080p_w1440p1440x108030 fps160022002700
h360p_w640p640x36020 fps200400600
h720p_w1280p1280x72030 fps100015002000
h1080p_w1440p1280x72030 fps160023002700
  • The video resolutions listed below are additional encoder configuration options available specifically for Web applications.
Encoder ConfigResolutionFrame RateOptimized (kbps)Balanced (kbps)High Quality (kbps)
h120p_w160p160x12015 fps60100150
h180p_w240p240x18015 fps100150250
h360p_w480p480x36020 fps200400600
h540p_w720p720×54030 fps350650800
h1440p_w1920p1920×144030 fps350040004500
h180p_w320p320x18015 fps100150250
h216p_w384p384x21615 fps120200350
h540p_w960p960x54025 fps400600800
h1440p_w2560p2560x144030 fps500055006000
h2160p_w3840p3840x216030 fps800085009000
important

The below encoder configurations can also be used in mobile applications (Android and iOS). However, the actual video resolution may differ from the requested value due to device and hardware limitations. To obtain the exact resolution being used, refer to the supported video tracks available on the mobile application.

note

Above mentioned encoder configurations are valid for both, landscape as well as portrait mode.

  • facingMode:

    • type: FacingMode
    • required: false
    • Allowed values : FacingMode.front | FacingMode.environment
    • It will specify whether to use front or back camera for the video track.
  • multiStream

    • type: boolean
    • required: false
    • default: true
    • It will specify if the stream should send multiple resolution layers or single resolution layer.
caution

MultiStream functionality is not supported in the Firefox browser. VideoSDK will only send one stream for Firefox browsers.

info
  • To learn more about optimizations and best practices for using custom video tracks, follow this guide.
  • This parameter is only available from v1.0.9.

Returns

  • Future<CustomTrack?>

Example

CustomTrack? videoTrack = await VideoSDK.createCameraVideoTrack(
encoderConfig: CustomVideoTrackConfig.h720p_w960p,
multiStream: true,
facingMode:"user",
birtrateMode: BitrateMode.HIGH_QUALITY,
maxLayers: 2,
);

Custom Audio Track - Flutter

  • You can create a Audio Track using createMicrophoneAudioTrack() method of VideoSDK class.
  • This method can be used to create audio track using different encoding parameters and noise cancellation configuration.

Parameters

  • microphoneId:

    • type: String
    • required: false
    • It will be the id of the mic from which the audio should be captured.
  • encoderConfig:

    • type: CustomTrackAudioConfig
    • required: false
    • default: speech_standard
    • You can choose from the below mentioned list of values for the encoder config.
Encoder ConfigBitrateAuto GainEcho CancellationNoise Suppression
speech_low_quality16 kbpsTRUETRUETRUE
speech_standard24 kbpsTRUETRUETRUE
music_standard32 kbpsFALSEFALSEFALSE
standard_stereo64 kbpsFALSEFALSEFALSE
high_quality128 kbpsFALSEFALSEFALSE
high_quality_stereo192 kbpsFALSEFALSEFALSE
  • noiseConfig

    • echoCancellation

      • type: boolean
      • required: false
      • If true echo cancellation will turned on else it would be turned off.
    • autoGainControl

      • type: boolean
      • required: false
      • If true auto gain will turned on else it would be turned off.
    • noiseSuppression

      • type: boolean
      • required: false
      • If true noise suppression will turned on else it would be turned off.

Returns

  • Future<CustomTrack?>

Example

CustomTrack? audioTrack = await VideoSDK.createMicrophoneAudioTrack(
encoderConfig: CustomAudioTrackConfig.high_quality);

Got a Question? Ask us on discord