ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.23k stars 618 forks source link

RTMP to WebRTC issue after enabling ABR #4668

Open yashtandon113 opened 1 year ago

yashtandon113 commented 1 year ago

Short description

When the ABR on the server is enabled, the WebRTC stream does not work after the stream is published from the specific encoder (Live Shell X). Although the stream works fine without ABR.

Environment

Steps to reproduce

  1. Enable the ABR on the server
  2. Publish an RTMP stream from Live Shell encoder.
  3. Play the WebRTC stream

Expected behavior

Stream should work fine without any issue.

Actual behavior

The stream did not always work. After restarting the server, the stream started to work on a round-robin basis. The stream did not work on a GPU server, even after restarting the AMS.

burak-58 commented 1 year ago

When we print packet type, the calculated dts and the packet time stamp, we got these for working and non-working cases:

Working case:

2022-12-16 12:47:27,765 [vert.x-worker-thread-4] INFO i.a.AntMediaApplicationAdapter - start publish leaved for stream:testing123 2022-12-16 12:47:27,765 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:18 pts:0 comming ts:0 2022-12-16 12:47:27,765 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:1 comming ts:1 2022-12-16 12:47:27,765 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:1 comming ts:1 2022-12-16 12:47:27,765 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:2 comming ts:2 2022-12-16 12:47:27,765 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:1 comming ts:1 2022-12-16 12:47:27,765 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:2 comming ts:2 2022-12-16 12:47:27,765 [vert.x-worker-thread-9] INFO i.a.AntMediaApplicationAdapter - Status of stream testing123 is set to Broadcasting with result: true 2022-12-16 12:47:27,770 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:21 comming ts:21 2022-12-16 12:47:27,770 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:42 comming ts:42 2022-12-16 12:47:27,770 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:51 comming ts:51 2022-12-16 12:47:27,775 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:63 comming ts:63 2022-12-16 12:47:27,776 [vert.x-worker-thread-4] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:84 comming ts:84 2022-12-16 12:47:27,787 [vert.x-worker-thread-16] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:85 comming ts:85 2022-12-16 12:47:27,787 [vert.x-worker-thread-16] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:106 comming ts:106

Non-working case:

2022-12-16 12:48:08,919 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:18 pts:0 comming ts:0 2022-12-16 12:48:08,919 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:1 comming ts:1 2022-12-16 12:48:08,919 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:1 comming ts:1 2022-12-16 12:48:08,919 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:2 comming ts:2 2022-12-16 12:48:08,919 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:1 comming ts:1 2022-12-16 12:48:08,920 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:21 comming ts:21 2022-12-16 12:48:08,920 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:2147483650 comming ts:-2147483646 2022-12-16 12:48:08,921 [vert.x-worker-thread-53] INFO i.a.AntMediaApplicationAdapter - Status of stream testing123 is set to Broadcasting with result: true 2022-12-16 12:48:08,923 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:2147483690 comming ts:-2147483606 2022-12-16 12:48:08,923 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:2147483704 comming ts:-2147483592 2022-12-16 12:48:08,925 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:2147483712 comming ts:-2147483584 2022-12-16 12:48:08,925 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:2147483733 comming ts:-2147483563 2022-12-16 12:48:08,925 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:2147483737 comming ts:-2147483559 2022-12-16 12:48:08,927 [vert.x-worker-thread-18] INFO io.antmedia.muxer.MuxAdaptor - packet type:8 pts:2147483754 comming ts:-2147483542 2022-12-16 12:48:08,943 [vert.x-worker-thread-2] INFO io.antmedia.muxer.MuxAdaptor - packet type:9 pts:2147483770 comming ts:-2147483526