Custom Video Track - Flutter
- You can create a Video Track using
createCameraVideoTrack()method ofVideoSDKclass. - 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.
- type:
-
encoderConfig:
-
type:
CustomTrackVideoConfig -
required:
false -
default:
h720p_w1280p -
The video resolutions listed below are
common encoderconfiguration options supported acrossAll Platforms.
-
| Encoder Config | Resolution | Frame Rate | Optimized (kbps) | Balanced (kbps) | High Quality (kbps) |
|---|---|---|---|---|---|
| h144p_w192p | 192x144 | 15 fps | 60 | 100 | 150 |
| h240p_w320p | 320x240 | 15 fps | 120 | 200 | 350 |
| h480p_w640p | 640x480 | 25 fps | 300 | 500 | 750 |
| h720p_w960p | 960x720 | 30 fps | 800 | 1200 | 1600 |
| h1080p_w1440p | 1440x1080 | 30 fps | 1600 | 2200 | 2700 |
| h360p_w640p | 640x360 | 20 fps | 200 | 400 | 600 |
| h720p_w1280p | 1280x720 | 30 fps | 1000 | 1500 | 2000 |
| h1080p_w1440p | 1280x720 | 30 fps | 1600 | 2300 | 2700 |
- The video resolutions listed below are additional encoder configuration options available specifically for
Web applications.
| Encoder Config | Resolution | Frame Rate | Optimized (kbps) | Balanced (kbps) | High Quality (kbps) |
|---|---|---|---|---|---|
| h120p_w160p | 160x120 | 15 fps | 60 | 100 | 150 |
| h180p_w240p | 240x180 | 15 fps | 100 | 150 | 250 |
| h360p_w480p | 480x360 | 20 fps | 200 | 400 | 600 |
| h540p_w720p | 720×540 | 30 fps | 350 | 650 | 800 |
| h1440p_w1920p | 1920×1440 | 30 fps | 3500 | 4000 | 4500 |
| h180p_w320p | 320x180 | 15 fps | 100 | 150 | 250 |
| h216p_w384p | 384x216 | 15 fps | 120 | 200 | 350 |
| h540p_w960p | 960x540 | 25 fps | 400 | 600 | 800 |
| h1440p_w2560p | 2560x1440 | 30 fps | 5000 | 5500 | 6000 |
| h2160p_w3840p | 3840x2160 | 30 fps | 8000 | 8500 | 9000 |
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.
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.
- type:
-
multiStream
- type:
boolean - required:
false - default:
true - It will specify if the stream should send multiple resolution layers or single resolution layer.
- type:
MultiStream functionality is not supported in the Firefox browser. VideoSDK will only send one stream for Firefox browsers.
- 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 ofVideoSDKclass. - 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.
- type:
-
encoderConfig:
- type:
CustomTrackAudioConfig - required:
false - default:
speech_standard - You can choose 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 |
-
noiseConfig
-
echoCancellation
- type:
boolean - required:
false - If
trueecho cancellation will turned on else it would be turned off.
- type:
-
autoGainControl
- type:
boolean - required:
false - If
trueauto gain will turned on else it would be turned off.
- type:
-
noiseSuppression
- type:
boolean - required:
false - If
truenoise suppression will turned on else it would be turned off.
- type:
-
Returns
Future<CustomTrack?>
Example
CustomTrack? audioTrack = await VideoSDK.createMicrophoneAudioTrack(
encoderConfig: CustomAudioTrackConfig.high_quality);
Got a Question? Ask us on discord

