very low video quality and bitrate when publishing from IPhone #2225
Unanswered
alexpokotilo
asked this question in
General
Replies: 1 comment
-
Hi all, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've made simple sfu based on pion example to receive webrtc streams from browser.
During testing I noticed that when I publish 1 video+ 1 audio stream using IPhone(tested on IPhone X and IPhone 13 both with IOS 15.4) I always get ~300K bitrate and it doesn't increase in time. It doesn't matter what resolution I set using constraints: 640x480 or 1280x720, I always get resulting stream bitrate no more than ~300K. If I run the same web page on IPad, all work as expected and stream bitrate is enough to stream in good quality. PC works fine as well. All devices are in the same network.
I check webrtc bitrate using "iftop" so I see exact bitrate on webrtc port.
How to debug this case ?
I enabled PION_LOG_TRACE=all and got logs below, but I don't see anything related to packet drops or anything what would signal any server-side problems.
pc INFO: 2022/05/18 12:57:02 signaling state changed to have-remote-offer
ice TRACE: 12:57:02.749702 agent.go:571: Set selected candidate pair:
ice DEBUG: 12:57:02.749748 agent.go:457: Started agent: isControlling? false, remoteUfrag: "A0Ya", remotePwd: "fmu4T2f/u1JFXxeSapTdtUEZ"
ice INFO: 2022/05/18 12:57:02 Setting new connection state: Checking
pc INFO: 2022/05/18 12:57:02 signaling state changed to stable
pc INFO: 2022/05/18 12:57:02 ICE connection state changed: checking
ice DEBUG: 12:57:02.777012 agent.go:1111: adding a new peer-reflexive candidate: 192.168.0.104:61098
ice TRACE: 12:57:02.777087 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:02.777232 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:02.785478 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:02.785545 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice TRACE: 12:57:02.827857 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:02.827941 agent.go:571: Set selected candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice INFO: 2022/05/18 12:57:02 Setting new connection state: Connected
ice TRACE: 12:57:02.828080 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
pc INFO: 2022/05/18 12:57:02 ICE connection state changed: connected
dtls TRACE: 12:57:02.828431 handshaker.go:166: [handshake:server] Flight 0: Preparing
dtls TRACE: 12:57:02.828468 handshaker.go:166: [handshake:server] Flight 0: Sending
dtls TRACE: 12:57:02.828493 handshaker.go:166: [handshake:server] Flight 0: Waiting
dtls TRACE: 12:57:02.828691 handshaker.go:282: [handshake:server] Flight 0 -> Flight 2
dtls TRACE: 12:57:02.828705 handshaker.go:166: [handshake:server] Flight 2: Preparing
dtls TRACE: 12:57:02.828715 handshaker.go:166: [handshake:server] Flight 2: Sending
dtls TRACE: 12:57:02.828727 conn.go:387: [handshake:server] -> HelloVerifyRequest (epoch: 0, seq: 0)
dtls TRACE: 12:57:02.828804 handshaker.go:166: [handshake:server] Flight 2: Waiting
dtls TRACE: 12:57:02.834435 handshaker.go:282: [handshake:server] Flight 2 -> Flight 2
dtls TRACE: 12:57:02.834471 handshaker.go:166: [handshake:server] Flight 2: Preparing
dtls TRACE: 12:57:02.834489 handshaker.go:166: [handshake:server] Flight 2: Sending
dtls TRACE: 12:57:02.834508 conn.go:387: [handshake:server] -> HelloVerifyRequest (epoch: 0, seq: 0)
dtls TRACE: 12:57:02.834589 handshaker.go:166: [handshake:server] Flight 2: Waiting
ice TRACE: 12:57:02.878169 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:02.878368 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:02.879448 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:02.879517 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
dtls TRACE: 12:57:02.879638 handshaker.go:282: [handshake:server] Flight 2 -> Flight 4
dtls TRACE: 12:57:02.879659 handshaker.go:166: [handshake:server] Flight 4: Preparing
dtls TRACE: 12:57:02.879890 handshaker.go:166: [handshake:server] Flight 4: Sending
dtls TRACE: 12:57:02.879920 conn.go:387: [handshake:server] -> ServerHello (epoch: 0, seq: 1)
dtls TRACE: 12:57:02.879950 conn.go:387: [handshake:server] -> TypeCertificate (epoch: 0, seq: 2)
dtls TRACE: 12:57:02.879971 conn.go:387: [handshake:server] -> ServerKeyExchange (epoch: 0, seq: 3)
dtls TRACE: 12:57:02.879987 conn.go:387: [handshake:server] -> CertificateRequest (epoch: 0, seq: 4)
dtls TRACE: 12:57:02.880008 conn.go:387: [handshake:server] -> ServerHelloDone (epoch: 0, seq: 5)
dtls TRACE: 12:57:02.880139 handshaker.go:166: [handshake:server] Flight 4: Waiting
ice TRACE: 12:57:02.882538 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:02.882573 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
dtls DEBUG: 12:57:02.885957 conn.go:736: CipherSuite not initialized, queuing packet
dtls DEBUG: 12:57:02.885986 conn.go:658: received packet of next epoch, queuing packet
dtls TRACE: 12:57:02.886555 conn.go:742: server: <- ChangeCipherSpec (epoch: 1)
dtls TRACE: 12:57:02.886593 handshaker.go:282: [handshake:server] Flight 4 -> Flight 6
dtls TRACE: 12:57:02.886606 handshaker.go:166: [handshake:server] Flight 6: Preparing
dtls TRACE: 12:57:02.886643 handshaker.go:234: [handshake:server] -> changeCipherSpec (epoch: 1)
dtls TRACE: 12:57:02.886655 handshaker.go:166: [handshake:server] Flight 6: Sending
dtls TRACE: 12:57:02.886667 conn.go:387: [handshake:server] -> Finished (epoch: 1, seq: 6)
dtls TRACE: 12:57:02.886757 handshaker.go:166: [handshake:server] Flight 6: Finished
dtls TRACE: 12:57:02.886781 conn.go:216: Handshake Completed
pc INFO: 2022/05/18 12:57:02 peer connection state changed: connected
pc DEBUG: 12:57:02.913027 peerconnection.go:456: got new track: &{mu:{w:{state:0 sema:0} writerSem:0 readerSem:0 readerCount:0 readerWait:0} id:89d907f8-c259-4541-a0b0-48e9cb1fae1c streamID:b56739f7-4648-434f-a814-c9efbb3baab7 payloadType:111 kind:1 ssrc:3238491918 codec:{RTPCodecCapability:{MimeType:audio/opus ClockRate:48000 Channels:2 SDPFmtpLine:minptime=10;useinbandfec=1 RTCPFeedback:[{Type:transport-cc Parameter:}]} PayloadType:111 statsID:} params:{HeaderExtensions:[{URI:http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 ID:4}] Codecs:[{RTPCodecCapability:{MimeType:audio/opus ClockRate:48000 Channels:2 SDPFmtpLine:minptime=10;useinbandfec=1 RTCPFeedback:[{Type:transport-cc Parameter:}]} PayloadType:111 statsID:}]} rid: receiver:0xc0001b02a0 peeked:[144 239 90 179 81 173 153 171 193 7 119 14 190 222 0 1 65 0 1 0 120 12 111 168 200 72 179 1 21 41 229 225 127 24 83 248 141 94 35 138 243 101 159 255 226 230 1 241 207 162 65 224 97 1 0 157 75 207 83 67 208 165 232 12 137 223 59 95 13 58 37 34 134 222 241 173 89 66 2 37] peekedAttributes:map[0:0xc000252410]}
pc DEBUG: 12:57:02.973127 peerconnection.go:456: got new track: &{mu:{w:{state:0 sema:0} writerSem:0 readerSem:0 readerCount:0 readerWait:0} id:ac974be9-7861-4678-a0bf-d9e51a2215f7 streamID:b56739f7-4648-434f-a814-c9efbb3baab7 payloadType:98 kind:2 ssrc:1881413106 codec:{RTPCodecCapability:{MimeType:video/H264 ClockRate:90000 Channels:0 SDPFmtpLine:level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f RTCPFeedback:[{Type:goog-remb Parameter:} {Type:transport-cc Parameter:} {Type:ccm Parameter:fir} {Type:nack Parameter:} {Type:nack Parameter:pli}]} PayloadType:98 statsID:} params:{HeaderExtensions:[{URI:http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 ID:4}] Codecs:[{RTPCodecCapability:{MimeType:video/H264 ClockRate:90000 Channels:0 SDPFmtpLine:level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f RTCPFeedback:[{Type:goog-remb Parameter:} {Type:transport-cc Parameter:} {Type:ccm Parameter:fir} {Type:nack Parameter:} {Type:nack Parameter:pli}]} PayloadType:98 statsID:}]} rid: receiver:0xc0001b0240 peeked:[144 98 0 49 95 140 101 211 112 36 21 242 190 222 0 1 65 0 5 0 56 0 19 39 66 192 31 137 138 8 3 192 163 77 192 128 128 129 225 16 140 33 0 4 40 206 60 128] peekedAttributes:map[0:0xc000252730]}
ice TRACE: 12:57:03.933710 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:03.933855 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:04.004849 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:04.004935 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice TRACE: 12:57:04.937887 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:04.938036 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:04.942618 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:04.942672 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice TRACE: 12:57:07.452052 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:07.452242 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:07.501775 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:07.501856 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice TRACE: 12:57:09.966548 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:09.966719 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:10.075781 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:10.075856 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice TRACE: 12:57:12.476038 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:12.476157 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:12.551221 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:12.551269 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice TRACE: 12:57:14.985480 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:14.985619 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:14.993013 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:14.993065 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice TRACE: 12:57:17.502745 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:17.502898 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:17.507818 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:17.507871 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice TRACE: 12:57:20.008292 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:20.008453 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:20.046051 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:20.046104 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice TRACE: 12:57:22.526360 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:22.526507 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:22.612879 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:22.612932 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
ice TRACE: 12:57:25.039492 agent.go:1115: inbound STUN (Request) from 192.168.0.104:61098 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:25.039723 agent.go:964: ping STUN from udp4 host 192.168.0.117:51790 to udp4 prflx 192.168.0.104:61098 related :0
ice TRACE: 12:57:25.044128 selection.go:221: inbound STUN (SuccessResponse) from udp4 prflx 192.168.0.104:61098 related :0 to udp4 host 192.168.0.117:51790
ice TRACE: 12:57:25.044176 selection.go:231: Found valid candidate pair: prio 7998392936314175487 (local, prio 2130706431) udp4 host 192.168.0.117:51790 <-> udp4 prflx 192.168.0.104:61098 related :0 (remote, prio 1862270975)
Javascript part is very simple https://github.com/Softvelum/webrtcjs/blob/master/src/index.js
In my tests, I tried both to set bandwidth constraints using 'sender.setParameters' and don't set bandwidth constrains and get the same result. webrtc stream from Iphone have bad quality and bitrate but IPad and PC works fine on the same local network
Beta Was this translation helpful? Give feedback.
All reactions