Custom Video Track - Android
- You can create a Video Track using
createCameraVideoTrack()method ofVideoSDK. - 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.
- type:
| Config | Resolution | Frame Rate | Optimized (kbps) | Balanced (kbps) | High Quality (kbps) |
|---|---|---|---|---|---|
| h144p_w176p | 176x144 | 15 fps | 60 | 100 | 150 |
| h240p_w320p | 320x240 | 15 fps | 80 | 150 | 300 |
| h360p_w640p | 360x640 | 25 fps | 200 | 400 | 800 |
| h480p_w640p | 640x480 | 25 fps | 300 | 600 | 1000 |
| h480p_w720p | 720x480 | 30 fps | 400 | 700 | 1100 |
| h720p_w960p | 960x720 | 30 fps | 800 | 1300 | 1800 |
| h720p_w1280p | 1280x720 | 30 fps | 1000 | 1600 | 2400 |
| h1080p_w1440p | 1440x1080 | 30 fps | 2000 | 2500 | 3500 |
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.
- type:
-
optimizationMode
- type:
CustomStreamTrack.VideoMode - required:
true - Allowed values:
motion|text|detail - It will specify the optimization mode for the video track being generated.
- type:
-
multiStream:
- type:
boolean - required:
true - It will specify if the stream should send multiple resolution layers or single resolution layer.
- type:
-
context:
- type:
Context - required:
true - Pass the Android Context for this parameter.
- type:
-
observer:
- type:
CapturerObserver - required:
false - If you want to use video filter from external SDK(e.g., Banuba) then pass instance of
CapturerObserverin this parameter.
- type:
-
videoDeviceInfo:
- type:
VideoDeviceInfo - required:
false - If you want to specify a camera device to be used in the meeting.
- type:
-
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_QUALITYfor the best picture,BitrateMode.BANDWIDTH_OPTIMIZEDto save data, orBitrateMode.BALANCEDfor a mix of both. Defaults toBitrateMode.BALANCED.
- type:
-
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
multiStreamis set to true.
- type:
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
- Kotlin
- Java
val videoCustomTrack: CustomStreamTrack = VideoSDK.createCameraVideoTrack("h720p_w960p", "front", CustomStreamTrack.VideoMode.MOTION, true, this, 3, BitrateMode.BALANCED)
CustomStreamTrack 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 ofVideoSDK. - 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.
- type:
| Encoder Config | Bitrate | Auto Gain | Echo Cancellation | Noise Suppression |
|---|---|---|---|---|
| speech_low_quality | 16 kbps | TRUE | TRUE | TRUE |
| speech_standard | 24 kbps | TRUE | TRUE | TRUE |
| music_standard | 32 kbps | FALSE | FALSE | FALSE |
| standard_stereo | 64 kbps | FALSE | FALSE | FALSE |
| high_quality | 128 kbps | FALSE | FALSE | FALSE |
| high_quality_stereo | 192 kbps | FALSE | FALSE | FALSE |
-
context
- type:
Context - required:
true - Pass the Android Context for this parameter.
- type:
Returns
CustomStreamTrack
Example
- Kotlin
- Java
val audioCustomTrack: CustomStreamTrack = VideoSDK.createAudioTrack("speech_standard",this)
CustomStreamTrack audioCustomTrack=VideoSDK.createAudioTrack("speech_standard", this);
Custom Screen Share Track - Android
- You can create a Screen Share track using
createScreenShareVideoTrack()method ofVideoSDK. - 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.
- type:
| Encoder Config | Resolution | Frame Rate | Bitrate |
|---|---|---|---|
| h360p_30fps | 640x360 | 3 fps | 200000 kbps |
| h720p_5fps | 1280x720 | 5 fps | 400000 kbps |
| h720p_15fps | 1280x720 | 15 fps | 1000000 kbps |
| h1080p_15fps | 1920x1080 | 15 fps | 1500000 kbps |
| h1080p_30fps | 1920x1080 | 15 fps | 1000000 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.
- type:
-
context
- type:
Context - required:
true - Pass the Android Context for this parameter.
- type:
-
listener
- type:
CustomTrackListener - required:
true - Callback to this listener will be made when track is ready with CustomTrack as parameter.
- type:
Example
- Kotlin
- Java
// data is received from onActivityResult method.
VideoSDK.createScreenShareVideoTrack("h720p_15fps", data, this) { track ->
meeting!!.enableScreenShare(track)
}
// data is received from onActivityResult method.
VideoSDK.createScreenShareVideoTrack("h720p_15fps", data, this, (track)->{
meeting.enableScreenShare(track);
});
Got a Question? Ask us on discord

