ethand91 / mediasoup-ios-client

Mediasoup 3 iOS Client
ISC License
130 stars 64 forks source link

WebRTC with h264 enabled doesn't work #106

Closed abllogra closed 2 years ago

abllogra commented 3 years ago

Hello.

I have created a demo app using mediasoup-ios-client.

I have compiled a WebRTC with hardware encoding / decoding h264 and I have compiled the Mediasoup library with this WebRTC but it is not working.

I check the codecs that WebRTC supports from my app:

let defaultRTC = RTCDefaultVideoDecoderFactory()
let defaultEncodeRTC = RTCDefaultVideoEncoderFactory()

for codec in defaultRTC.supportedCodecs() {
   print(codec.name)
   print(codec.parameters)
}

for codec in defaultEncodeRTC.supportedCodecs() {
   print(codec.name)
   print(codec.parameters)
}

LOGS

H264
["profile-level-id": "640c33", "level-asymmetry-allowed": "1", "packetization-mode": "1"]
H264
["profile-level-id": "42e033", "level-asymmetry-allowed": "1", "packetization-mode": "1"]
VP8
VP9

I get the capabilities from our server and it supports h264 but when I pass them to Mediasoup it doesn’t load h264.

I have consulted the offer created by Mediasoup from the library and it doesn’t include h264.

How could I get Mediasoup to work with WebRTC and h264 codec from iOS? Is it possible you have to do something in Mediasoup client or WebRTC to enable encoding / decoding h264 in iOS?

ethand91 commented 2 years ago

You have to enable H264 when building the WebRTC library.

https://chromium.googlesource.com/external/webrtc/+/fb11424551dae924869ae54059cb1612836cb6f7/webrtc/build/webrtc.gni

yuancfan commented 2 years ago

how to building the WebRTC library? please. or can y upload the lib support h264?