feat(plugin-meetings): add AV1 codec support and related constants#4816
feat(plugin-meetings): add AV1 codec support and related constants#4816fnowakow wants to merge 27 commits intowebex:nextfrom
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e93a35bb71
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -0,0 +1,58 @@ | |||
| export const AV1_CODEC_PARAMETERS = { | |||
There was a problem hiding this comment.
Does the AV1EncodingParams type from @webex/internal-media-core still expect a profile field? If so, this could be a type error or silent omission downstream. Worth confirming against the 2.23.3 type definitions.
There was a problem hiding this comment.
It does not at 2.23.3
export type AV1EncodingParams = BaseVideoEncodingParams & {
levelIdx?: number;
tier?: number;
maxPicSize?: number;
maxDecodeRate?: number;
};| } | ||
|
|
||
| describe('getIngressPayloadTypeCallback', () => { | ||
| beforeEach(() => { |
There was a problem hiding this comment.
Either i'm not seeing, or we dont have it yet. Would be great to have unit tests verifying degradation functionality for AV1 and H264. Would be great to assert there specific values, which we expect. It makes reasoning about the changes simpler
There was a problem hiding this comment.
There are tests for:
re-sends media requests after degradation preferences are set
should not degrade max-fs if receive slot sources are not live
can degrade max-fs once when request exceeds max macroblocks limit
can degrade max-fs multiple times when request exceeds max macroblocks limit
can degrade only the largest max-fs when request exceeds max macroblocks limit
does trimming first and applies degradationPreferences after that
I've added separate tests for checking if degradation also affect av1
… media connections
…payload type handling
…r multistream media requests
…update related references
9ba67e4 to
0571d52
Compare
|
@codex do the code review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b0e493fb7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| maxWidth: 1920, | ||
| maxHeight: 1080, | ||
| maxPicSize: 2_073_600, | ||
| maxDecodeRate: 70_778_880, |
There was a problem hiding this comment.
maxDecodeRate per AV1 spec for level Idx 8 is 77,856,768.
https://aomediacodec.github.io/av1-spec/#levels
There was a problem hiding this comment.
I fixed all the values
- for maxPicSize -> calculations of maxWidth * maxHeight so it's more visible what this value represents
- for maxDecodeRate - updated all values because when creating this I copied values from
MaxDisplayRateby mistake
| tier: 0, | ||
| maxWidth: 160, | ||
| maxHeight: 90, | ||
| maxPicSize: 15_360, |
There was a problem hiding this comment.
maxPicSze should be 14_400 -> 160 × 90.
Current 15_360 is 160x96
COMPLETES SPARK-797573
This pull request addresses
Multistream meetings currently only support H.264 codec for video slides. This PR adds AV1 codec support for video slides in multistream media connections, enabling better compression efficiency and quality at lower bitrates when the AV1 codec is available and negotiated.
by making the following changes
New AV1 codec constants: Added
codec/constants.tswith resolution-based AV1 encoding parameters (90p through 1080p) includinglevelIdx,tier,maxWidth,maxHeight,maxPicSize, andmaxDecodeRate. Extracted H264 codec defaults into the same constants file.Dynamic ingress payload type resolution: Introduced a
getIngressPayloadTypeCallbackthat queries the activewebrtcMediaConnectionfor the correct payload type per codec/media type at runtime, replacing the previously hardcoded0x80H264 payload type.AV1 codec info in media requests: Extended
MediaRequestManagerto build and include AV1WcmeCodecInfoentries alongside H264 whenenableAv1is set. AV1 encoding parameters are resolved from the requested frame size by mapping to the appropriate resolution bucket.Configuration and API surface: Added
enableAv1SlidesSupportconfig flag (defaultfalse), wired it throughMedia.createMediaConnectioninto the multistream connection config, and added_toggleEnableAv1SlidesSupport()on theMeetingsclass to toggle it before joining.Degradation support: AV1 codec parameters degrade in lockstep with H264 when the macroblock limit is exceeded, ensuring consistent quality reduction across codecs.
Test coverage: Comprehensive unit tests for AV1 resolution mapping, codec info generation, degradation behavior with AV1 enabled, payload type callback integration, and the new toggle API.
Change Type
The following scenarios were tested
enableAv1isfalse(default behavior unchanged)undefined)_toggleEnableAv1SlidesSupportcorrectly updates config and rejects non-boolean valuesenableAV1SlidesSupportflag is passed through toMultistreamConnectionConfigThe GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.