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

prefer_codecs is not working well... #7

Open
neilyoung opened this issue Nov 21, 2021 · 3 comments
Open

prefer_codecs is not working well... #7

neilyoung opened this issue Nov 21, 2021 · 3 comments

Comments

@neilyoung
Copy link

...if the m= line contains multiple codecs of the same kind. In this case the last is found by convertToCodecDefinition, which is especially w.r.t. H.264 not always the best choice.

Ex.

m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 121 127 120 125 107 108 109 35 36 124 119 123 118 114 115 116

The only VP8 codec here is 96, hence it will be found if VP8 is perferred.

But - 102, 127, 125, 108, 124, 123 are all H.264 codecs, with very different profile-level-ids and modes. In this case not the first one is chosen, but the last one in the m list, which is 123, which is a very uncommon H.264 format. Even though it is advertised by chrome like so, the video connection cannot be established, if 123 is favoured.

a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032

@neilyoung
Copy link
Author

A possible fix would be to alter the convertToCodecDefinition function:

if (!r[codec.toUpperCase()])
  r[codec.toUpperCase()] = {
    num: typeNum,
    codec: codec
  }

This would always keep the FIRST appearance of the codec, not the LAST

@neilyoung
Copy link
Author

Updated my PR

@neilyoung
Copy link
Author

Well, it is not a good style to abuse a PR for a completely unrelated project for stalking, just out of curiosity: Why would you like to know my eMail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant