Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H264 simulcast not working on ios #3

Open
papaz0rgl opened this issue Dec 15, 2022 · 4 comments
Open

H264 simulcast not working on ios #3

papaz0rgl opened this issue Dec 15, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@papaz0rgl
Copy link

Hello, many thanks for you library which is very well done. Integration into my project has been really smooth. I have one issue with H264 simulcast. I try to produce 2 videos layers :
let lowEncoding = RTCRtpEncodingParameters()
lowEncoding.maxBitrateBps = 256_000
lowEncoding.scaleResolutionDownBy = 1

        let highEncoding = RTCRtpEncodingParameters()
        highEncoding.maxBitrateBps = 5_000_000
        highEncoding.scaleResolutionDownBy = 1

It works well with VP8 but with H264 it only produces one stream at 5M. Furthermore the resolution is quite low and doesn't delivers full hd.

What am I missing ? is there some specific configuration to be done for h264 ?

Thanks for your help.

@fedulvtubudul fedulvtubudul added the help wanted Extra attention is needed label Feb 9, 2023
@papaz0rgl
Copy link
Author

I made a little progress since posting this. I 'm now able to stream full hd in h264 (but still no simulcast, only one resolution). The issue came from the version of webrtc which has a mechanism to compute the supported h264 profile for each iphone model but as the model datase is quite old it defaults to a really low profile hence no hd. Changing this solve the hd issue.

@fedulvtubudul
Copy link
Collaborator

fedulvtubudul commented Aug 16, 2023

For me simulcast on the h264 "just works". But I have similar problem. In case I select VP8 (a non-default) over h264 (default, listed on the first place in router capabilities) it works only without simulcast. If I create additional video layers, other clients do not receive any data and see no video. As I use only one layer, outgoing video works with VP8. But now I don't have time to dive deeper into this problem.

So maybe the root is not in codec itself but in some other differences.

@papaz0rgl
Copy link
Author

Hello, I did some tests by changing the default codec from vp8 to h264. I always have the same behaviour ie vp8 simulcast working and only one layer in h264.
I also tried with different resolutions, asking for 3 layers instead of 2 etc. I always get the same result, 1 layer in h264 and all the layers I ask for in vp8

@fedulvtubudul
Copy link
Collaborator

@papaz0rgl could you share parameters that you pass when creating your video track producer? For the VP8 I've succeeded with simulcast after setting frame rate to the same value for all layers. Here are parameters that I use now and they work for both codecs:

[
  {
    "width": 180,
    "height": 320,
    "scalabilityMode": "S1T3",
    "dtx": false,
    "rid": "r0",
    "maxBitrate": 150000,
    "active": true,
    "maxFramerate": 12,
    "scaleResolutionDownBy": 4,
    "networkPriority": 1
  },
  {
    "width": 360,
    "height": 640,
    "maxFramerate": 12,
    "maxBitrate": 200000,
    "scalabilityMode": "S1T3",
    "active": true,
    "networkPriority": 1,
    "dtx": false,
    "rid": "r1",
    "scaleResolutionDownBy": 2
  },
  {
    "width": 720,
    "height": 1280,
    "maxFramerate": 12,
    "maxBitrate": 700000,
    "networkPriority": 1,
    "scalabilityMode": "S1T3",
    "rid": "r2",
    "active": true,
    "dtx": false,
    "scaleResolutionDownBy": 1
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants