Reputation: 377
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
Upvotes: 3
Views: 2155
Reputation: 4376
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()
)
Upvotes: 4