-
Notifications
You must be signed in to change notification settings - Fork 43
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
Local video black screen #6
Comments
In case of this problem, please check the camera format supported by the tester. The CameraEnumerationAndroid class under libjingle_peerconnection.jar provides an API to get the camera format, then compare the camera parameters you set, where the width and height are the same, and the frameRate is smaller than the system supports. Example: new NBMVideoFormat(640, 480, pixelform. RGB_888, 30); |
@YanXinDong 遇到相同问题,经查应该是华为 P9 、P10 等设备底层删除了已被弃用的 Camera API,使用新的 Camera2 API 导致,请问您是如何解决的? |
After testing HUAWEI P9、P8 , I got these device supports max frameRate is 15? So i set the FormatConfig like this: new NBMVideoFormat(640, 480, ImageFormat.NV21, 15); it works. May be it's not best way and if you have another way to solved this problem,PLS reply back. |
@realskyrin 有些华为手机帧数就是很小,我就是更改了那个帧数,我改成了0,也没发现有什么影响。 |
关闭自己的视频调用enableVideo 不好用呀 |
我是这么解决的,修改 MediaResourceManager 源码,调用 localVideoTrack.setEnabled(bool) eg:
```java
public void setLocalVideoEnabled(boolean enabled) {
this.isLocalMediaEnabled = enabled;
this.localVideoTrack.setEnabled(enabled);
}
```
|
还有本地是黑怎么解决 |
调用了关闭流本地自然就是黑的了 skyrin 邮箱:[email protected] 签名由 网易邮箱大师 定制 On 09/27/2018 09:49, pcj110 wrote: 还有本地是黑怎么解决 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
|
关闭流本地是那个方法呀,还有,我是视频时,是黑的,有时看不到自己,有时看不到对方,还有多人视频时,后进去的人,之前的人看不到他的是视频 |
关闭本地流: /**
* switch local video
*
* @param view
*/
public void toggleVideo(View view) {
// nbmWebRTCPeer.enableVideo(); 并不适用于此场景
// 解决方案:修改源码位于 MediaResourceManager 下,增加 localVideoTrack.setEnabled(bool);
if (nbmWebRTCPeer.isLocalMediaEnabled()) {
try {
nbmWebRTCPeer.enableLocalVideo(false);
} catch (Exception e) {
// e.printStackTrace();
Toast.makeText(this, "没有检测到可用摄像头", Toast.LENGTH_SHORT).show();
}
local_render.setBackgroundColor(getResources().getColor(R.color.black));
} else {
local_render.setBackgroundColor(getResources().getColor(R.color.full_trans));
try {
nbmWebRTCPeer.enableLocalVideo(true);
} catch (Exception e) {
Toast.makeText(this, "没有检测到可用摄像头", Toast.LENGTH_SHORT).show();
}
}
} 视频黑的: /**
* 生成对端offer
*
* @param peerId 对端id
* @param delay 延迟时间
*/
private void offerRemotePeer(String peerId, long delay) {
L.e("delay----->" + delay);
handler.postDelayed(() -> {
L.e("I'm " + userName + " LOCAL: Generating offer for peer " + peerId);
callState = CallState.WAITING_REMOTE_USER;
if (nbmWebRTCPeer != null)
nbmWebRTCPeer.generateOffer(peerId, false);
}, delay);
} |
我用到上面的方法后,第一次进去是好用,假如在退出后,在进入,已经在房间里的人就看不到后面的人了 |
先进的去的人看不见后进入的是一般情况下就是后者的offer没处理好,有人加入时onroomenotifycation会被调用,可以在这里获取后加入者的id等等信息并发送offer,你仔细看看官方文档 skyrin 邮箱:[email protected] 签名由 网易邮箱大师 定制 On 09/30/2018 15:02, pcj110 wrote: 我用到上面的方法后,第一次进去是好用,假如在退出后,在进入,已经在房间里的人就看不到后面的人了 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
|
你好,我还想咨询一下,在第一次进入时,先进去的人能看到后面的人,但退出后,再次进入,就看不到了,这个也执行了nbmWebRTCPeer.generateOffer(peerId, false); |
Excuse me, why is the local video on the HUAWEI mate9 mobile phone a black screen? Is it related to HUAWEI's own CPU decoding?
The text was updated successfully, but these errors were encountered: