Skip to content

Error: "Invalid codec with name 'H264'" when using VP9 in Chrome 131.0 #215

@landcom

Description

@landcom

Hi, I'm using Chrome version 131.0, when setting the Preferred Codec to VP9, the following error appears in the console, and the screen sharing content is not displayed on other sharing ends. This issue can be reproduced in the online version of screego.

index-C_cVS6sr.js:214 Uncaught (in promise) InvalidModificationError: Failed to execute 'setCodecPreferences' on 'RTCRtpTransceiver': Invalid codec preferences: invalid codec with name "H264".
    at z4 (index-C_cVS6sr.js:214:13782)
    at w.onmessage (index-C_cVS6sr.js:214:15046)

Due to environment limitations, I have not upgraded my browser. However, I have tested this issue on other browser versions. The problem does not occur in Chrome version 120.0 or Edge version 134.0.

After researching the issue, I suspect it might be related to line 88 in ui/src/useRoom.ts:

RTCRtpSender.getCapabilities('video')?.codecs.forEach((codec) =>...

I modified it to:

RTCRtpReceiver.getCapabilities('video')?.codecs.forEach((codec) =>...

After this change, the error no longer appears, and the screen sharing functionality works as expected.

I am not very familiar with WebRTC, so I am not sure about the exact cause of this issue. There might be a better solution for this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions