open-webrtc-toolkit / owt-client-native

Open WebRTC Toolkit client SDK for native Windows/Linux/iOS applications.
https://01.org/open-webrtc-toolkit
Apache License 2.0
385 stars 180 forks source link

publish H265 stream failed #606

Open jefferyfang opened 2 years ago

jefferyfang commented 2 years ago

tested: OWT-server 5.0.x, OWT-server master owt-client-android, ConfSampleMFC

publish H264 successfully, but H265 all failed;

CPU : Intel® Core™ i7-12700H Processor, Intel® Iris® Xe Graphics eligible

error log:

(channel.cc:892): Changing voice state, recv=0 send=0 for {mid: 0, media_type: audio} (channel.cc:1168): Setting remote video description for {mid: 1, media_type: video} (webrtc_video_engine.cc:836): SetSendParameters: {codecs: [VideoCodec[116:red], VideoCodec[118:ulpfec]], conference_mode: no, extensions: [{uri: urn:ietf:params:rtp-hdrext:toffset, id: 14}, {uri: http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 2}, {uri: http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01, id: 3}, {uri: urn:ietf:params:rtp-hdrext:sdes:mid, id: 4}, {uri: urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id, id: 5}, {uri: urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id, id: 6}], extmap-allow-mixed: false, max_bandwidth_bps: -1, mid: 1} (webrtc_video_engine.cc:213): Setting codecs without a video codec is invalid: {VideoCodec[116:red], VideoCodec[118:ulpfec]} (sdp_offer_answer.cc:4256): Failed to set remote video description send parameters for m-section with mid='1'. (INVALID_PARAMETER) (sdp_offer_answer.cc:2193): Failed to set remote answer sdp: Failed to set remote video description send parameters for m-section with mid='1'. (conferencepeerconnectionchannel.cc:356): Set remote sdp failed. (conferencepeerconnectionchannel.cc:1060): On stream error. (conferencepeerconnectionchannel.cc:1094): Close peer connection.

jefferyfang commented 2 years ago

no H265 codec in SDP:

(webrtc_video_engine.cc:1137): SetRecvParameters: {codecs: [VideoCodec[108:H264], VideoCodec[124:H264], VideoCodec[125:H264], VideoCodec[127:H264], VideoCodec[114:red], VideoCodec[115:rtx], VideoCodec[116:ulpfec], VideoCodec[121:rtx], VideoCodec[120:rtx], VideoCodec[107:rtx], VideoCodec[109:rtx]], extensions: [{uri: urn:ietf:params:rtp-hdrext:toffset, id: 14}, {uri: http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 2}, {uri: urn:3gpp:video-orientation, id: 13}, {uri: http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01, id: 3}, {uri: http://www.webrtc.org/experiments/rtp-hdrext/playout-delay, id: 12}, {uri: http://www.webrtc.org/experiments/rtp-hdrext/video-content-type, id: 11}, {uri: http://www.webrtc.org/experiments/rtp-hdrext/video-timing, id: 7}, {uri: http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07, id: 8}, {uri: http://www.webrtc.org/experiments/rtp-hdrext/color-space, id: 9}, {uri: urn:ietf:params:rtp-hdrext:sdes:mid, id: 4}, {uri: urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id, id: 5}, {uri: urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id, id: 6}]}

(webrtc_video_engine.cc:1152): Changing recv codecs from {VideoCodec[96:VP8], VideoCodec[98:VP9], VideoCodec[100:VP9], VideoCodec[102:H264], VideoCodec[104:H264], VideoCodec[106:H264], VideoCodec[108:H264], VideoCodec[110:AV1X], VideoCodec[112:H265]} to {VideoCodec[108:H264], VideoCodec[124:H264], VideoCodec[125:H264], VideoCodec[127:H264]}

(conferencepeerconnectionchannel.cc:326): SendSdp() type=offer;sdp= v=0 o=- 5877889344471065991 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 1 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:JlIu a=ice-pwd:vxYnELS/LuM8KIKKShWuctj5 a=ice-options:trickle a=fingerprint:sha-256 55:7B:8B:BD:5B:BA:81:AE:D1:31:28:B7:AC:BC:87:8C:B4:66:A8:0E:83:5C:6A:E0:60:D3:99:53:0A:53:C7:7C 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 108 124 125 127 114 115 116 121 120 107 109 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:JlIu a=ice-pwd:vxYnELS/LuM8KIKKShWuctj5 a=ice-options:trickle a=fingerprint:sha-256 55:7B:8B:BD:5B:BA:81:AE:D1:31:28:B7:AC:BC:87:8C:B4:66:A8:0E:83:5C:6A:E0:60:D3:99:53:0A:53:C7:7C 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://tools.ietf.org/html/draft-ietf-avtext-framemarking-07 a=extmap:9 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:108 H264/90000 a=rtcp-fb:108 goog-remb a=rtcp-fb:108 transport-cc a=rtcp-fb:108 ccm fir a=rtcp-fb:108 nack a=rtcp-fb:108 nack pli a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f 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=42e01f a=rtpmap:125 H264/90000 a=rtcp-fb:125 goog-remb a=rtcp-fb:125 transport-cc a=rtcp-fb:125 ccm fir a=rtcp-fb:125 nack a=rtcp-fb:125 nack pli a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f a=rtpmap:127 H264/90000 a=rtcp-fb:127 goog-remb a=rtcp-fb:127 transport-cc a=rtcp-fb:127 ccm fir a=rtcp-fb:127 nack a=rtcp-fb:127 nack pli a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f a=rtpmap:114 red/90000 a=rtpmap:115 rtx/90000 a=fmtp:115 apt=114 a=rtpmap:116 ulpfec/90000 a=rtpmap:121 rtx/90000 a=fmtp:121 apt=127 a=rtpmap:120 rtx/90000 a=fmtp:120 apt=125 a=rtpmap:107 rtx/90000 a=fmtp:107 apt=124 a=rtpmap:109 rtx/90000 a=fmtp:109 apt=108

Meonardo commented 2 years ago

Did you try to set owt::base::SetVideoHardwareAccelerationEnabled(true) before creating conferenceclient ?

Here the reference from the doc.

jefferyfang commented 2 years ago

Did you try to set owt::base::SetVideoHardwareAccelerationEnabled(true) before creating conferenceclient ?

Here the reference from the doc.

Yes, Now by default, video hardware acceleration is enabled.

jianjunz commented 2 years ago

It looks like your codec preference doesn't have HEVC included.