-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1556 from AgoraIO/endoc-279-Doc-update
Sync with cn docs
- Loading branch information
Showing
12 changed files
with
141 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 23 additions & 22 deletions
45
...nhance-call-quality/configure-video-encoding/project-implementation/android.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
|
||
<PlatformWrapper platform="android"> | ||
|
||
Use the `setVideoEncoderConfiguration` method to configure video encoding parameters. | ||
You can call this method at any point after initialization, whether it's before or after joining a channel. For optimal performance, best practice is to enable the video module by calling `enableVideo` before calling `setVideoEncoderConfiguration`. This approach reduces the time required for the first frame to be generated. | ||
Use the `setVideoEncoderConfiguration` method to configure video encoding parameters. You can call this method before `enableVideo` to speed up the time for the first frame to appear. Alternatively, you can call this method within the channel to flexibly adjust video encoding properties. | ||
|
||
To set video encoder configuration, refer to the following code: | ||
|
||
```java | ||
// Set the resolution, frame rate, bitrate, and screen orientation mode for video encoding | ||
VideoEncoderConfiguration.VideoDimensions value = VD_640x360; | ||
try { | ||
// Retrieve the selected value from the interface to set the video dimensions | ||
Field tmp = VideoEncoderConfiguration.class.getDeclaredField(dimension.getSelectedItem().toString()); | ||
tmp.setAccessible(true); | ||
value = (VideoEncoderConfiguration.VideoDimensions) tmp.get(null); | ||
} catch (NoSuchFieldException e) { | ||
Log.e("Field", "Can not find field " + dimension.getSelectedItem().toString()); | ||
} catch (IllegalAccessException e) { | ||
Log.e("Field", "Could not access field " + dimension.getSelectedItem().toString()); | ||
} | ||
|
||
// Apply the configured video encoder settings | ||
engine.setVideoEncoderConfiguration(new VideoEncoderConfiguration( | ||
value, | ||
VideoEncoderConfiguration.FRAME_RATE.valueOf(framerate.getSelectedItem().toString()), | ||
Integer.valueOf(et_bitrate.getText().toString()), | ||
VideoEncoderConfiguration.ORIENTATION_MODE.valueOf(orientation.getSelectedItem().toString()) | ||
)); | ||
// Video encoding configuration | ||
this.engine?.setVideoEncoderConfiguration({ | ||
// Set video codec type to H264 | ||
codecType: VideoCodecType.VideoCodecH264, | ||
// Set video encoding resolution to 640 x 360 (px) | ||
dimensions: { | ||
width: 640, | ||
height: 360, | ||
}, | ||
// Set frame rate to 15 fps | ||
frameRate: 15, | ||
// Set bitrate mode to StandardBitrate | ||
bitrate: 0, | ||
// Set minimum encoding bitrate to 1 Kbps | ||
minBitrate: -1, | ||
// Set orientation mode to Adaptive | ||
orientationMode: OrientationMode.OrientationModeAdaptive, | ||
// Set degradation preference to MaintainQuality | ||
degradationPreference: DegradationPreference.MaintainQuality, | ||
// Disable mirror mode when sending encoded video | ||
mirrorMode: VideoMirrorModeType.VideoMirrorModeDisabled, | ||
}); | ||
``` | ||
</PlatformWrapper> |
18 changes: 9 additions & 9 deletions
18
...hance-call-quality/configure-video-encoding/project-implementation/electron.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 6 additions & 11 deletions
17
...nhance-call-quality/configure-video-encoding/project-implementation/flutter.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e-call-quality/configure-video-encoding/project-implementation/react-native.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 13 additions & 7 deletions
20
...enhance-call-quality/configure-video-encoding/project-implementation/unreal.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.