<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">OK, doing it manually works great. And fast. <div class=""><br class=""></div><div class="">Just the commented part doesn't work, since "trans" is None. That's why the OFFER goes out with "sendrecv"</div><div class=""><br class=""></div><div class="">The "get-transceivers" returns a GArray, but I wouldn't know how to subscribe this in Python...</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><div class=""> <span style="color: #210de5;font-weight: bold;" class="">def</span> <span style="color: #1200bb;" class="">start_pipeline</span>(<span style="color: #ab3c11;font-style: italic;" class="">self</span>):</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin <span style="color: #7f0055;" class="">=</span> Gst.ElementFactory.make(<span style="color: #ba2500;" class="">"webrtcbin"</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin.set_property(<span style="color: #ba2500;" class="">"bundle-policy"</span>, <span style="color: #ba2500;" class="">"max-bundle"</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin.set_property(<span style="color: #ba2500;" class="">"stun-server"</span>, <span style="color: #ba2500;" class="">"<a href="stun://stun.l.google.com:19302" class="">stun://stun.l.google.com:19302</a>"</span>)</div><div class=""> <span style="color: #00950e;font-style: italic;" class=""># if Gst.version().major >= 1 and Gst.version().minor >= 17:</span></div><div class=""> <span style="color: #00950e;font-style: italic;" class=""># trans = self.webrtcbin.emit('get-transceiver', 0)</span></div><div class=""> <span style="color: #00950e;font-style: italic;" class=""># print(trans)</span></div><div class=""> </div><div class=""> <span style="color: #00950e;font-style: italic;" class=""># if self.direction == 'sendonly':</span></div><div class=""> <span style="color: #00950e;font-style: italic;" class=""># trans.set_property('direction', GstWebRTC.WebRTCRTPTransceiverDirection.SENDONLY)</span></div><div class=""> <span style="color: #00950e;font-style: italic;" class=""># elif self.direction == 'recvonly':</span></div><div class=""> <span style="color: #00950e;font-style: italic;" class=""># trans.set_property('direction', GstWebRTC.WebRTCRTPTransceiverDirection.RECVONLY)</span></div><div class=""> <span style="color: #00950e;font-style: italic;" class=""># else:</span></div><div class=""> <span style="color: #00950e;font-style: italic;" class=""># trans.set_property('direction', GstWebRTC.WebRTCRTPTransceiverDirection.SENDRECV)</span></div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin.connect(<span style="color: #d126d1;" class="">'on-negotiation-needed'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.on_negotiation_needed) </div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin.connect(<span style="color: #d126d1;" class="">'on-ice-candidate'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.on_ice_candidate)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin.connect(<span style="color: #d126d1;" class="">'pad-added'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.on_pad_added)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin.connect(<span style="color: #d126d1;" class="">'notify::connection-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.on_connection_state)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin.connect(<span style="color: #d126d1;" class="">'notify::signaling-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.on_signaling_state)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin.connect(<span style="color: #d126d1;" class="">'notify::ice-connection-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.on_ice_connection_state)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin.connect(<span style="color: #d126d1;" class="">'notify::ice-gathering-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.on_ice_gathering_state)</div><br class=""><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.pipeline <span style="color: #7f0055;" class="">=</span> Gst.Pipeline.new()</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.pipeline.add(<span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin)</div><br class=""><div class=""> videotestsrc <span style="color: #7f0055;" class="">=</span> Gst.ElementFactory.make(<span style="color: #ba2500;" class="">"videotestsrc"</span>, <span style="color: #ba2500;" class="">"videotestsrc"</span>)</div><div class=""> videotestsrc.set_property(<span style="color: #ba2500;" class="">"is-live"</span>, <span style="color: #0a9dff;" class="">True</span>)</div><div class=""> videotestsrc.set_property(<span style="color: #ba2500;" class="">"pattern"</span>, <span style="color: #ba2500;" class="">"ball"</span>)</div><br class=""><div class=""> videoconvert <span style="color: #7f0055;" class="">=</span> Gst.ElementFactory.make(<span style="color: #ba2500;" class="">"videoconvert"</span>, <span style="color: #ba2500;" class="">"videoconvert"</span>)</div><div class=""> vp8enc <span style="color: #7f0055;" class="">=</span> Gst.ElementFactory.make(<span style="color: #ba2500;" class="">"vp8enc"</span>, <span style="color: #ba2500;" class="">"vp8enc"</span>)</div><div class=""> vp8enc.set_property(<span style="color: #ba2500;" class="">"deadline"</span>, <span style="color: #ff8000;" class="">1</span>)</div><br class=""><div class=""> rtpvp8pay <span style="color: #7f0055;" class="">=</span> Gst.ElementFactory.make(<span style="color: #ba2500;" class="">"rtpvp8pay"</span>, <span style="color: #ba2500;" class="">"rtpvp8pay"</span>)</div><br class=""><div class=""> rtpvp8pay_caps <span style="color: #7f0055;" class="">=</span> Gst.caps_from_string(<span style="color: #ba2500;" class="">"application/x-rtp"</span>)</div><div class=""> rtpvp8pay_caps.set_value(<span style="color: #ba2500;" class="">"media"</span>, <span style="color: #ba2500;" class="">"video"</span>)</div><div class=""> rtpvp8pay_caps.set_value(<span style="color: #ba2500;" class="">"encoding-name"</span>, <span style="color: #ba2500;" class="">"VP8"</span>)</div><br class=""><div class=""> rtpvp8pay_caps_filter <span style="color: #7f0055;" class="">=</span> Gst.ElementFactory.make(<span style="color: #ba2500;" class="">"capsfilter"</span>)</div><div class=""> rtpvp8pay_caps_filter.set_property(<span style="color: #ba2500;" class="">"caps"</span>, rtpvp8pay_caps)</div><br class=""><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.pipeline.add(videotestsrc)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.pipeline.add(videoconvert)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.pipeline.add(vp8enc)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.pipeline.add(rtpvp8pay)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.pipeline.add(rtpvp8pay_caps_filter)</div><br class=""><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">if</span> <span style="color: #7f0055;" class="">not</span> <a href="http://Gst.Element.link" class="">Gst.Element.link</a>(videotestsrc, videoconvert):</div><div class=""> <font color="#7f0055" class=""><span style="caret-color: rgb(127, 0, 85);" class=""><b class="">print</b></span></font>(<span style="color: #ba2500;" class="">"Failed to link videotestsrc -> videoconvert"</span>)</div><br class=""><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">if</span> <span style="color: #7f0055;" class="">not</span> <a href="http://Gst.Element.link" class="">Gst.Element.link</a>(videoconvert, vp8enc):</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">print</span>(<span style="color: #ba2500;" class="">"Failed to link videoconvert -> vp8enc"</span>)</div><br class=""><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">if</span> <span style="color: #7f0055;" class="">not</span> <a href="http://Gst.Element.link" class="">Gst.Element.link</a>(vp8enc, rtpvp8pay):</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">print</span>(<span style="color: #ba2500;" class="">"Failed to link vp8enc -> rtpvp8pay"</span>)</div><br class=""><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">if</span> <span style="color: #7f0055;" class="">not</span> <a href="http://Gst.Element.link" class="">Gst.Element.link</a>(rtpvp8pay, rtpvp8pay_caps_filter):</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">print</span>(<span style="color: #ba2500;" class="">"Failed to link rtpvp8pay -> rtpvp8pay_caps_filter"</span>)</div><br class=""><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">if</span> <span style="color: #7f0055;" class="">not</span> <a href="http://Gst.Element.link" class="">Gst.Element.link</a>(rtpvp8pay_caps_filter, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin):</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">print</span>(<span style="color: #ba2500;" class="">"Failed to link rtpvp8pay_caps_filter -> self.webrtcbin"</span>)</div><br class=""><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.pipeline.add(<span style="color: #7f0055;font-weight: bold;" class="">self</span>.webrtcbin)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.pipeline.set_state(Gst.State.PLAYING)</div><br class=""></div></div><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><br class=""></div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 17.08.2021 um 15:38 schrieb Neil Young <<a href="mailto:foreverneilyoung@googlemail.com" class="">foreverneilyoung@googlemail.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I'm trying to refactor some working sample code which is using this pattern:<div class=""><br class=""></div><div class="">- A webrtcbin pipeline is created from string</div><div class="">- The "on_negotiation_needed" callback triggers the OFFER creation.</div><div class=""><br class=""></div><div class="">Basically this is the Python code, which appears in many forms on the Internet and is originated from one of the GStreamer sample codes:</div><div class=""><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><span style="color: #00950e;font-style: italic;" class=""><br class=""></span></div><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><div style="line-height: 21px;" class=""><div class=""><span style="color: #006078;" class="">PIPELINE_TEST_VP8</span> <span style="color: #7f0055;" class="">=</span> '''</div><div class="">webrtcbin name=webrtcbin bundle-policy=max-bundle stun-server=<a href="stun://stun.l.google.com:19302" class="">stun://stun.l.google.com:19302</a></div><div class="">videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! queue ! rtpvp8pay !</div><div class="">queue ! application/x-rtp,media=video,encoding-name=VP8 ! webrtcbin.</div><div class="">'''</div><br class=""></div></div></div><div class=""><br class=""></div><div class=""><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><div class=""> <span style="color: #210de5;font-weight: bold;" class="">def</span> <span style="color: #1200bb;" class="">start_pipeline</span>(<span style="color: #ab3c11;font-style: italic;" class="">self</span>):</div><div class=""> <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">self</span>.<span style="color: rgb(38, 92, 209);" class="">pipe</span> <span style="color: rgb(127, 0, 85);" class="">=</span> Gst.parse_launch(<span style="color: rgb(0, 96, 120);" class="">PIPELINE_TEST_VP8</span>)</div><div class=""> <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">self</span>.<span style="color: rgb(38, 92, 209);" class="">webrtcbin</span> <span style="color: rgb(127, 0, 85);" class="">=</span> <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">self</span>.<span style="color: rgb(38, 92, 209);" class="">pipe</span>.get_by_name(<span style="color: rgb(209, 38, 209);" class="">'webrtcbin'</span>)</div><div style="line-height: 21px;" class=""><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">if</span> Gst.version().<span style="color: #265cd1;" class="">major</span> <span style="color: #7f0055;font-weight: bold;" class="">>=</span> <span style="color: #ff8000;" class="">1</span> <span style="color: #7f0055;" class="">and</span> Gst.version().<span style="color: #265cd1;" class="">minor</span> <span style="color: #7f0055;font-weight: bold;" class="">>=</span> <span style="color: #ff8000;" class="">17</span>:</div><div class=""> trans <span style="color: #7f0055;" class="">=</span> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.emit(<span style="color: #d126d1;" class="">'get-transceiver'</span>, <span style="color: #ff8000;" class="">0</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">if</span> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">direction</span> <span style="color: #7f0055;font-weight: bold;" class="">==</span> <span style="color: #d126d1;" class="">'sendonly'</span>:</div><div class=""> trans.set_property(<span style="color: #d126d1;" class="">'direction'</span>, GstWebRTC.<span style="color: #265cd1;" class="">WebRTCRTPTransceiverDirection</span>.<span style="color: #006078;" class="">SENDONLY</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">elif</span> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">direction</span> <span style="color: #7f0055;font-weight: bold;" class="">==</span> <span style="color: #d126d1;" class="">'recvonly'</span>:</div><div class=""> trans.set_property(<span style="color: #d126d1;" class="">'direction'</span>, GstWebRTC.<span style="color: #265cd1;" class="">WebRTCRTPTransceiverDirection</span>.<span style="color: #006078;" class="">RECVONLY</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">else</span>:</div><div class=""> trans.set_property(<span style="color: #d126d1;" class="">'direction'</span>, GstWebRTC.<span style="color: #265cd1;" class="">WebRTCRTPTransceiverDirection</span>.<span style="color: #006078;" class="">SENDRECV</span>)</div><div class=""></div></div><div class=""> <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">self</span>.<span style="color: rgb(38, 92, 209);" class="">webrtcbin</span>.connect(<span style="color: rgb(209, 38, 209);" class="">'on-negotiation-needed'</span>, <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">self</span>.<span style="color: rgb(38, 92, 209);" class="">on_negotiation_needed</span>) </div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'on-ice-candidate'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_ice_candidate</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'pad-added'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_pad_added</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'notify::connection-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_connection_state</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'notify::signaling-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_signaling_state</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'notify::ice-connection-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_ice_connection_state</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'notify::ice-gathering-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_ice_gathering_state</span>)</div><div class=""> <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">self</span>.<span style="color: rgb(38, 92, 209);" class="">pipe</span>.set_state(Gst.<span style="color: rgb(38, 92, 209);" class="">State</span>.<span style="color: rgb(0, 96, 120);" class="">PLAYING</span>)</div><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><br class=""></div>The offer looks good and is answered correctly, video flows.</div></div><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255); line-height: 21px;" class=""><font face="Fira Code, Menlo, Monaco, Courier New, monospace, Menlo, Monaco, Courier New, monospace" class=""><span style="white-space: pre;" class="">v=0
o=- 7638256982687930899 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
a=group:BUNDLE video0
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=setup:actpass
a=ice-ufrag:bGQItiwLYlgcID/WCvvmBOvCOn7T5c/I
a=ice-pwd:7XItJ6VJFOoh8jcwd4Rvq34OW1/KYRSD
a=rtcp-mux
a=rtcp-rsize
a=sendrecv
a=rtpmap:96 H264/90000
a=rtcp-fb:96 nack pli
a=framerate:30
a=fmtp:96 packetization-mode=1;profile-level-id=42c01e;sprop-parameter-sets=Z0LAHtkAoD2wFqDAwNSgAAADACAAAAeR4sXJ,aMuMsg==
a=ssrc:480748954 msid:user4125901687@host-1eadd0cf webrtctransceiver0
a=ssrc:480748954 cname:user4125901687@host-1eadd0cf
a=mid:video0
a=fingerprint:sha-256 54:82:06:0C:5D:7C:47:63:C2:1A:8D:D0:CC:0E:9D:20:47:A8:6C:B0:CF:31:74:0D:E2:5F:D6:D9:F5:21:D5:94</span></font><span style="font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">
</span></div><div class=""><br class=""></div><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255); line-height: 21px;" class="">Because this approach of a pre-canned pipeline seems to have difficulties in a mode, in which I try to ANSWER an incoming OFFER I was trying to refactor it and split the webrtcbin object generation from the input pipeline.</div><div style="background-color: rgb(255, 255, 255); line-height: 21px;" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255); line-height: 21px;" class=""><div style="font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><div class=""><span style="color: #006078;" class="">PIPELINE_TEST_VP8_2</span> <span style="color: #7f0055;" class="">=</span> '''</div><div class="">videotestsrc is-live=true pattern=ball ! </div><div class="">videoconvert ! </div><div class="">queue ! </div><div class="">vp8enc deadline=1 ! </div><div class="">queue ! </div><div class="">rtpvp8pay ! </div><div class="">queue ! </div><div class="">application/x-rtp,media=video,encoding-name=VP8 ! </div><div class="">webrtcbin</div><div class="">'''</div></div></div><div style="background-color: rgb(255, 255, 255); line-height: 21px;" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255); line-height: 21px;" class=""><div style="font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><div class=""> <span style="color: #210de5;font-weight: bold;" class="">def</span> <span style="color: #1200bb;" class="">start_pipeline</span>(<span style="color: #ab3c11;font-style: italic;" class="">self</span>):</div><div class=""> <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">self</span>.<span style="color: rgb(38, 92, 209);" class="">pipe</span> <span style="color: rgb(127, 0, 85);" class="">=</span> Gst.parse_launch(<span style="color: rgb(0, 96, 120);" class="">PIPELINE_TEST_VP8_2</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span> <span style="color: #7f0055;" class="">=</span> Gst.<span style="color: #265cd1;" class="">ElementFactory</span>.make(<span style="color: #d126d1;" class="">"webrtcbin"</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.set_property(<span style="color: #d126d1;" class="">"bundle-policy"</span>, <span style="color: #d126d1;" class="">"max-bundle"</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.set_property(<span style="color: #d126d1;" class="">"name"</span>, <span style="color: #d126d1;" class="">"webrtcbin"</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.set_property(<span style="color: #d126d1;" class="">"stun-server"</span>, <span style="color: #d126d1;" class="">"<a href="stun://stun.l.google.com:19302" class="">stun://stun.l.google.com:19302</a>"</span>)</div><div class=""> <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">if</span> Gst.version().<span style="color: rgb(38, 92, 209);" class="">major</span> <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">>=</span> <span style="color: rgb(255, 128, 0);" class="">1</span> <span style="color: rgb(127, 0, 85);" class="">and</span> Gst.version().<span style="color: rgb(38, 92, 209);" class="">minor</span> <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">>=</span> <span style="color: rgb(255, 128, 0);" class="">17</span>:</div><div class=""> trans <span style="color: #7f0055;" class="">=</span> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.emit(<span style="color: #d126d1;" class="">'get-transceiver'</span>, <span style="color: #ff8000;" class="">0</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">if</span> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">direction</span> <span style="color: #7f0055;font-weight: bold;" class="">==</span> <span style="color: #d126d1;" class="">'sendonly'</span>:</div><div class=""> trans.set_property(<span style="color: #d126d1;" class="">'direction'</span>, GstWebRTC.<span style="color: #265cd1;" class="">WebRTCRTPTransceiverDirection</span>.<span style="color: #006078;" class="">SENDONLY</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">elif</span> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">direction</span> <span style="color: #7f0055;font-weight: bold;" class="">==</span> <span style="color: #d126d1;" class="">'recvonly'</span>:</div><div class=""> trans.set_property(<span style="color: #d126d1;" class="">'direction'</span>, GstWebRTC.<span style="color: #265cd1;" class="">WebRTCRTPTransceiverDirection</span>.<span style="color: #006078;" class="">RECVONLY</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">else</span>:</div><div class=""> trans.set_property(<span style="color: #d126d1;" class="">'direction'</span>, GstWebRTC.<span style="color: #265cd1;" class="">WebRTCRTPTransceiverDirection</span>.<span style="color: #006078;" class="">SENDRECV</span>)</div><div class=""> <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">self</span>.<span style="color: rgb(38, 92, 209);" class="">webrtcbin</span>.connect(<span style="color: rgb(209, 38, 209);" class="">'on-negotiation-needed'</span>, <span style="color: rgb(127, 0, 85); font-weight: bold;" class="">self</span>.<span style="color: rgb(38, 92, 209);" class="">on_negotiation_needed</span>) </div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'on-ice-candidate'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_ice_candidate</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'pad-added'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_pad_added</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'notify::connection-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_connection_state</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'notify::signaling-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_signaling_state</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'notify::ice-connection-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_ice_connection_state</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>.connect(<span style="color: #d126d1;" class="">'notify::ice-gathering-state'</span>, <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">on_ice_gathering_state</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">pipe</span>.add(<span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">webrtcbin</span>)</div><div class=""> <span style="color: #7f0055;font-weight: bold;" class="">self</span>.<span style="color: #265cd1;" class="">pipe</span>.set_state(Gst.<span style="color: #265cd1;" class="">State</span>.<span style="color: #006078;" class="">PLAYING</span>)</div><br class=""></div><div style="font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><br class=""></div><div style="font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class="">The first problem with this is the missing "trans":</div><div style="line-height: 21px;" class=""><font face="Fira Code, Menlo, Monaco, Courier New, monospace, Menlo, Monaco, Courier New, monospace" class=""><span style="white-space: pre;" class=""><br class=""></span></font></div><div style="line-height: 21px;" class=""><font face="Fira Code, Menlo, Monaco, Courier New, monospace, Menlo, Monaco, Courier New, monospace" class=""><span style="white-space: pre;" class="">0:00:00.352922991 11197 0xb2847240 ERROR webrtcbin gstwebrtcbin.c:5032:gst_webrtc_bin_get_transceiver:<webrtcbin> No transceiver for idx 0</span></font><span style="font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">
</span></div><div class=""><br class=""></div><div style="font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><br class=""></div><div style="line-height: 21px;" class=""><font face="Fira Code, Menlo, Monaco, Courier New, monospace, Menlo, Monaco, Courier New, monospace" class=""><span style="white-space: pre;" class="">trans.set_property('direction', GstWebRTC.WebRTCRTPTransceiverDirection.SENDONLY)
AttributeError: 'NoneType' object has no attribute 'set_property'</span></font><span style="font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; white-space: pre;" class="">
</span></div><div class=""><br class=""></div><div class="">But even if I omit the entire part to determine the transceiver, the result is still not working, because this is my OFFER then:</div><div class=""><br class=""></div><div class=""><div class="">v=0</div><div class="">o=- 4039551208253794554 0 IN IP4 0.0.0.0</div><div class="">s=-</div><div class="">t=0 0</div><div class="">a=ice-options:trickle</div><div class="">a=group:BUNDLE</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I suppose there is something wrong with the inputs definitions, but before I go and create them manually I wanted to at least have some success with this.</div><div class=""><br class=""></div><div class="">Does anybody have a pointer, what's going wrong here?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div><div style="background-color: rgb(255, 255, 255); font-family: "Fira Code", Menlo, Monaco, "Courier New", monospace, Menlo, Monaco, "Courier New", monospace; line-height: 21px; white-space: pre;" class=""><br class=""></div></div></div></div></blockquote></div><br class=""></div></body></html>