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

Huawei honor 8 (Kirin 950) H.264 only Group Call #467

Closed
7 of 8 tasks
artit91 opened this issue Nov 30, 2018 · 8 comments
Closed
7 of 8 tasks

Huawei honor 8 (Kirin 950) H.264 only Group Call #467

artit91 opened this issue Nov 30, 2018 · 8 comments

Comments

@artit91
Copy link

artit91 commented Nov 30, 2018

  • I have verified that the issue occurs with the latest twilio-video.js release and is not marked as a known issue in the CHANGELOG.md.
  • I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • I verified that the Quickstart application works in my environment.
  • I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

Code to reproduce the issue:

Expected behavior:

Connect to the room and show video because the device supports h.264.
I have seen it working with another library.

Actual behavior:

TwilioError: No supported codec
The room is audio only.

  • Browser(s): Chrome 70
  • Operating System: Android (Nougat)
  • twilio-video.js: latest
  • Third-party libraries (e.g., Angular, React, etc.): vue.js
@manjeshbhargav
Copy link
Collaborator

Hi @artit91 ,

Thanks for writing in with your issue. We will take a look and get back to you.

Thanks,

Manjesh Malavalli
JSDK Team

@manjeshbhargav
Copy link
Collaborator

Hi @artit91 ,

Our internal logs show that Chrome on Android did not detect that the phone supports H.264. This discussion may provide some context as to why certain H264 hardware decoders are not recognized by Chrome on Android.

Please let me know if this helps.

Thanks,

Manjesh Malavalli
JSDK Team

@artit91
Copy link
Author

artit91 commented Nov 30, 2018

It's weird because it works with:

https://github.com/webrtc/apprtc/tree/master/src/web_app

if I override the codec using this code:

window.forceH264forSDP = function(sdp) {
    var h264regex = /^a=rtpmap:(\d+) H264\/(?:\d+)/mg
      , h264match = h264regex.exec(sdp)
      , h264ids = [];
    while (null != h264match) {
        h264ids.push(h264match[1]);
        h264match = h264regex.exec(sdp)
    }
    var myregexp = /(m=video 9 UDP\/TLS\/RTP\/SAVPF )(\d+(?: \d+)+)/;
    sdp = sdp.replace(myregexp, function(match, p1, p2) {
        var i, others = p2.split(" ");
        for (i = 0; i < h264ids.length; i++) {
            others = others.filter(function(e) {
                return e !== h264ids[i]
            })
        }
        return p1 + h264ids.join(" ") + " " + others.join(" ")
    });
    return sdp
}
sessionDescription.sdp = forceH264forSDP(sessionDescription.sdp, this.params_);
sessionDescription.sdp = sessionDescription.sdp.replace("42001f", "42e01f");

I don't have the required knowledge to figure out what it's doing but it just works...

@artit91
Copy link
Author

artit91 commented Dec 1, 2018

So if you replace the profile-level-id 42001f with 42e01f it will force baseline profile for those devices who forgot to set the flag required. They have a bug possibly in OS level.

“e0” is required for the baseline profile and it’s missing in the device I’m talking about.

I understand, you have maybe better things to do, could you tell me which file should I modify to get the desired result, please? I need it to be fixed SAP.

@manjeshbhargav
Copy link
Collaborator

Hi @artit91 ,

It looks like you're maintaining your own fork of twilio-video.js. So, in lib/signaling/v2/peerconnection.js, you add your transformation in the return statement in PeerConnectionV2._offer():

_offer() {
  ...
  return this._setLocalDescription({
    type: 'offer',
    sdp: forceH264forSDP(updatedSdp)
  });
}

Please let me know if this works for you.

Manjesh Malavalli
JSDK Team

@artit91
Copy link
Author

artit91 commented Dec 1, 2018

Already done that :) I can only test tomorrow on a real device.

Thank you.

@artit91
Copy link
Author

artit91 commented Dec 1, 2018

@artit91
Copy link
Author

artit91 commented Dec 1, 2018

Apparently a vast amount Huawei phones are affected. (tested on P9)

chrome bug:

https://bugs.chromium.org/p/chromium/issues/detail?id=862087

Overriding 42001f to 42e01f solves the problem in the apprtc demo not in twilio-video.js.
https://github.com/webrtc/apprtc
(Because 42001f is a subset of 42e01f.)

It's a possible workaround till they get it fixed.

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

2 participants