1

I'd developing an app to load video streams from Nest Camera using

org.webrtc:google-webrtc

I am always successful in loading video stream from Samsung phones. But some device like Sony or Google Pixel cannot load the stream from the Nest Camera(I just want to play stream only, not to make a call).

This is the log from Sony phone:

2023-03-02 10:11:19.520 14923-14923/ I/org.webrtc.Logging: EglBase14Impl: SDK version: 29. isEGL14Supported: true
2023-03-02 10:11:19.522 14923-14923/ I/org.webrtc.Logging: EglBase14Impl: Using OpenGL ES version 2
2023-03-02 10:11:19.524 14923-14923/ I/org.webrtc.Logging: NativeLibrary: Native library has already been loaded.
2023-03-02 10:11:19.524 14923-14923/ I/org.webrtc.Logging: PeerConnectionFactory: PeerConnectionFactory was initialized without an injected Loggable. Any existing Loggable will be deleted.
2023-03-02 10:11:19.526 14923-14923/ I/org.webrtc.Logging: WebRtcAudioManagerExternal: Sample rate is set to 48000 Hz
2023-03-02 10:11:19.526 14923-14923/ I/org.webrtc.Logging: WebRtcAudioManagerExternal: Sample rate is set to 48000 Hz
2023-03-02 10:11:19.526 14923-14923/ I/org.webrtc.Logging: JavaAudioDeviceModule: createAudioDeviceModule
2023-03-02 10:11:19.526 14923-14923/ I/org.webrtc.Logging: JavaAudioDeviceModule: HW NS will be used.
2023-03-02 10:11:19.526 14923-14923/ I/org.webrtc.Logging: JavaAudioDeviceModule: HW AEC will be used.
2023-03-02 10:11:19.527 14923-14923/ I/org.webrtc.Logging: WebRtcAudioEffectsExternal: ctor@[name=main, id=2]
2023-03-02 10:11:19.527 14923-14923/ I/org.webrtc.Logging: WebRtcAudioRecordExternal: ctor@[name=main, id=2]
2023-03-02 10:11:19.527 14923-14923/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: ctor@[name=main, id=2]
2023-03-02 10:11:19.536 14923-16819/ I/org.webrtc.Logging: WebRtcAudioRecordExternal: enableBuiltInAEC(true)
2023-03-02 10:11:19.536 14923-16819/ I/org.webrtc.Logging: WebRtcAudioEffectsExternal: setAEC(true)
2023-03-02 10:11:19.537 14923-16819/ I/org.webrtc.Logging: WebRtcAudioRecordExternal: enableBuiltInNS(true)
2023-03-02 10:11:19.537 14923-16819/ I/org.webrtc.Logging: WebRtcAudioEffectsExternal: setNS(true)
2023-03-02 10:11:19.539 14923-16819/ I/org.webrtc.Logging: PeerConnectionFactory: onWorkerThreadReady
2023-03-02 10:11:19.539 14923-16820/ I/org.webrtc.Logging: PeerConnectionFactory: onSignalingThreadReady
2023-03-02 10:11:19.540 14923-16818/ I/org.webrtc.Logging: PeerConnectionFactory: onNetworkThreadReady
2023-03-02 10:11:19.585 14923-14923/ I/org.webrtc.Logging: EglRenderer: remote_gl_surface_viewInitializing EglRenderer
2023-03-02 10:11:19.587 14923-16823/ I/org.webrtc.Logging: EglRenderer: remote_gl_surface_viewEglBase.create shared context
2023-03-02 10:11:19.587 14923-16823/ I/org.webrtc.Logging: EglBase14Impl: Using OpenGL ES version 2
2023-03-02 10:11:19.614 14923-14923/ I/org.webrtc.Logging: SurfaceViewRenderer: remote_gl_surface_view: onMeasure(). New size: 1080x1944
2023-03-02 10:11:19.618 14923-14923/ I/org.webrtc.Logging: SurfaceViewRenderer: remote_gl_surface_view: onMeasure(). New size: 1080x1944
2023-03-02 10:11:19.622 14923-16818/ I/org.webrtc.Logging: NetworkMonitor: Start monitoring with native observer 505486685312
2023-03-02 10:11:19.623 14923-14923/ I/org.webrtc.Logging: EglRenderer: remote_gl_surface_viewsetLayoutAspectRatio: 0.5555556
2023-03-02 10:11:19.627 14923-16818/ W/org.webrtc.Logging: NetworkMonitorAutoDetect: Unable to obtain permission to request a cellular network.
2023-03-02 10:11:19.629 14923-14923/ I/org.webrtc.Logging: SurfaceEglRenderer: remote_gl_surface_view: surfaceChanged: format: 4 size: 1080x1944
2023-03-02 10:11:19.630 14923-15003/ I/org.webrtc.Logging: NetworkMonitorAutoDetect: Network becomes available: 100
2023-03-02 10:11:19.641 14923-15003/ I/org.webrtc.Logging: NetworkMonitorAutoDetect: capabilities changed: [ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps SignalStrength: -52]
2023-03-02 10:11:19.653 14923-15003/ I/org.webrtc.Logging: NetworkMonitorAutoDetect: link properties changed: {InterfaceName: wlan0 LinkAddresses: [ fe80::e84d:ecff:fe8e:f358/64,192.168.1.4/24,2402:800:629c:5dc8:e84d:ecff:fe8e:f358/64,2402:800:629c:5dc8:592a:19e1:3c56:c5ab/64 ] DnsAddresses: [ /2402:800:20ff:6666::1,/2402:800:20ff:8888::1,/203.113.131.2,/203.113.131.3 ] Domains: null MTU: 0 TcpBufferSizes: 524288,1048576,2097152,262144,524288,1048576 Routes: [ fe80::/64 -> :: wlan0,::/0 -> fe80::1 wlan0,2402:800:629c:5dc8::/64 -> :: wlan0,192.168.1.0/24 -> 0.0.0.0 wlan0,0.0.0.0/0 -> 192.168.1.1 wlan0 ]}
2023-03-02 10:11:21.126 14923-16819/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: initPlayout(sampleRate=48000, channels=1, bufferSizeFactor=1.0)
2023-03-02 10:11:21.126 14923-16819/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: byteBuffer.capacity: 960
2023-03-02 10:11:21.127 14923-16819/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: minBufferSizeInBytes: 7688
2023-03-02 10:11:21.128 14923-16819/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: createAudioTrackOnLollipopOrHigher
2023-03-02 10:11:21.128 14923-16819/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: nativeOutputSampleRate: 48000
2023-03-02 10:11:21.137 14923-16819/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: AudioTrack: session ID: 145, channels: 1, sample rate: 48000, max gain: 1.0
2023-03-02 10:11:21.137 14923-16819/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: AudioTrack: buffer size in frames: 3844
2023-03-02 10:11:21.138 14923-16819/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: AudioTrack: buffer capacity in frames: 3844
2023-03-02 10:11:21.138 14923-16819/ I/org.webrtc.Logging: VolumeLogger: start@[name=worker_thread - 16819, id=1788]
2023-03-02 10:11:21.138 14923-16819/ I/org.webrtc.Logging: VolumeLogger: audio mode is: MODE_NORMAL
2023-03-02 10:11:21.139 14923-16819/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: startPlayout
2023-03-02 10:11:21.145 14923-16953/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: AudioTrackThread@[name=AudioTrackJavaThread, id=1797]
2023-03-02 10:11:21.145 14923-16953/ I/org.webrtc.Logging: WebRtcAudioTrackExternal: doAudioTrackStateCallback: 0
2023-03-02 10:11:21.148 14923-16819/ I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: OMX.qcom.video.decoder.avc type: H264 color format: 19 context: org.webrtc.EglBase14Impl$Context@b44e9fd
2023-03-02 10:11:21.149 14923-16819/ I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: c2.android.avc.decoder type: H264 color format: 19 context: org.webrtc.EglBase14Impl$Context@b44e9fd
2023-03-02 10:11:21.149 14923-16819/ I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: OMX.qcom.video.decoder.avc type: H264 color format: 19 context: org.webrtc.EglBase14Impl$Context@b44e9fd
2023-03-02 10:11:21.150 14923-16819/ I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: c2.android.avc.decoder type: H264 color format: 19 context: org.webrtc.EglBase14Impl$Context@b44e9fd
2023-03-02 10:11:21.150 14923-16819/ I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: OMX.qcom.video.decoder.vp8 type: VP8 color format: 19 context: org.webrtc.EglBase14Impl$Context@b44e9fd
2023-03-02 10:11:21.151 14923-16819/ I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: OMX.qcom.video.decoder.vp9 type: VP9 color format: 19 context: org.webrtc.EglBase14Impl$Context@b44e9fd
2023-03-02 10:11:23.595 14923-16823/ I/org.webrtc.Logging: EglRenderer: remote_gl_surface_viewDuration: 4006 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
2023-03-02 10:11:27.602 14923-16823/ I/org.webrtc.Logging: EglRenderer: remote_gl_surface_viewDuration: 4006 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
2023-03-02 10:11:31.609 14923-16823/ I/org.webrtc.Logging: EglRenderer: remote_gl_surface_viewDuration: 4006 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.

And here is the offer sdp I created from the Sony phone:

v=0
o=- 8159822428667968027 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1 2
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:sXTN
a=ice-pwd:dV5VWyYSmcuH6YjyjR4BBnP5
a=ice-options:trickle renomination
a=fingerprint:sha-256 48:20:E6:BA:2C:5E:6A:AC:20:93:8A:D9:E0:49:CA:EE:61:5F:C9:A7:26:75:CC:E1:F5:2F:38:B2:35:71:19:BD
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=recvonly
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:102 ILBC/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
m=video 9 UDP/TLS/RTP/SAVPF 124 100 96 97 98 99 101 127 123 125
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:sXTN
a=ice-pwd:dV5VWyYSmcuH6YjyjR4BBnP5
a=ice-options:trickle renomination
a=fingerprint:sha-256 48:20:E6:BA:2C:5E:6A:AC:20:93:8A:D9:E0:49:CA:EE:61:5F:C9:A7:26:75:CC:E1:F5:2F:38:B2:35:71:19:BD
a=setup:actpass
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:124 H264/90000
a=rtcp-fb:124 goog-remb
a=rtcp-fb:124 transport-cc
a=rtcp-fb:124 ccm fir
a=rtcp-fb:124 nack
a=rtcp-fb:124 nack pli
a=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640c1f
a=rtpmap:100 H264/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:127 red/90000
a=rtpmap:123 rtx/90000
a=fmtp:123 apt=127
a=rtpmap:125 ulpfec/90000
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=ice-ufrag:sXTN
a=ice-pwd:dV5VWyYSmcuH6YjyjR4BBnP5
a=ice-options:trickle renomination
a=fingerprint:sha-256 48:20:E6:BA:2C:5E:6A:AC:20:93:8A:D9:E0:49:CA:EE:61:5F:C9:A7:26:75:CC:E1:F5:2F:38:B2:35:71:19:BD
a=setup:actpass
a=mid:2
a=sctp-port:5000
a=max-message-size:262144

And here is the answerSdp from the Nest Camera:

v=0
o=- 0 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 2 1
a=msid-semantic: WMS 3725812075825813547/3327200828 virtual-6666
a=ice-lite
m=audio 19305 UDP/TLS/RTP/SAVPF 111
c=IN IP4 108.177.122.127
a=rtcp:9 IN IP4 0.0.0.0
a=candidate: 1 udp 2113939711 2607:f8b0:4002:c02::7f 19305 typ host generation 0
a=candidate: 1 tcp 2113939710 2607:f8b0:4002:c02::7f 19305 typ host tcptype passive generation 0
a=candidate: 1 ssltcp 2113939709 2607:f8b0:4002:c02::7f 443 typ host generation 0
a=candidate: 1 udp 2113932031 108.177.122.127 19305 typ host generation 0
a=candidate: 1 tcp 2113932030 108.177.122.127 19305 typ host tcptype passive generation 0
a=candidate: 1 ssltcp 2113932029 108.177.122.127 443 typ host generation 0
a=ice-ufrag:JEEXTA46SZCV9G7S
a=ice-pwd:B8NCOJ4G1LQBXPP4AKL9YSYE
a=fingerprint:sha-256 DA:DC:9C:35:98:28:D2:C7:DA:1C:38:F7:DD:2B:D2:61:D9:93:0A:08:5D:CE:BB:51:CF:1B:BC:E0:A6:90:CF:8C
a=setup:passive
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=sendrecv
a=msid:virtual-6666 virtual-6666
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtcp-fb:* transport-cc
a=ssrc:6666 cname:6666
m=video 9 UDP/TLS/RTP/SAVPF 124 100 101
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:JEEXTA46SZCV9G7S
a=ice-pwd:B8NCOJ4G1LQBXPP4AKL9YSYE
a=fingerprint:sha-256 DA:DC:9C:35:98:28:D2:C7:DA:1C:38:F7:DD:2B:D2:61:D9:93:0A:08:5D:CE:BB:51:CF:1B:BC:E0:A6:90:CF:8C
a=setup:passive
a=mid:1
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=sendrecv
a=msid:3725812075825813547/3327200828 3725812075825813547/3327200828
a=rtcp-mux
a=rtpmap:124 H264/90000
a=rtcp-fb:124 transport-cc
a=rtcp-fb:124 ccm fir
a=rtcp-fb:124 nack
a=rtcp-fb:124 nack pli
a=rtcp-fb:124 goog-remb
a=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640c1f
a=rtpmap:100 H264/90000
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtcp-fb:* transport-cc
a=rtcp-fb:* ccm fir
a=rtcp-fb:* nack
a=rtcp-fb:* nack pli
a=rtcp-fb:* goog-remb
a=ssrc-group:FID 3327200828 1688556008
a=ssrc:3327200828 cname:3327200828
a=ssrc:1688556008 cname:3327200828
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=ice-ufrag:JEEXTA46SZCV9G7S
a=ice-pwd:B8NCOJ4G1LQBXPP4AKL9YSYE
a=fingerprint:sha-256 DA:DC:9C:35:98:28:D2:C7:DA:1C:38:F7:DD:2B:D2:61:D9:93:0A:08:5D:CE:BB:51:CF:1B:BC:E0:A6:90:CF:8C
a=setup:passive
a=mid:2
a=sctpmap:5000 webrtc-datachannel 1024

I checking the logs look like it stucking on the ICE state: "CHECKING" and never go to "CONNECTED" state. But with the same logic the Samsung phone can connect fine.

Please let me know if I missing something.

Thank you very much for reading and helping.

Kai Pham
  • 19
  • 3

0 Answers0