Skip to main content
Version: 0.x.x

Custom Video Track - Android

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

Parameters

  • encoderConfig:

    • type: String
    • required: true
    • default: h480p_w720p
    • You can chose from the below mentioned list of values for the encoder config.
ConfigResolutionFrame RateOptimized (kbps)Balanced (kbps)High Quality (kbps)
h144p_w176p176x14415 fps60100150
h240p_w320p320x24015 fps80150300
h360p_w640p360x64025 fps200400800
h480p_w640p640x48025 fps3006001000
h480p_w720p720x48030 fps4007001100
h720p_w960p960x72030 fps80013001800
h720p_w1280p1280x72030 fps100016002400
h1080p_w1440p1440x108030 fps200025003500
note

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

  • facingMode:

    • type: String
    • required: true
    • Allowed values : front | back
    • It will specify wheater to use front or back camera for the video track.
  • optimizationMode

    • type: CustomStreamTrack.VideoMode
    • required: true
    • Allowed values: motion | text | detail
    • It will specify the optimization mode for the video track being generated.
  • multiStream:

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

    • type: Context
    • required: true
    • Pass the Android Context for this parameter.
  • observer:

    • type: CapturerObserver
    • required: false
    • If you want to use video filter from external SDK(e.g., Banuba) then pass instance of CapturerObserver in this parameter.
  • videoDeviceInfo:

    • type: VideoDeviceInfo
    • required: false
    • If you want to specify a camera device to be used in the meeting.
  • bitrateMode:

    • type: BitrateMode
    • required: false
    • Allowed values : BitrateMode.BANDWIDTH_OPTIMIZED | BitrateMode.BALANCED | BitrateMode.HIGH_QUALITY
    • Controls the video quality and bandwidth consumption. You can choose between BitrateMode.HIGH_QUALITY for the best picture, BitrateMode.BANDWIDTH_OPTIMIZED to save data, or BitrateMode.BALANCED for a mix of both. Defaults to BitrateMode.BALANCED.
  • maxLayer:

    • type: Integer
    • required: false
    • Allowed values : 2 | 3
    • Specifies the maximum number of simulcast layers to publish. This parameter only has an effect if multiStream is set to true.
note

For Banuba integraion with VideoSDK, please visit Banuba Intergation with VideoSDK

info
  • To learn more about optimizations and best practices for using custom video tracks, follow this guide.

Returns

  • CustomStreamTrack

Example

val videoCustomTrack: CustomStreamTrack = VideoSDK.createCameraVideoTrack("h720p_w960p", "front", CustomStreamTrack.VideoMode.MOTION, true, this, 3, BitrateMode.BALANCED)

Custom Audio Track - Android

  • You can create a Audio Track using createAudioTrack() method of VideoSDK.
  • This method can be used to create audio track using different encoding parameters.

Parameters

  • encoderConfig:

    • type: String
    • required: true
    • default: speech_standard
    • You can chose 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
  • context

    • type: Context
    • required: true
    • Pass the Android Context for this parameter.

Returns

  • CustomStreamTrack

Example

val audioCustomTrack: CustomStreamTrack = VideoSDK.createAudioTrack("speech_standard",this)

Custom Screen Share Track - Android

  • You can create a Screen Share track using createScreenShareVideoTrack() method of VideoSDK.
  • This method can be used to create screen share track using different encoding parameters.

Parameters

  • encoderConfig:

    • type: String
    • required: true
    • default: h720p_15fps
    • You can chose from the below mentioned list of values for the encoder config.
Encoder ConfigResolutionFrame RateBitrate
h360p_30fps640x3603 fps200000 kbps
h720p_5fps1280x7205 fps400000 kbps
h720p_15fps1280x72015 fps1000000 kbps
h1080p_15fps1920x108015 fps1500000 kbps
h1080p_30fps1920x108015 fps1000000 kbps
note

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

  • data

    • type: Intent
    • required: true
    • It is Intent received from onActivityResult when user provide permission for ScreenShare.
  • context

    • type: Context
    • required: true
    • Pass the Android Context for this parameter.
  • listener

    • type: CustomTrackListener
    • required: true
    • Callback to this listener will be made when track is ready with CustomTrack as parameter.

Example

// data is received from onActivityResult method.
VideoSDK.createScreenShareVideoTrack("h720p_15fps", data, this) { track ->
meeting!!.enableScreenShare(track)
}

Got a Question? Ask us on discord