Kurento-utils WebRtcPeerSendrecv 是否关注所有选项?
Does Kurento-utils WebRtcPeerSendrecv pay attention to all options?
我正在使用 WebRtcPeerSendrecv 对象与 kurento 服务器建立与 WebRTC 端点的通信。我想要 select 此处制作的视频输入:https://webrtc.github.io/samples/src/content/devices/input-output/
我遇到的问题是添加 属性 video/deviceId 不起作用。
options = {
audio : false,
localVideo : videoInput,
remoteVideo : videoOutput,
video: {
deviceId: {exact: devcs[0]}
},
onicecandidate : onIceCandidate,
onerror : onError
}
唯一以其他方式制作的东西是我正在与 Kurento-utils 的 WebRtcPeerSendrecv 建立我的 WebRtc 连接,最初它是使用 navigator.getUserMedia(...) 制作的。
据我所知,WebRtcPeerSendrecv 正在调用 getUserMedia,但我不确定是否所有属性都被一对一复制。我在这里查看了 https://github.com/Kurento/kurento-utils-js/blob/master/lib/WebRtcPeer.js 的源代码,但我不确定。有人遇到过类似的问题吗?
编辑:
有更广泛的源代码,其中包含 webRTCPeer 创建(测试其他选项):
var options;
console.log(devcs);
if(devcs.length == 2){
console.log("CAMERA ID SET");
options = {
audio : false,
localVideo : videoInput,
remoteVideo : videoOutput,
video: {
optional: [{sourceId: devcs[0]}]
//deviceId: {exact: devcs[0]}
},
onicecandidate : onIceCandidate,
onerror : onError
}
}
else{
console.log("THERE ARE NO 2 CAMERAS");
options = {
audio : false,
localVideo : videoInput,
remoteVideo : videoOutput,
onicecandidate : onIceCandidate,
onerror : onError
}
}
webRtcPeer = new kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options,
function(error) {
if (error) {
return console.error(error);
}
webRtcPeer.generateOffer(onOfferIncomingCall);
});
我已经尝试过使用两个 ID 的两个选项,我在 devcs 数组中获取它们,但都不起作用 - 我总是有一个前置摄像头。正如我检查的那样,devcs 包含 ID。我有办法获得它们。
有一些日志,但不是太多(日志来自 android- 我正在 WebView (chromium) 中构建它):
12-21 12:21:39.985 25173-25173/eu.kros.t_medapp I/chromium:
[INFO:CONSOLE(70)] "Received message:
{"id":"incomingCall","from":"Qwe"}", source:
https://192.168.137.1:8443/tmedserver/resources/demo-console/js/index.js
(70) 12-21 12:21:42.374 25173-25173/eu.kros.t_medapp I/chromium:
[INFO:CONSOLE(70)]
"1a8c3f3af9469f0c9e89adf8324f03cc9300abee4a283499cfc0bc5161d0bd7b,8fb6f256ea855f26c5d3f6c02048a83472839e33f9b36f0f5af03750f0ea0693",
source:
https://192.168.137.1:8443/tmedserver/resources/demo-console/js/index.js
(70) 12-21 12:21:42.376 25173-25173/eu.kros.t_medapp I/chromium:
[INFO:CONSOLE(70)] "CAMERA ID SET", source:
https://192.168.137.1:8443/tmedserver/resources/demo-console/js/index.js
(70) 12-21 12:21:42.580 25173-25173/eu.kros.t_medapp I/chromium:
[INFO:CONSOLE(274)] "constraints:
{"mandatory":{"OfferToReceiveAudio":true,"OfferToReceiveVideo":true},"optional":[{"DtlsSrtpKeyAgreement":true}]}",
source:
https://192.168.137.1:8443/tmedserver/resources/kurento-utils/kurento-utils.js (274) 12-21 12:21:42.582 25173-25460/eu.kros.t_medapp W/chromium:
[WARNING:mediasession.cc(350)] Duplicate id found. Reassigning from
101 to 127 12-21 12:21:42.674 25173-25461/eu.kros.t_medapp E/chromium:
[ERROR:voe_audio_processing_impl.cc(774)] SetTypingDetectionStatus:
not supported 12-21 12:21:42.675 25173-25461/eu.kros.t_medapp
W/chromium: [WARNING:webrtcvoiceengine.cc(820)]
SetTypingDetectionStatus(0) failed, err=8003 12-21 12:21:42.683
25173-25461/eu.kros.t_medapp E/chromium:
[ERROR:voe_audio_processing_impl.cc(774)] SetTypingDetectionStatus:
not supported 12-21 12:21:42.684 25173-25461/eu.kros.t_medapp
W/chromium: [WARNING:webrtcvoiceengine.cc(820)]
SetTypingDetectionStatus(0) failed, err=8003 12-21 12:21:42.697
25173-25173/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(276)] "Created
SDP offer", source:
https://192.168.137.1:8443/tmedserver/resources/kurento-utils/kurento-utils.js (276) 12-21 12:21:42.737 25173-25173/eu.kros.t_medapp I/chromium:
[INFO:CONSOLE(281)] "Local description set", source:
https://192.168.137.1:8443/tmedserver/resources/kurento-utils/kurento-utils.js (281) 12-21 12:21:42.742 25173-25173/eu.kros.t_medapp I/chromium:
[INFO:CONSOLE(70)] "Senging message:
{"id":"incomingCallResponse","from":"Qwe","callResponse":"accept","sdpOffer":"v=0\r\no=-
5220787002804162488 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0
0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS
3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx\r\nm=audio 9 UDP/TLS/RTP/SAVPF
111 103 9 0 8 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4
0.0.0.0\r\na=ice-ufrag:wXPX\r\na=ice-pwd:VXRwTn0RLvzpFqC3uk58oanh\r\na=fingerprint:sha-256
FC:85:C8:8A:29:71:CB:7D:DE:02:EE:47:1A:5A:0B:E2:EE:FD:58:5B:2D:F1:65:A6:DC:2B:34:5E:E7:25:5A:12\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1
urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:3
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111
opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111
minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:9
G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8
PCMA/8000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13
CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=ssrc:854056653
cname:0AmhreG6mVDgfHOl\r\na=ssrc:854056653
msid:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx
71667887-1f6b-475d-8c80-4fbd58f5ce3c\r\na=ssrc:854056653
mslabel:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx\r\na=ssrc:854056653
label:71667887-1f6b-475d-8c80-4fbd58f5ce3c\r\nm=video 9
UDP/TLS/RTP/SAVPF 100 101 116 117 96 97 98\r\nc=IN IP4
0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:wXPX\r\na=ice-pwd:VXRwTn0RLvzpFqC3uk58oanh\r\na=fingerprint:sha-256
FC:85:C8:8A:29:71:CB:7D:DE:02:EE:47:1A:5A:0B:E2:EE:FD:58:5B:2D:F1:65:A6:DC:2B:34:5E:E7:25:5A:12\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2
urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4
urn:3gpp:video-orientation\r\na=extmap:5
http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:6
http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=sendrecv\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:100
VP8/90000\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100
nack\r\na=rtcp-fb:100 nack pli\r\na=rtcp-fb:100
goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtpmap:101
VP9/90000\r\na=rtcp-fb:101 ccm fir\r\na=rtcp-fb:101
nack\r\na=rtcp-fb:101 nack pli\r\na=rtcp-fb:101
goog-remb\r\na=rtcp-fb:101 transport-cc\r\na=rtpmap:116
red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=rtpmap:96
rtx/90000\r\na=fmtp:96 apt=100\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97
apt=101\r\na=rtpmap:98 rtx/90000\r\na=fmtp:98
apt=116\r\na=ssrc-group:FID 2811430131 2273108000\r\na=ssrc:2811430131
cname:0AmhreG6mVDgfHOl\r\na=ssrc:2811430131
msid:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx
d9810401-c8be-4f49-9453-35646b1842d0\r\na=ssrc:2811430131
mslabel:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx\r\na=ssrc:2811430131
label:d9810401-c8be-4f49-9453-35646b1842d0\r\na=ssrc:2273108000
cname:0AmhreG6mVDgfHOl\r\na=ssrc:2273108000
msid:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx
d9810401-c8be-4f49-9453-35646b1842d0\r\na=ssrc:2273108000
mslabel:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx\r\na=ssrc:2273108000
label:d9810401-c8be-4f49-9453-35646b1842d0\r\n"}", source:
https://192.168.137.1:8443/tmedserver/resources/demo-console/js/index.js
(70)
解决方法是连接不上kurento客户端。
必须通过 mediaConstraint 选项添加视频属性:
var constraints = {
audio:true,
video:{
deviceId: {exact: devcs[1]}
}
};
options = {
audio : false,
localVideo : videoInput,
remoteVideo : videoOutput,
mediaConstraints:constraints,
onicecandidate : onIceCandidate,
onerror : onError
}
我现在面临的另一个问题是相机仅使用一个视频 ID 即可正常工作:使用 devcs[0]。第二个摄像头 (devcs[1]) 有黑色视频元素和日志中的错误:
12-21 13:09:12.562 9704-9757/eu.kros.t_medapp W/CameraBase: An error
occurred while connecting to camera: 0
12-21 13:09:12.5629704-9757/eu.kros.t_medapp E/cr_VideoCapture: allocate: Camera.open:
java.lang.RuntimeException: Fail to connect to camera service
12-21 13:09:12.568 9704-9757/eu.kros.t_medapp E/cr_VideoCapture:
stopCapture: mCamera is null
当我解决它时我会更新这个post。
我正在使用 WebRtcPeerSendrecv 对象与 kurento 服务器建立与 WebRTC 端点的通信。我想要 select 此处制作的视频输入:https://webrtc.github.io/samples/src/content/devices/input-output/
我遇到的问题是添加 属性 video/deviceId 不起作用。
options = {
audio : false,
localVideo : videoInput,
remoteVideo : videoOutput,
video: {
deviceId: {exact: devcs[0]}
},
onicecandidate : onIceCandidate,
onerror : onError
}
唯一以其他方式制作的东西是我正在与 Kurento-utils 的 WebRtcPeerSendrecv 建立我的 WebRtc 连接,最初它是使用 navigator.getUserMedia(...) 制作的。 据我所知,WebRtcPeerSendrecv 正在调用 getUserMedia,但我不确定是否所有属性都被一对一复制。我在这里查看了 https://github.com/Kurento/kurento-utils-js/blob/master/lib/WebRtcPeer.js 的源代码,但我不确定。有人遇到过类似的问题吗?
编辑:
有更广泛的源代码,其中包含 webRTCPeer 创建(测试其他选项):
var options;
console.log(devcs);
if(devcs.length == 2){
console.log("CAMERA ID SET");
options = {
audio : false,
localVideo : videoInput,
remoteVideo : videoOutput,
video: {
optional: [{sourceId: devcs[0]}]
//deviceId: {exact: devcs[0]}
},
onicecandidate : onIceCandidate,
onerror : onError
}
}
else{
console.log("THERE ARE NO 2 CAMERAS");
options = {
audio : false,
localVideo : videoInput,
remoteVideo : videoOutput,
onicecandidate : onIceCandidate,
onerror : onError
}
}
webRtcPeer = new kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options,
function(error) {
if (error) {
return console.error(error);
}
webRtcPeer.generateOffer(onOfferIncomingCall);
});
我已经尝试过使用两个 ID 的两个选项,我在 devcs 数组中获取它们,但都不起作用 - 我总是有一个前置摄像头。正如我检查的那样,devcs 包含 ID。我有办法获得它们。
有一些日志,但不是太多(日志来自 android- 我正在 WebView (chromium) 中构建它):
12-21 12:21:39.985 25173-25173/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(70)] "Received message: {"id":"incomingCall","from":"Qwe"}", source: https://192.168.137.1:8443/tmedserver/resources/demo-console/js/index.js (70) 12-21 12:21:42.374 25173-25173/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(70)] "1a8c3f3af9469f0c9e89adf8324f03cc9300abee4a283499cfc0bc5161d0bd7b,8fb6f256ea855f26c5d3f6c02048a83472839e33f9b36f0f5af03750f0ea0693", source: https://192.168.137.1:8443/tmedserver/resources/demo-console/js/index.js (70) 12-21 12:21:42.376 25173-25173/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(70)] "CAMERA ID SET", source: https://192.168.137.1:8443/tmedserver/resources/demo-console/js/index.js (70) 12-21 12:21:42.580 25173-25173/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(274)] "constraints: {"mandatory":{"OfferToReceiveAudio":true,"OfferToReceiveVideo":true},"optional":[{"DtlsSrtpKeyAgreement":true}]}", source: https://192.168.137.1:8443/tmedserver/resources/kurento-utils/kurento-utils.js (274) 12-21 12:21:42.582 25173-25460/eu.kros.t_medapp W/chromium: [WARNING:mediasession.cc(350)] Duplicate id found. Reassigning from 101 to 127 12-21 12:21:42.674 25173-25461/eu.kros.t_medapp E/chromium: [ERROR:voe_audio_processing_impl.cc(774)] SetTypingDetectionStatus: not supported 12-21 12:21:42.675 25173-25461/eu.kros.t_medapp W/chromium: [WARNING:webrtcvoiceengine.cc(820)] SetTypingDetectionStatus(0) failed, err=8003 12-21 12:21:42.683 25173-25461/eu.kros.t_medapp E/chromium: [ERROR:voe_audio_processing_impl.cc(774)] SetTypingDetectionStatus: not supported 12-21 12:21:42.684 25173-25461/eu.kros.t_medapp W/chromium: [WARNING:webrtcvoiceengine.cc(820)] SetTypingDetectionStatus(0) failed, err=8003 12-21 12:21:42.697 25173-25173/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(276)] "Created SDP offer", source: https://192.168.137.1:8443/tmedserver/resources/kurento-utils/kurento-utils.js (276) 12-21 12:21:42.737 25173-25173/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(281)] "Local description set", source: https://192.168.137.1:8443/tmedserver/resources/kurento-utils/kurento-utils.js (281) 12-21 12:21:42.742 25173-25173/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(70)] "Senging message: {"id":"incomingCallResponse","from":"Qwe","callResponse":"accept","sdpOffer":"v=0\r\no=- 5220787002804162488 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS 3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 0 8 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:wXPX\r\na=ice-pwd:VXRwTn0RLvzpFqC3uk58oanh\r\na=fingerprint:sha-256 FC:85:C8:8A:29:71:CB:7D:DE:02:EE:47:1A:5A:0B:E2:EE:FD:58:5B:2D:F1:65:A6:DC:2B:34:5E:E7:25:5A:12\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=ssrc:854056653 cname:0AmhreG6mVDgfHOl\r\na=ssrc:854056653 msid:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx 71667887-1f6b-475d-8c80-4fbd58f5ce3c\r\na=ssrc:854056653 mslabel:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx\r\na=ssrc:854056653 label:71667887-1f6b-475d-8c80-4fbd58f5ce3c\r\nm=video 9 UDP/TLS/RTP/SAVPF 100 101 116 117 96 97 98\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:wXPX\r\na=ice-pwd:VXRwTn0RLvzpFqC3uk58oanh\r\na=fingerprint:sha-256 FC:85:C8:8A:29:71:CB:7D:DE:02:EE:47:1A:5A:0B:E2:EE:FD:58:5B:2D:F1:65:A6:DC:2B:34:5E:E7:25:5A:12\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=sendrecv\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:100 VP8/90000\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtpmap:101 VP9/90000\r\na=rtcp-fb:101 ccm fir\r\na=rtcp-fb:101 nack\r\na=rtcp-fb:101 nack pli\r\na=rtcp-fb:101 goog-remb\r\na=rtcp-fb:101 transport-cc\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=rtpmap:96 rtx/90000\r\na=fmtp:96 apt=100\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=101\r\na=rtpmap:98 rtx/90000\r\na=fmtp:98 apt=116\r\na=ssrc-group:FID 2811430131 2273108000\r\na=ssrc:2811430131 cname:0AmhreG6mVDgfHOl\r\na=ssrc:2811430131 msid:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx d9810401-c8be-4f49-9453-35646b1842d0\r\na=ssrc:2811430131 mslabel:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx\r\na=ssrc:2811430131 label:d9810401-c8be-4f49-9453-35646b1842d0\r\na=ssrc:2273108000 cname:0AmhreG6mVDgfHOl\r\na=ssrc:2273108000 msid:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx d9810401-c8be-4f49-9453-35646b1842d0\r\na=ssrc:2273108000 mslabel:3Rq4qyKWshfM1wF6rXu3OZ0sNxq7Fus0qJUx\r\na=ssrc:2273108000 label:d9810401-c8be-4f49-9453-35646b1842d0\r\n"}", source: https://192.168.137.1:8443/tmedserver/resources/demo-console/js/index.js (70)
解决方法是连接不上kurento客户端。 必须通过 mediaConstraint 选项添加视频属性:
var constraints = {
audio:true,
video:{
deviceId: {exact: devcs[1]}
}
};
options = {
audio : false,
localVideo : videoInput,
remoteVideo : videoOutput,
mediaConstraints:constraints,
onicecandidate : onIceCandidate,
onerror : onError
}
我现在面临的另一个问题是相机仅使用一个视频 ID 即可正常工作:使用 devcs[0]。第二个摄像头 (devcs[1]) 有黑色视频元素和日志中的错误:
12-21 13:09:12.562 9704-9757/eu.kros.t_medapp W/CameraBase: An error occurred while connecting to camera: 0
12-21 13:09:12.5629704-9757/eu.kros.t_medapp E/cr_VideoCapture: allocate: Camera.open: java.lang.RuntimeException: Fail to connect to camera service
12-21 13:09:12.568 9704-9757/eu.kros.t_medapp E/cr_VideoCapture: stopCapture: mCamera is null
当我解决它时我会更新这个post。