3

How to enable VP8 on iOS WebRTC? I have build webrtc on ios and I can see libvpx in webrtc source code for ios. However I do not know how to enable it.

PeerConnection to createOffer only has h264 and there was no VP8 description in SDP.

Thank you for helping

Jim
  • 338
  • 1
  • 14

1 Answers1

4

You have to set preferedCodec for RTCDefaultVideoEncoderFactory:

let encoderFactory = RTCDefaultVideoEncoderFactory()

// Set video codec to VP8
encoderFactory.preferredCodec = RTCVideoCodecInfo(name: kRTCVideoCodecVp8Name)

let factory = RTCPeerConnectionFactory(
    encoderFactory: encoderFactory,
    decoderFactory: RTCDefaultVideoDecoderFactory()
)
Tomas Jablonskis
  • 4,246
  • 4
  • 22
  • 40