Skip to content
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

iOS H264 issue in janus v0.10.5 #2330

Closed
kimilpyoung opened this issue Aug 21, 2020 · 26 comments
Closed

iOS H264 issue in janus v0.10.5 #2330

kimilpyoung opened this issue Aug 21, 2020 · 26 comments
Labels

Comments

@kimilpyoung
Copy link

i used janus v0.10.5

transfer from iOS to janus video room with h264

All other devices(android, web) are visible in chromed
but ios isn't

chrome sdp just
"DOMException: Failed to execute 'setLocalDescription' on 'RTCPeerConnection': Failed to set local answer sdp: Failed to set local video description recv parameters."

this doens't happen in version 0.9.0

When creating videoroom, h264_profile was also created with 42e01f but the error is same

@atoppi
Copy link
Member

atoppi commented Aug 21, 2020

Does the same happen with Firefox or another ios device?
Would you mind sharing the SDP offer from Janus ?

@kimilpyoung
Copy link
Author

kimilpyoung commented Aug 21, 2020

Works fine in safari, So I don't think there will be any problem in iOS
The SDP below is janus' offer sdp from chrome.
When creating a videoroom, the h264_profile value was set to 42e01f.
But looking at sdp, the value doesn't seem to be applied

v=0
o=- 1598001385230822 1 IN IP4 13.x.x.x
s=VideoRoom 1
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS janus
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 13.x.x.x
a=sendonly
a=mid:audio
a=rtcp-mux
a=ice-ufrag:AUOf
a=ice-pwd:ezY5g0bQcPl+L1BPWFGMIx
a=ice-options:trickle
a=fingerprint:sha-256 39:3C:71:FD:FD:07:C4:4F:9A:37:4D:F7:6D:3C:07:F1:46:66:57:37:8C:12:16:6D:1A:C8:BC:E0:46:D3:21:E2
a=setup:actpass
a=rtpmap:111 opus/48000/2
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 urn:ietf:params:rtp-hdrext:sdes:mid
a=rtcp-fb:111 transport-cc
a=msid:janus janusa0
a=ssrc:1475790012 cname:janus
a=ssrc:1475790012 msid:janus janusa0
a=ssrc:1475790012 mslabel:janus
a=ssrc:1475790012 label:janusa0
a=candidate:1 1 udp 2015363327 13.x.x.x 12090 typ host
a=end-of-candidates
m=video 9 UDP/TLS/RTP/SAVPF 107 108
c=IN IP4 13.x.x.x
a=sendonly
a=mid:video
a=rtcp-mux
a=ice-ufrag:AUOf
a=ice-pwd:ezY5g0bQcPl+L1BPWFGMIx
a=ice-options:trickle
a=fingerprint:sha-256 39:3C:71:FD:FD:07:C4:4F:9A:37:4D:F7:6D:3C:07:F1:46:66:57:37:8C:12:16:6D:1A:C8:BC:E0:46:D3:21:E2
a=setup:actpass
a=rtpmap:107 H264/90000
a=rtcp-fb:107 ccm fir
a=rtcp-fb:107 nack
a=rtcp-fb:107 nack pli
a=rtcp-fb:107 goog-remb
a=extmap:2 urn:ietf:params:rtp-hdrext:sdes:mid
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=fmtp:107 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640c34
a=rtpmap:108 rtx/90000
a=fmtp:108 apt=107
a=ssrc-group:FID 1938225451 1542726674
a=msid:janus janusv0
a=ssrc:1938225451 cname:janus
a=ssrc:1938225451 msid:janus janusv0
a=ssrc:1938225451 mslabel:janus
a=ssrc:1938225451 label:janusv0
a=ssrc:1542726674 cname:janus
a=ssrc:1542726674 msid:janus janusv0
a=ssrc:1542726674 mslabel:janus
a=ssrc:1542726674 label:janusv0
a=candidate:1 1 udp 2015363327 13.x.x.x 12090 typ host
a=end-of-candidates

@groupboard
Copy link
Contributor

That error (Failed to execute 'setLocalDescription' on 'RTCPeerConnection') will happen if you don't have the h264 profile set properly. How exactly are you creating the room?

You should definitely be seeing 42e01f in the fmtp line if the room is set correctly, so it looks like the room doesn't have the h264_profile set. Have you also set the "videocodec" parameter to "h264" for the room?

@atoppi
Copy link
Member

atoppi commented Aug 24, 2020

@kimilpyoung setting h264_profile will not force Janus SDP to contain that profile but it will just be the preferred profile in case multiple versions exist.
Can you share the SDP offer sent by the ios client ?

@tgabi333
Copy link
Contributor

@kimilpyoung you would better to use vp8 in safari, from ios 13.5, the baseline profile (42e01f) - which is compatible with janus - had a very bad quality.

@kimilpyoung
Copy link
Author

kimilpyoung commented Aug 24, 2020

That error (Failed to execute 'setLocalDescription' on 'RTCPeerConnection') will happen if you don't have the h264 profile set properly. How exactly are you creating the room?

You should definitely be seeing 42e01f in the fmtp line if the room is set correctly, so it looks like the room doesn't have the h264_profile set. Have you also set the "videocodec" parameter to "h264" for the room?

Yes, when I made a room, I set up codec h264 and h264_profile and sent it

The sdp below is the answer sdp received from janus on ios
In this sdp, h264_profile is set to 42e01f

v=0
o=- 6407551442812636210 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:UQUb
a=ice-pwd:bDDgrF3DxHr9X70thSeE+Tg0
a=ice-options:trickle renomination
a=fingerprint:sha-256 86:59:85:39:36:35:25:5C:D6:70:6E:7A:DB:29:A0:91:64:B8:9A:4F:45:34:D4:D2:3A:28:91:59:8C:18:29:E7
a=setup:active
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10;useinbandfec=1
m=video 9 UDP/TLS/RTP/SAVPF 100 101
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:UQUb
a=ice-pwd:bDDgrF3DxHr9X70thSeE+Tg0
a=ice-options:trickle renomination
a=fingerprint:sha-256 86:59:85:39:36:35:25:5C:D6:70:6E:7A:DB:29:A0:91:64:B8:9A:4F:45:34:D4:D2:3A:28:91:59:8C:18:29:E7
a=setup:active
a=mid:video
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtpmap:100 H264/90000
a=rtcp-fb:100 goog-remb
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

@groupboard
Copy link
Contributor

Can you post your code for creating the room (or room config file). And what are the exact steps to recreate? (Connect first on browser/ios version, then on ...?)

@kimilpyoung
Copy link
Author

kimilpyoung commented Aug 25, 2020

setting h264_profile will not force Janus SDP to contain that profile but it will just be the preferred profile in case multiple versions exist.
Can you share the SDP offer sent by the ios client ?

First, this is the create command sent when creating.

var newRoom = {
"request": "create",
"room": channel,
"ptype": "publisher",
"display": ''+opaqueId,
"bitrate": bitrate,
"videoorient_ext": false,
"videocodec": "h264",
"h264_profile":"42e01f",
"publishers": 50
};

And, This is an offer sdp sent from iOS to janus.

v=0\r\no=- 1598312441093440 1 IN IP4 x.x.x.x
s=Mountpoint 1\r\nt=0 0\r\na=group:BUNDLE audio video
a=msid-semantic: WMS janus
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 x.x.x.x
a=sendonly
a=mid:audio
a=rtcp-mux
a=ice-ufrag:vCbP
a=ice-pwd:MCHrmuZHO8zHyXJVYdBm+P
a=ice-options:trickle\r\na=fingerprint:sha-256 C0:75:7B:E3:CC:FD:DA:27:45:55:A9:A4:1D:F2:86:94:37:B9:F5:4F:EF:AE:E2:09:59:7C:AD:03:F9:49:C2:FC
a=setup:actpass
a=rtpmap:111 opus 48000 2
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=msid:janus janusa0
a=ssrc:306353742 cname:janus
a=ssrc:306353742 msid:janus janusa0
a=ssrc:306353742 mslabel:janus
a=ssrc:306353742 label:janusa0
a=candidate:1 1 udp 2015363327 x.x.x.x 19074 typ host
a=end-of-candidates
m=video 9 UDP/TLS/RTP/SAVPF 100 101
c=IN IP4 x.x.x.x
a=sendonly
a=mid:video
a=rtcp-mux
a=ice-ufrag:vCbP
a=ice-pwd:MCHrmuZHO8zHyXJVYdBm+P
a=ice-options:trickle\r\na=fingerprint:sha-256 C0:75:7B:E3:CC:FD:DA:27:45:55:A9:A4:1D:F2:86:94:37:B9:F5:4F:EF:AE:E2:09:59:7C:AD:03:F9:49:C2:FC
a=setup:actpass
a=rtpmap:100 H264/90000
a=fmtp:100 packetization-mode=1;
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=ssrc-group:FID 1122506908 1753778864
a=msid:janus janusv0
a=ssrc:1122506908 cname:janus
a=ssrc:1122506908 msid:janus janusv0
a=ssrc:1122506908 mslabel:janus
a=ssrc:1122506908 label:janusv0
a=ssrc:1753778864 cname:janus
a=ssrc:1753778864 msid:janus janusv0
a=ssrc:1753778864 mslabel:janus
a=ssrc:1753778864 label:janusv0
a=candidate:1 1 udp 2015363327 x.x.x.x 19074 typ host
a=end-of-candidates

@kimilpyoung
Copy link
Author

kimilpyoung commented Aug 25, 2020

Can you post your code for creating the room (or room config file). And what are the exact steps to recreate? (Connect first on browser/ios version, then on ...?)

After creating a room with iOS, access the room with chrome

@kimilpyoung
Copy link
Author

Sorry for the wrong click.

@groupboard
Copy link
Contributor

groupboard commented Aug 25, 2020

Seems to work fine for me when I do that. What device are you running chrome on? Do you get a "success" reply to that message and then join the room? Also, just note that "ptype" is an invalid parameter for the "create" message. I'm not sure if it matters, but you could try removing that.

Also just bear in mind that if the room already exists, "create" won't do anything, so try stopping and starting janus to make sure no old rooms exist (or delete all empty rooms if you don't want to restart the server).

@kimilpyoung
Copy link
Author

kimilpyoung commented Aug 25, 2020

Seems to work fine for me when I do that. What device are you running chrome on? Do you get a "success" reply to that message and then join the room? Also, just note that "ptype" is an invalid parameter for the "create" message. I'm not sure if it matters, but you could try removing that.

Also just bear in mind that if the room already exists, "create" won't do anything, so try stopping and starting janus to make sure no old rooms exist (or delete all empty rooms if you don't want to restart the server).

The device running chrome is mac (os X)
And iOS is using native library(libjingle).

Both the server and the app print a successful message

And, The server keeps restarting to recreate the videoroom.
I tried running it with chrome on window, but the issue is the same.

@atoppi
Copy link
Member

atoppi commented Aug 25, 2020

@kimilpyoung

And, This is an offer sdp sent from iOS to janus.

v=0\r\no=- 1598312441093440 1 IN IP4 x.x.x.x
s=Mountpoint 1\r\nt=0 0\r\na=group:BUNDLE audio video
a=msid-semantic: WMS janus
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 x.x.x.x
a=sendonly
a=mid:audio
a=rtcp-mux
a=ice-ufrag:vCbP
a=ice-pwd:MCHrmuZHO8zHyXJVYdBm+P
a=ice-options:trickle\r\na=fingerprint:sha-256 C0:75:7B:E3:CC:FD:DA:27:45:55:A9:A4:1D:F2:86:94:37:B9:F5:4F:EF:AE:E2:09:59:7C:AD:03:F9:49:C2:FC
a=setup:actpass
a=rtpmap:111 opus 48000 2
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=msid:janus janusa0
a=ssrc:306353742 cname:janus
a=ssrc:306353742 msid:janus janusa0
a=ssrc:306353742 mslabel:janus
a=ssrc:306353742 label:janusa0
a=candidate:1 1 udp 2015363327 x.x.x.x 19074 typ host
a=end-of-candidates
m=video 9 UDP/TLS/RTP/SAVPF 100 101
c=IN IP4 x.x.x.x
a=sendonly
a=mid:video
a=rtcp-mux
a=ice-ufrag:vCbP
a=ice-pwd:MCHrmuZHO8zHyXJVYdBm+P
a=ice-options:trickle\r\na=fingerprint:sha-256 C0:75:7B:E3:CC:FD:DA:27:45:55:A9:A4:1D:F2:86:94:37:B9:F5:4F:EF:AE:E2:09:59:7C:AD:03:F9:49:C2:FC
a=setup:actpass
a=rtpmap:100 H264/90000
a=fmtp:100 packetization-mode=1;
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=ssrc-group:FID 1122506908 1753778864
a=msid:janus janusv0
a=ssrc:1122506908 cname:janus
a=ssrc:1122506908 msid:janus janusv0
a=ssrc:1122506908 mslabel:janus
a=ssrc:1122506908 label:janusv0
a=ssrc:1753778864 cname:janus
a=ssrc:1753778864 msid:janus janusv0
a=ssrc:1753778864 mslabel:janus
a=ssrc:1753778864 label:janusv0
a=candidate:1 1 udp 2015363327 x.x.x.x 19074 typ host
a=end-of-candidates

This does NOT look like an offer from your client. Are you sure ?

@kimilpyoung
Copy link
Author

뿡 빵뀨

그리고 이것은 iOS에서 janus로 보낸 제안 sdp입니다.

v=0\r\no=- 1598312441093440 1 IN IP4 x.x.x.x
s=Mountpoint 1\r\nt=0 0\r\na=group:BUNDLE audio video
a=msid-semantic: WMS janus
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 x.x.x.x
a=sendonly
a=mid:audio
a=rtcp-mux
a=ice-ufrag:vCbP
a=ice-pwd:MCHrmuZHO8zHyXJVYdBm+P
a=ice-options:trickle\r\na=fingerprint:sha-256 C0:75:7B:E3:CC:FD:DA:27:45:55:A9:A4:1D:F2:86:94:37:B9:F5:4F:EF:AE:E2:09:59:7C:AD:03:F9:49:C2:FC
a=setup:actpass
a=rtpmap:111 opus 48000 2
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=msid:janus janusa0
a=ssrc:306353742 cname:janus
a=ssrc:306353742 msid:janus janusa0
a=ssrc:306353742 mslabel:janus
a=ssrc:306353742 label:janusa0
a=candidate:1 1 udp 2015363327 x.x.x.x 19074 typ host
a=end-of-candidates
m=video 9 UDP/TLS/RTP/SAVPF 100 101
c=IN IP4 x.x.x.x
a=sendonly
a=mid:video
a=rtcp-mux
a=ice-ufrag:vCbP
a=ice-pwd:MCHrmuZHO8zHyXJVYdBm+P
a=ice-options:trickle\r\na=fingerprint:sha-256 C0:75:7B:E3:CC:FD:DA:27:45:55:A9:A4:1D:F2:86:94:37:B9:F5:4F:EF:AE:E2:09:59:7C:AD:03:F9:49:C2:FC
a=setup:actpass
a=rtpmap:100 H264/90000
a=fmtp:100 packetization-mode=1;
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=ssrc-group:FID 1122506908 1753778864
a=msid:janus janusv0
a=ssrc:1122506908 cname:janus
a=ssrc:1122506908 msid:janus janusv0
a=ssrc:1122506908 mslabel:janus
a=ssrc:1122506908 label:janusv0
a=ssrc:1753778864 cname:janus
a=ssrc:1753778864 msid:janus janusv0
a=ssrc:1753778864 mslabel:janus
a=ssrc:1753778864 label:janusv0
a=candidate:1 1 udp 2015363327 x.x.x.x 19074 typ host
a=end-of-candidates

이것은 귀하의 고객의 제안처럼 보이지 않습니다. 확실합니까 ?

This Sdp is created by iOS.

@lminiero
Copy link
Member

This Sdp is created by iOS.

It clearly isn't, since it has janus all over. That's the SDP sent by Janus. As a side note, as explicitly written in the guidelines, please do NOT paste huge bunches of text (including SDPs) inline here, but use pastebin/gist or something else instead.

@kimilpyoung
Copy link
Author

kimilpyoung commented Aug 31, 2020

Sorry. Confused with another sdp.
Real Offer sdp is this url :
sdp_pastebin

42e01f profile doesn't seem to be suggested

Does this suggestion differ from the 0.9.5 and 0.10.5 versions of Janus?

It's about the part that applies to the server.

@lminiero
Copy link
Member

If the device doesn't offer that profile, how is Janus expected to set it in the answer?

@atoppi
Copy link
Member

atoppi commented Aug 31, 2020

as a side note: while checking this issue we have found out and fixed a problem that caused Janus to reject the video m-line if a participant tries to publish himself for a second time using a h264 profile different from the one configured in the video room.

@kimilpyoung
Copy link
Author

If the device doesn't offer that profile, how is Janus expected to set it in the answer?

It was a question of whether there was any change in the way it was handled in the previous version.
Based on the suggested profile, janus will set up an answer.

@kimilpyoung
Copy link
Author

as a side note: while checking this issue we have found out and fixed a problem that caused Janus to reject the video m-line if a participant tries to publish himself for a second time using a h264 profile different from the one configured in the video room.

Thank you. We will try again with the latest version of the commit

@lminiero
Copy link
Member

lminiero commented Sep 1, 2020

It was a question of whether there was any change in the way it was handled in the previous version.
Based on the suggested profile, janus will set up an answer.

The only change is that Janus now allows plugins to prefer a profile over another, which is what we try to do. If the profile isn't there, though (which is your case), we'll answer with the first profile we find (which is what we did before).

@amnonbb
Copy link
Contributor

amnonbb commented Sep 1, 2020

#2211
The same problem here for Safari and Firefox. In my case i use h264 codec. So i don't know what happen with others (vp8, vp9)

@kimilpyoung
Copy link
Author

But... It doesn't seem to be resolved yet.

Let’s try and find the cause

@atoppi
Copy link
Member

atoppi commented Sep 7, 2020

As already mentioned, there is nothing wrong in Janus here.
Your iOS client seems to offer a h264 profile different from the common 42e01f (aka baseline 3.1).

Try to use 42e034 (aka baseline 5.2) in the room configuration as it is the only baseline profile offered by your client.
Hopefully Chrome and other non-iOS clients will support that.
If that's not the case, I'm afraid there is nothing much we can do.

@lminiero
Copy link
Member

lminiero commented Sep 7, 2020

Closing as not an issue.

@lminiero lminiero closed this as completed Sep 7, 2020
@ikallali
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants