Jump to content
  • 0

WebRTC Custom App in Python


Frank Sepulveda
 Share

Question

Hello, I'm testing Ant Server right now using the Community Edition and i already test different streams and the quality and speed is good.

But i need to integrate the WebRTC Publish to a custom app in Python with Gstreamer (WebRTCBin), I have been looking some examples and I already start a demo app, i'm having some problems to keep the connection alive, when i connect to the server my stream appear on the LiveApp streaming list, but after couple seconds disappear, my program still runs but i can't get the stream show on the preview.

I hope someone has done this before and can help me.

Thank you!
Link to comment
Share on other sites

  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

2 answers to this question

Recommended Posts

  • 0

Hello,

When i look at your takecandidate method, i see that you are not sending CANDIDATE.SDP_MID.
Could you check this link if possible: https://github.com/ant-media/Ant-Media-Server/wiki/WebRTC-WebSocket-Messaging-Reference
In https://github.com/socieboy/webrtc-ant-media/blob/03ec856c3671aa7f2605db61e33d3009bcb263a0/webrtc.py#L73 here,
your code sends two mlineindex. 
Could you fix and check if it fixes or not.
Regards.

 

Link to comment
Share on other sites

  • 0

Hi, i was aware that i was not passing the SDP_MID value, i tougth i could omitted, the library for WebRTC of Gstreamer doesn't provide that value on the method that is called from the websocket event, and this is out of my hands.

Those are the logs from the AntServer when the app is connecting.

undefineda.webrtc.adaptor.Adaptor - Add ice candidate failed for 0:0:candidate:9 2 TCP 1010828030 2600:6c50:737f:dcdd:c0d7:7802:6469:1dfd 34463 typ host tcptype passive::UNKNOWN

2020-09-25 00:58:49,601 [pool-165-thread-1] ERROR io.antmedia.webrtc.adaptor.Adaptor - Add ice candidate failed for 0:0:candidate:10 2 UDP 2013266427 2600:6c50:737f:dcdd::962 55457 typ host::UNKNOWN

2020-09-25 00:58:49,601 [pool-165-thread-1] ERROR io.antmedia.webrtc.adaptor.Adaptor - Add ice candidate failed for 0:0:candidate:11 2 TCP 1015022590 2600:6c50:737f:dcdd::962 9 typ host tcptype active::UNKNOWN

2020-09-25 00:58:49,602 [pool-165-thread-1] ERROR io.antmedia.webrtc.adaptor.Adaptor - Add ice candidate failed for 0:0:candidate:12 2 TCP 1010828286 2600:6c50:737f:dcdd::962 45085 typ host tcptype passive::UNKNOWN

2020-09-25 00:58:49,602 [pool-165-thread-1] ERROR io.antmedia.webrtc.adaptor.Adaptor - Add ice candidate failed for 0:0:candidate:13 2 UDP 2013266426 192.168.1.198 37130 typ host::UNKNOWN

2020-09-25 00:58:49,605 [pool-165-thread-1] ERROR io.antmedia.webrtc.adaptor.Adaptor - Add ice candidate failed for 0:0:candidate:14 2 TCP 1015022846 192.168.1.198 9 typ host tcptype active::UNKNOWN

2020-09-25 00:58:49,605 [pool-165-thread-1] ERROR io.antmedia.webrtc.adaptor.Adaptor - Add ice candidate failed for 0:0:candidate:15 2 TCP 1010828542 192.168.1.198 59179 typ host tcptype passive::UNKNOWN

2020-09-25 00:58:49,672 [network_thread - 20499] WARN  io.antmedia.webrtc.adaptor.Adaptor - onIceCandidate

2020-09-25 00:58:49,724 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 750 ms

2020-09-25 00:58:49,981 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 1000 ms

2020-09-25 00:58:50,238 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 1250 ms

2020-09-25 00:58:50,496 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 1500 ms

2020-09-25 00:58:50,753 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 1750 ms

2020-09-25 00:58:51,011 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 2000 ms

2020-09-25 00:58:51,018 [vertx-blocked-thread-checker] WARN  i.v.core.impl.BlockedThreadChecker - Thread Thread[vert.x-eventloop-thread-1,5,main] has been blocked for 2069 ms, time limit is 2000

2020-09-25 00:58:51,268 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 2250 ms

2020-09-25 00:58:51,526 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 2500 ms

2020-09-25 00:58:51,784 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 2750 ms

2020-09-25 00:58:52,018 [vertx-blocked-thread-checker] WARN  i.v.core.impl.BlockedThreadChecker - Thread Thread[vert.x-eventloop-thread-1,5,main] has been blocked for 3068 ms, time limit is 2000

2020-09-25 00:58:52,041 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 3000 ms

2020-09-25 00:58:52,298 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 3250 ms

2020-09-25 00:58:52,556 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 3500 ms

2020-09-25 00:58:52,813 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 3750 ms

2020-09-25 00:58:53,019 [vertx-blocked-thread-checker] WARN  i.v.core.impl.BlockedThreadChecker - Thread Thread[vert.x-eventloop-thread-1,5,main] has been blocked for 4069 ms, time limit is 2000

2020-09-25 00:58:53,080 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 4000 ms

2020-09-25 00:58:53,337 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 4250 ms

2020-09-25 00:58:53,594 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 4500 ms

2020-09-25 00:58:53,853 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 4750 ms

2020-09-25 00:58:54,019 [vertx-blocked-thread-checker] WARN  i.v.core.impl.BlockedThreadChecker - Thread Thread[vert.x-eventloop-thread-1,5,main] has been blocked for 5069 ms, time limit is 2000

io.vertx.core.VertxException: Thread blocked

at java.lang.Thread.sleep(Native Method)

at io.antmedia.muxer.MuxAdaptor$1.call(MuxAdaptor.java:235)

at org.bytedeco.javacpp.avformat.avformat_find_stream_info(Native Method)

at io.antmedia.muxer.MuxAdaptor.prepare(MuxAdaptor.java:487)

at io.antmedia.muxer.MuxAdaptor.lambda$start$6(MuxAdaptor.java:977)

at io.antmedia.muxer.MuxAdaptor$$Lambda$198/520567115.handle(Unknown Source)

at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:885)

at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:844)

at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:339)

at io.vertx.core.impl.ContextImpl$$Lambda$31/1822344893.run(Unknown Source)

at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)

at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)

at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)

at java.lang.Thread.run(Thread.java:748)

2020-09-25 00:58:54,110 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 5000 ms

2020-09-25 00:58:54,370 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Stream: frank-edge does not get packet for 5250 ms

2020-09-25 00:58:54,370 [vert.x-eventloop-thread-1] WARN  io.antmedia.muxer.MuxAdaptor - Total wait time:5250 for receiving packet exceeds maxWaitTime(10* max analyze duration):5000 breaking the loop for stream:frank-edge

2020-09-25 00:58:54,370 [vert.x-eventloop-thread-1] INFO  io.antmedia.muxer.MuxAdaptor - packet is null and return length is -1

2020-09-25 00:58:54,370 [vert.x-eventloop-thread-1] INFO  io.antmedia.muxer.MuxAdaptor - stop request for stream id : frank-edge

2020-09-25 00:58:54,370 [vert.x-eventloop-thread-1] INFO  io.antmedia.muxer.MuxAdaptor - packet is null and return length is -1

2020-09-25 00:58:54,371 [vert.x-eventloop-thread-1] INFO  io.antmedia.muxer.MuxAdaptor - avformat_find_stream_info takes 5422ms for stream:frank-edge

2020-09-25 00:58:54,371 [vert.x-eventloop-thread-1] INFO  io.antmedia.muxer.MuxAdaptor - after prepare for frank-edge

2020-09-25 00:58:54,372 [vert.x-eventloop-thread-1] INFO  io.antmedia.muxer.MuxAdaptor - Number of items in the queue while starting: -2 for stream: frank-edge

2020-09-25 00:58:54,381 [vert.x-worker-thread-7] INFO  io.antmedia.muxer.MuxAdaptor - stop request for stream id : frank-edge

2020-09-25 00:58:54,381 [vert.x-worker-thread-7] INFO  io.antmedia.muxer.MuxAdaptor - packet is null and return length is -1

2020-09-25 00:58:54,381 [vert.x-worker-thread-7] WARN  io.antmedia.muxer.MuxAdaptor - closing adaptor for frank-edge

2020-09-25 00:58:54,381 [vert.x-worker-thread-7] INFO  io.antmedia.muxer.MuxAdaptor - close resources for streamId -> frank-edge

2020-09-25 00:58:54,382 [vert.x-worker-thread-7] INFO  io.antmedia.muxer.MuxAdaptor - Cancelling packet poller task(id:2272) for streamId: frank-edge

2020-09-25 00:58:54,384 [vert.x-worker-thread-7] INFO  io.antmedia.muxer.HLSMuxer - Delete File onexit:true

2020-09-25 00:58:54,384 [vert.x-worker-thread-7] INFO  io.antmedia.muxer.HLSMuxer - Scheduling the task to delete. HLS time: 2, hlsListSize:5

2020-09-25 00:58:54,384 [vert.x-worker-thread-7] WARN  io.antmedia.muxer.MuxAdaptor - closed adaptor for frank-edge

2020-09-25 00:58:54,384 [vert.x-worker-thread-7] INFO  o.r.s.stream.ClientBroadcastStream - Stream stop: frank-edge

2020-09-25 00:58:54,384 [vert.x-worker-thread-7] INFO  io.antmedia.muxer.MuxAdaptor - Calling stop for frank-edge

2020-09-25 00:58:54,384 [vert.x-worker-thread-7] WARN  io.antmedia.muxer.MuxAdaptor - Mux adaptor stopped returning for frank-edge

2020-09-25 00:58:54,384 [vert.x-worker-thread-7] INFO  o.r.s.stream.ClientBroadcastStream - Stream close: frank-edge

2020-09-25 00:58:54,384 [vert.x-worker-thread-7] INFO  o.r.s.stream.ClientBroadcastStream - Checking mux adaptor to stop frank-edge

2020-09-25 00:58:54,384 [vert.x-worker-thread-7] INFO  o.r.s.stream.ClientBroadcastStream - Mux Adaptor stop called frank-edge

2020-09-25 00:58:54,387 [vert.x-worker-thread-7] INFO  i.a.e.streamapp.StreamApplication - W3C x-category:stream x-event:unpublish c-ip:127.0.0.1 cs-bytes:3806 sc-bytes:3753 x-sname:3b0f015a-a31e-4d19-ab5f-4ebdf92ed471 x-file-length:5 x-name:frank-edge

2020-09-25 00:58:54,387 [vert.x-worker-thread-7] INFO  i.a.e.streamapp.StreamApplication - W3C x-category:session x-event:disconnect c-ip:127.0.0.1 c-client-id:57

2020-09-25 00:58:54,389 [vert.x-eventloop-thread-1] INFO  i.a.AntMediaApplicationAdapter - update source quality for stream: frank-edge quality:null speed:0.0

2020-09-25 00:58:54,389 [vert.x-worker-thread-7] INFO  o.r.s.net.rtmp.RTMPMinaConnection - Connection is closed: OCCEITBIM7HNZ

2020-09-25 00:58:59,694 [vert.x-eventloop-thread-0] INFO  i.antmedia.statistic.StatsCollector - System cpu load:9 process cpu load:6 available memory: 367632 KB used memory(RSS): 391060 KB

2020-09-25 00:58:59,695 [vert.x-eventloop-thread-0] INFO  i.antmedia.statistic.StatsCollector - Vertx worker queue size:0 WebRTCVertx worker queue size:0

2020-09-25 00:59:04,384 [vert.x-eventloop-thread-1] INFO  io.antmedia.muxer.HLSMuxer - Delete HLS files on exit

2020-09-25 01:00:12,414 [network_thread - 20499] INFO  io.antmedia.webrtc.adaptor.Adaptor - Ice connection state changed to CLOSED so it's stopping

 

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...