How to enable VP8 on iOS WebRTC?

1.7k Views Asked by At

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

1

There are 1 best solutions below

1
Tomas Jablonskis On

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()
)