简体   繁体   English

Answer SDP中缺少什么(从网络浏览器到Android设备)

[英]What's missing in Answer SDP (From web browser to android device)

I've customized Apprtc project. 我已经定制了Apprtc项目。 i can call from an user and other user can answer call or reject call 我可以从一个用户拨打电话,其他用户可以接听电话或拒绝通话

When I call from android to web browser, I can't See video source of web browser in android device but I can see video source of android in web browser only. 当我从android调用到网络浏览器时,我无法在android设备中看到网络浏览器的视频源,但只能在网络浏览器中看到android的视频源。

Web browser version: Chrome 58 (Desktop version) Android version: Marshmallow Web浏览器版本:Chrome 58(台式机版本)Android版本:棉花糖

Offer SDP: (From Android) 提供SDP :(来自Android)

v=0 o=- 7916385280226465055 2 IN IP4 127.0.0.1 v = 0 o =-7916385280226465055 2 IN IP4 127.0.0.1

s=- s =-

t=0 0 t = 0 0

a=group:BUNDLE audio video a = group:BUNDLE音频视频

a=msid-semantic: WMS ARDAMS___ a = msid语义:WMS ARDAMS___

m=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 102 0 8 105 13 126 m =音频9 UDP / TLS / RTP / SAVPF 111103 9102 0 8105 13126

c=IN IP4 0.0.0.0 c = IN IP4 0.0.0.0

a=rtcp:9 IN IP4 0.0.0.0 a = rtcp:9输入IP4 0.0.0.0

a=ice-ufrag:xKDP a = ice-ufrag:xKDP

a=ice-pwd:/hAtH4MAzGA/If6Fn+sT6Okj a = ice-pwd:/ hAtH4MAzGA / If6Fn + sT6Okj

a=ice-options:renomination a = ice-options:提名

a=fingerprint:sha-256 35:5A:08:8D:FA:18:41:B9:A6:E2:B4:9A:A7:EE:1E:61:CA:38:BC:5B:98:9F:D1:3E:1F:51:79:C8:F3:63:00:F8 a =指纹:sha-256 35:5A:08:8D:FA:18:41:B9:A6:E2:B4:9A:A7:EE:1E:61:CA:38:BC:5B:98:9F :D1:3E:1F:51:79:C8:F3:63:00:F8

a=setup:actpass a = setup:actpass

a=mid:audio a = mid:音频

a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a = extmap:1 urn:ietf:params:rtp-hdrext:ssrc音频级别

a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a = extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time

a=sendrecv a = sendrecv

a=rtcp-mux a = rtcp-mux

a=rtpmap:111 opus/48000/2 a = rtpmap:111 opus / 48000/2

a=rtcp-fb:111 transport-cc a = rtcp-fb:111 transport-cc

a=fmtp:111 minptime=10;useinbandfec=1 a = fmtp:111 minptime = 10; useinbandfec = 1

a=rtpmap:103 ISAC/16000 a = rtpmap:103 ISAC / 16000

a=rtpmap:9 G722/8000 a = rtpmap:9 G722 / 8000

a=rtpmap:102 ILBC/8000 a = rtpmap:102 ILBC / 8000

a=rtpmap:0 PCMU/8000 a = rtpmap:0 PCMU / 8000

a=rtpmap:8 PCMA/8000 a = rtpmap:8 PCMA / 8000

a=rtpmap:105 CN/16000 a = rtpmap:105 CN / 16000

a=rtpmap:13 CN/8000 a = rtpmap:13 CN / 8000

a=rtpmap:126 telephone-event/8000 a = rtpmap:126电话事件/ 8000

a=ssrc:1281015102 cname:wYjcft96aVDGkQzC a = ssrc:1281015102 cname:wYjcft96aVDGkQzC

a=ssrc:1281015102 msid:ARDAMS___ ARDAMSa0 a = ssrc:1281015102 msid:ARDAMS ___ ARDAMSa0

a=ssrc:1281015102 mslabel:ARDAMS___ a = ssrc:1281015102 mslabel:ARDAMS ___

a=ssrc:1281015102 label:ARDAMSa0 a = ssrc:1281015102标签:ARDAMSa0

m=video 9 UDP/TLS/RTP/SAVPF 100 101 116 117 96 97 98 m =视频9 UDP / TLS / RTP / SAVPF 1001011161179697 98

c=IN IP4 0.0.0.0 c = IN IP4 0.0.0.0

a=rtcp:9 IN IP4 0.0.0.0 a = rtcp:9输入IP4 0.0.0.0

a=ice-ufrag:xKDP a = ice-ufrag:xKDP

a=ice-pwd:/hAtH4MAzGA/If6Fn+sT6Okj a = ice-pwd:/ hAtH4MAzGA / If6Fn + sT6Okj

a=ice-options:renomination a = ice-options:提名

a=fingerprint:sha-256 35:5A:08:8D:FA:18:41:B9:A6:E2:B4:9A:A7:EE:1E:61:CA:38:BC:5B:98:9F:D1:3E:1F:51:79:C8:F3:63:00:F8 a =指纹:sha-256 35:5A:08:8D:FA:18:41:B9:A6:E2:B4:9A:A7:EE:1E:61:CA:38:BC:5B:98:9F :D1:3E:1F:51:79:C8:F3:63:00:F8

a=setup:actpass a = setup:actpass

a=mid:video a = mid:video

a=extmap:2 urn:ietf:params:rtp-hdrext:toffset a = extmap:2 urn:ietf:params:rtp-hdrext:toffset

a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a = extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time

a=extmap:4 urn:3gpp:video-orientation a = extmap:4缸:3gpp:视频方向

a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a = extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01

a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay a = extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay

a=sendrecv a = sendrecv

a=rtcp-mux a = rtcp-mux

a=rtcp-rsize a = rtcp-rsize

a=rtpmap:100 VP8/90000 a = rtpmap:100 VP8 / 90000

a=rtcp-fb:100 ccm fir a = rtcp-fb:100 ccm冷杉

a=rtcp-fb:100 nack a = rtcp-fb:100小

a=rtcp-fb:100 nack pli a = rtcp-fb:100 nack pli

a=rtcp-fb:100 goog-remb a = rtcp-fb:100 goog-remb

a=rtcp-fb:100 transport-cc a = rtcp-fb:100 transport-cc

a=rtpmap:101 VP9/90000 a = rtpmap:101 VP9 / 90000

a=rtcp-fb:101 ccm fir a = rtcp-fb:101 ccm冷杉

a=rtcp-fb:101 nack a = rtcp-fb:101无效

a=rtcp-fb:101 nack pli a = rtcp-fb:101 nack pli

a=rtcp-fb:101 goog-remb a = rtcp-fb:101 goog-remb

a=rtcp-fb:101 transport-cc a = rtcp-fb:101 transport-cc

a=rtpmap:116 red/90000 a = rtpmap:116红色/ 90000

a=rtpmap:117 ulpfec/90000 a = rtpmap:117 ulpfec / 90000

a=rtpmap:96 rtx/90000 a = rtpmap:96 rtx / 90000

a=fmtp:96 apt=100 a = fmtp:96 apt = 100

a=rtpmap:97 rtx/90000 a = rtpmap:97 rtx / 90000

a=fmtp:97 apt=101 a = fmtp:97 apt = 101

a=rtpmap:98 rtx/90000 a = rtpmap:98 rtx / 90000

a=fmtp:98 apt=116 a = fmtp:98 apt = 116

a=ssrc-group:FID 2034101263 3486873766 a = ssrc-group:FID 2034101263 3486873766

a=ssrc:2034101263 cname:wYjcft96aVDGkQzC a = ssrc:2034101263 cname:wYjcft96aVDGkQzC

a=ssrc:2034101263 msid:ARDAMS___ ARDAMSv0 a = ssrc:2034101263 msid:ARDAMS ___ ARDAMSv0

a=ssrc:2034101263 mslabel:ARDAMS___ a = ssrc:2034101263 mslabel:ARDAMS ___

a=ssrc:2034101263 label:ARDAMSv0 a = ssrc:2034101263标签:ARDAMSv0

a=ssrc:3486873766 cname:wYjcft96aVDGkQzC a = ssrc:3486873766 cname:wYjcft96aVDGkQzC

a=ssrc:3486873766 msid:ARDAMS___ ARDAMSv0 a = ssrc:3486873766 msid:ARDAMS ___ ARDAMSv0

a=ssrc:3486873766 mslabel:ARDAMS___ a = ssrc:3486873766 mslabel:ARDAMS ___

a=ssrc:3486873766 label:ARDAMSv0 a = ssrc:3486873766标签:ARDAMSv0

Answer SDP: (From Web Browser) 回答SDP :(从Web浏览器)

v=0 v = 0

o=mozilla...THIS_IS_SDPARTA-52.0.2 6548308332703463210 0 IN IP4 0.0.0.0 o = mozilla ... THIS_IS_SDPARTA-52.0.2 6548308332703463210 0 IN IP4 0.0.0.0

s=- s =-

t=0 0 t = 0 0

a=fingerprint:sha-256 E6:0F:6A:A6:35:E0:B3:8E:7A:0E:2E:20:A9:AB:0B:CA:1C:6D:33:6C:B6:D1:E4:2D:39:87:1E:93:4E:ED:BB:CF a =指纹:sha-256 E6:0F:6A:A6:35:E0:B3:8E:7A:0E:2E:20:A9:AB:0B:CA:1C:6D:33:6C:B6:D1 :E4:2D:39:87:1E:93:4E:ED:BB:CF

a=group:BUNDLE audio video a = group:BUNDLE音频视频

a=ice-options:trickle a = ice-options:细流

a=msid-semantic:WMS * a = msid-semantic:WMS *

m=audio 9 UDP/TLS/RTP/SAVPF 111 126 m =音频9 UDP / TLS / RTP / SAVPF 111126

c=IN IP4 0.0.0.0 c = IN IP4 0.0.0.0

a=recvonly a = recvonly

a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a = extmap:1 urn:ietf:params:rtp-hdrext:ssrc音频级别

a=fmtp:111 maxplaybackrate=48000;stereo=1;useinbandfec=1 a = fmtp:111 maxplaybackrate = 48000;立体声= 1; useinbandfec = 1

a=fmtp:126 0-15 a = fmtp:126 0-15

a=ice-pwd:8a4fad1c837809d3ee952922dbe2b927 a = ice-pwd:8a4fad1c837809d3ee952922dbe2b927

a=ice-ufrag:ab799d79 a = ice-ufrag:ab799d79

a=mid:audio a = mid:音频

a=rtcp-mux a = rtcp-mux

a=rtpmap:111 opus/48000/2 a = rtpmap:111 opus / 48000/2

a=rtpmap:126 telephone-event/8000/1 a = rtpmap:126电话事件/ 8000/1

a=setup:active a = setup:active

a=ssrc:2269112214 cname:{b1e7d024-d327-4788-a5b1-a1b8291b5c8d} a = ssrc:2269112214 cname:{b1e7d024-d327-4788-a5b1-a1b8291b5c8d}

m=video 9 UDP/TLS/RTP/SAVPF 100 m =视频9 UDP / TLS / RTP / SAVPF 100

c=IN IP4 0.0.0.0 c = IN IP4 0.0.0.0

a=recvonly a = recvonly

a=fmtp:100 max-fs=12288;max-fr=60 a = fmtp:100 max-fs = 12288; max-fr = 60

a=ice-pwd:8a4fad1c837809d3ee952922dbe2b927 a = ice-pwd:8a4fad1c837809d3ee952922dbe2b927

a=ice-ufrag:ab799d79 a = ice-ufrag:ab799d79

a=mid:video a = mid:video

a=rtcp-fb:100 nack a = rtcp-fb:100小

a=rtcp-fb:100 nack pli a = rtcp-fb:100 nack pli

a=rtcp-fb:100 ccm fir a = rtcp-fb:100 ccm冷杉

a=rtcp-fb:100 goog-remb a = rtcp-fb:100 goog-remb

a=rtcp-mux a = rtcp-mux

a=rtpmap:100 VP8/90000 a = rtpmap:100 VP8 / 90000

a=setup:active a = setup:active

a=ssrc:1613714278 cname:{b1e7d024-d327-4788-a5b1-a1b8291b5c8d} a = ssrc:1613714278 cname:{b1e7d024-d327-4788-a5b1-a1b8291b5c8d}

In peerconnection.cc current_tracks variable Not be filled: 在peerconnection.cc中current_tracks变量中未填写:

void PeerConnection::UpdateRemoteStreamsList(
    const cricket::StreamParamsVec& streams,
    bool default_track_needed,
    cricket::MediaType media_type,
    StreamCollection* new_streams) {

  TrackInfos* current_tracks = GetRemoteTracks(media_type);

  // Find removed tracks. I.e., tracks where the track id or ssrc don't match
  // the new StreamParam.
  auto track_it = current_tracks->begin();
  while (track_it != current_tracks->end()) {

By looking into your answer SDP, it is not carrying any stream/track. 通过调查您的答案SDP,它不携带任何流/曲目。
Suspected issue could be, you are not adding the stream before creating the answer in the browser. 可能是因为您在浏览器中创建答案之前没有添加流。
You can check the PeerConnection API calls by opening chrome://webrtc-internals/ 您可以通过打开chrome:// webrtc-internals /来检查PeerConnection API调用

PeerConnection API calls should be as following in the browser/answered side PeerConnection API调用应在浏览器/已答复端中如下所示

pc = new RTCPeerConnection({"iceServers": [{"urls": "stun:stun.l.google.com:19302"}]}, 
                           {"optional": [{"DtlsSrtpKeyAgreement": true}]
        }); 

pc.setRemoteDescription(
        new RTCSessionDescription(jsep),
        function() {
            console.log(' OFFER accepted ');
        }, function(e) {
            console.log(' OFFER Failed ', e);
    });

pc.addStream(stream);

pc.createAnswer(function(answer) {
            console.log('got answer', answer);
            pc.setLocalDescription(answer, 
                    function() {
                        console.log('set local description sucesses ');
                    }, function(e) {
                        console.log('set local description failed ', e);
                    });
          // Send the answer to other user endpoint
        }, function() {
            console.log('Error: Unable to create answer');
        }, {
            'mandatory': {
                'OfferToReceiveAudio': true, 
                'OfferToReceiveVideo': true, 
            }
        });
}

So your Answer SDP should contain a=sendonly lines instead of a=recvonly . 因此,您的Answer SDP应该包含a=sendonly行而不是a=recvonly

Your browser SDP has a=recvonly attribute which means local stream is not added to your Peerconnection. 您的浏览器SDP具有a=recvonly属性,这意味着本地流不会添加到您的Peerconnection中。 If your browser is sending audio/video track to remote and wants to receive remote streams then it should have a=sendrec in AnswerSDP. 如果您的浏览器正在向远程发送音频/视频轨道,并且想要接收远程流,则它在AnswerSDP中应该有a=sendrec sendrec。

Expanding on other answers: you should send your connect signal only after making sure your local stream has been fetched and added to your RTCPeerConnection. 扩展其他答案:仅在确保已提取本地流并将其添加到RTCPeerConnection之后,才应发送连接信号。

navigator.mediaDevices.getUserMedia({
    audio: false, // request access to local microphone
    video: true  // request access to local camera
}).then(function (local_stream) {
    // display preview from the local camera & microphone using local <video> MediaElement
    var media_element = document.getElementById('local_video');
    media_element.srcObject = local_stream;
    media_element.play();
    // add local camera stream to peer_connection ready to be sent to the remote peer
    peer_connection.addStream(local_stream);
    signal_init();
}).catch(console.log);

Where signal_init is your signaling/connection callback. 其中signal_init是您的信令/连接回调。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM