preferredCodec parameter in p2p and videoQuality sections of config.js?

Hi guys,

I have enabled VP9 on the bridge using Jonathan’s PR and latest unstable packages on Debian Buster and it seems to be working fine.

However I also want to enable VP9 for p2p, not just bridge.

When I set preferredCodec: ‘VP9’, (inside the p2p: section in config.js - I already have it set as the preferredCodec inside the videoQuality: section) I get the dreaded grey screen error since it doesn’t seem to like the config.

Is having VP9 in bridge mutually exclusive with having it enabled for p2p also?

Right now I have set preferredCodec: ‘VP9’ in the videoQuality: section but in p2p calls it’s still serving up VP8. If I try to set preferredCodec: ‘VP9’ in the p2p section too it doesn’t load the config.

Am I missing something?

Maybe you had a syntax error? What do you see in the JS console logs?

Thanks @saghul

In the console logs I have

Uncaught ReferenceError: config is not defined
at Object. (AuthHandler.js:20)
at Object. (app.bundle.min.js?v=139:148)
at n (bootstrap:19)
at Object. (connection.js:1)
at Object. (app.bundle.min.js?v=139:159)
at n (bootstrap:19)
at Object. (conference.js:1)
at Object. (app.bundle.min.js?v=139:189)
at n (bootstrap:19)
at Module. (app.bundle.min.js?v=139:308)
at n (bootstrap:19)
at bootstrap:83
at app.bundle.min.js?v=139:1

Working config (notice that preferredCodec is commented out):

p2p: {
// Enables peer to peer mode. When enabled the system will try to
// establish a direct connection when there are exactly 2 participants
// in the room. If that succeeds the conference will stop sending data
// through the JVB and use the peer to peer connection instead. When a
// 3rd participant joins the conference will be moved back to the JVB
// connection.
enabled: true,

    // The STUN servers that will be used in the peer to peer connections
    stunServers: [

        { urls: 'stun:turn.jitsi.domain:3478' },
        { urls: 'turn:turn.jitsi.domain:3478' },
        { urls: 'turns:turn.jitsi.domain:443' }
    ]

    // Sets the ICE transport policy for the p2p connection. At the time
    // of this writing the list of possible values are 'all' and 'relay',
    // but that is subject to change in the future. The enum is defined in
    // the WebRTC standard:
    // https://www.w3.org/TR/webrtc/#rtcicetransportpolicy-enum.
    // If not set, the effective value is 'all'.
    // iceTransportPolicy: 'all',

    // If set to true, it will prefer to use H.264 for P2P calls (if H.264
    // is supported). This setting is deprecated, use preferredCodec instead.
    // preferH264: true

    // Provides a way to set the video codec preference on the p2p connection. Acceptable
    // codec values are 'VP8', 'VP9' and 'H264'.
  //   preferredCodec: 'VP9',

    // If set to true, disable H.264 video codec by stripping it out of the
    // SDP. This setting is deprecated, use disabledCodec instead.
    // disableH264: false,

    // Provides a way to prevent a video codec from being negotiated on the p2p connection.
    // disabledCodec: '',

    // How long we're going to wait, before going back to P2P after the 3rd
    // participant has left the conference (to filter out page reload).
    // backToP2PDelay: 5
},

Non- working with the error message above (notice the only change is uncommenting preferredCodec):

p2p: {
// Enables peer to peer mode. When enabled the system will try to
// establish a direct connection when there are exactly 2 participants
// in the room. If that succeeds the conference will stop sending data
// through the JVB and use the peer to peer connection instead. When a
// 3rd participant joins the conference will be moved back to the JVB
// connection.
enabled: true,

    // The STUN servers that will be used in the peer to peer connections
    stunServers: [

        { urls: 'stun:turn.jitsi.domain:3478' },
        { urls: 'turn:turn.jitsi.domain:3478' },
        { urls: 'turns:turn.jitsi.domain:443' }
    ]

    // Sets the ICE transport policy for the p2p connection. At the time
    // of this writing the list of possible values are 'all' and 'relay',
    // but that is subject to change in the future. The enum is defined in
    // the WebRTC standard:
    // https://www.w3.org/TR/webrtc/#rtcicetransportpolicy-enum.
    // If not set, the effective value is 'all'.
    // iceTransportPolicy: 'all',

    // If set to true, it will prefer to use H.264 for P2P calls (if H.264
    // is supported). This setting is deprecated, use preferredCodec instead.
    // preferH264: true

    // Provides a way to set the video codec preference on the p2p connection. Acceptable
    // codec values are 'VP8', 'VP9' and 'H264'.
     preferredCodec: 'VP9',

    // If set to true, disable H.264 video codec by stripping it out of the
    // SDP. This setting is deprecated, use disabledCodec instead.
    // disableH264: false,

    // Provides a way to prevent a video codec from being negotiated on the p2p connection.
    // disabledCodec: '',

    // How long we're going to wait, before going back to P2P after the 3rd
    // participant has left the conference (to filter out page reload).
    // backToP2PDelay: 5
},

I don’t see any syntax error which is puzzling.

I think you need to add a comma after the stunservers list.

Nope. That didn’t change anything. Same config is not defined error.

As soon as I uncomment the preferredCodec parameter I get the error. Don’t know why as it seems the config syntaxs is ok and uncommenting one parameter shouldn’t break it.

If it helps, I have observed this issue too. Except I was trying to set

referredCodec: 'VP8',

Uncommenting this link stopped Jitsi working.

Thanks @GeorgeJitsi

It does help because it seems to confirm my suspicion that you cannot have preferredCodec set in videoQuality AND p2p sections.

Does anyone have them both set and working in their config?

this sounds like a syntax error in your config. And it makes sense, beause you don’t have a comma after the closing bracket, so you can not uncomment the preferredCodec key without yielding invalid JSON. There may be other issues in the config or bugs with the setting of course, but I am pretty sure that you need a comma after the ]. Perhaps you additionally need to remove the comma after the last key in the p2p object, which would be the preferredCodec in your case

1 Like

Thanks @plokta

I removed the comma after the preferred codec parameter and added it after the ] and it seems OK now.

Thanks!

You beat me to it padarcos !

I just did the same…

    stunServers: [

        { urls: 'stun:turn.jitsi.domain:3478' },
        { urls: 'turn:turn.jitsi.domain:3478' },
        { urls: 'turns:turn.jitsi.domain:443' }
    ],

Putting the comma after the ] allowed it to work for me too. I guess you need to separate parameters using commas, it does make sense. Before enabling “preferredCodec”, it was the only enabled parameter.

Interestingly it did not seem to make a difference if the there was a comma after ‘VP9’ or not, I think the proper syntax is not to have the comma, since it is the last parameter in the list.

     preferredCodec: 'VP9',
     preferredCodec: 'VP9'
1 Like