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.25k stars 626 forks source link

Trying to restream HLS to RTMP crashes the server #3502

Closed choxnox closed 2 years ago

choxnox commented 3 years ago

Short description

We're testing the possibility of restreaming an existing external HLS stream to RTMP. It's supported by FFMPEG but we're not sure if it's supported by media server.

However, trying to do so crashes the server.

Environment

Steps to reproduce

  1. Create a playlist
  2. Put existing M3U8 file as an input file
  3. Define RTMP endpoint (we used Facebook Live)
  4. Start the playlist broadcast

Expected behavior

Ant media server to not crash

Actual behavior

Ant media server crashed and restarted every time we start the playlist broadcast

Logs


2021-08-04 10:17:55,942 [Thread-12] INFO  i.a.streamsource.StreamFetcher - Preparing the StreamFetcher for https://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel.ism/.m3u8
2021-08-04 10:18:03,391 [vert.x-eventloop-thread-10] WARN  i.a.s.StreamFetcherManager - Mux adaptor is not initialized for stream fetcher with stream id: uzwuFQPmArDX1628072015914 It's likely that stream fetching is not started yet
2021-08-04 10:18:04,730 [https-openssl-nio2-0.0.0.0-5443-exec-6] INFO  i.a.e.cluster.HttpLiveStreamValve - url to download http://127.0.1.1:5080/flux/streams/RX2nU6mPrOJy1622758349999_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:05,053 [https-openssl-nio2-0.0.0.0-5443-exec-9] INFO  i.a.e.cluster.HttpLiveStreamValve - url to download http://127.0.1.1:5080/flux/streams/W9wNbF5B51iB1622758318330_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:05,185 [https-openssl-nio2-0.0.0.0-5443-exec-3] INFO  i.a.e.cluster.HttpLiveStreamValve - url to download http://127.0.1.1:5080/flux/streams/L1dpmtmPuxIx1622758328915_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:06,046 [https-openssl-nio2-0.0.0.0-5443-exec-24] INFO  i.a.e.cluster.HttpLiveStreamValve - url to download http://127.0.1.1:5080/flux/streams/MMdosvyLpcyS1622758321516_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:06,580 [https-openssl-nio2-0.0.0.0-5443-exec-19] INFO  i.a.e.cluster.HttpLiveStreamValve - url to download http://127.0.1.1:5080/flux/streams/7duVoAMaSaxn1622758352475_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:07,201 [https-openssl-nio2-0.0.0.0-5443-exec-19] WARN  i.a.e.cluster.HttpLiveStreamValve - Response is 404 for downloading file: http://127.0.1.1:5080/flux/streams/7duVoAMaSaxn1622758352475_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:07,896 [https-openssl-nio2-0.0.0.0-5443-exec-24] WARN  i.a.e.cluster.HttpLiveStreamValve - Response is 404 for downloading file: http://127.0.1.1:5080/flux/streams/MMdosvyLpcyS1622758321516_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:08,360 [https-openssl-nio2-0.0.0.0-5443-exec-3] WARN  i.a.e.cluster.HttpLiveStreamValve - Response is 404 for downloading file: http://127.0.1.1:5080/flux/streams/L1dpmtmPuxIx1622758328915_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:08,757 [https-openssl-nio2-0.0.0.0-5443-exec-9] WARN  i.a.e.cluster.HttpLiveStreamValve - Response is 404 for downloading file: http://127.0.1.1:5080/flux/streams/W9wNbF5B51iB1622758318330_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:09,352 [https-openssl-nio2-0.0.0.0-5443-exec-6] WARN  i.a.e.cluster.HttpLiveStreamValve - Response is 404 for downloading file: http://127.0.1.1:5080/flux/streams/RX2nU6mPrOJy1622758349999_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:09,419 [https-openssl-nio2-0.0.0.0-5443-exec-7] INFO  i.a.e.cluster.HttpLiveStreamValve - url to download http://127.0.1.1:5080/flux/streams/OpckYSsgzsme1622758365374_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:09,683 [https-openssl-nio2-0.0.0.0-5443-exec-7] WARN  i.a.e.cluster.HttpLiveStreamValve - Response is 404 for downloading file: http://127.0.1.1:5080/flux/streams/OpckYSsgzsme1622758365374_adaptive.m3u8?hostAddress=10.104.0.4
2021-08-04 10:18:13,036 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - vertx exist io.vertx.core.impl.VertxImpl@40a9438a
2021-08-04 10:18:13,387 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - adding MP4 Muxer, add datetime to file name true
2021-08-04 10:18:13,388 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - adding HLS Muxer for uzwuFQPmArDX1628072015914
2021-08-04 10:18:13,389 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - adding DASH Muxer for uzwuFQPmArDX1628072015914
2021-08-04 10:18:13,395 [Thread-12] INFO  io.antmedia.muxer.Muxer - Date time resource name: uzwuFQPmArDX1628072015914-2021-08-04_10-18-13.392 local date time: 2021-08-04_10:18:13.392
2021-08-04 10:18:13,395 [Thread-12] INFO  io.antmedia.muxer.HLSMuxer - hls time: 6, hls list size: 5
2021-08-04 10:18:13,403 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - DASH Segment Duration: 6, Fragment Duration: 0.5
2021-08-04 10:18:13,404 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - ServerSettings exist io.antmedia.settings.ServerSettings@1a97077e
2021-08-04 10:18:13,404 [Thread-12] INFO  i.a.streamsource.StreamFetcher - uzwuFQPmArDX1628072015914 stream count in stream https://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel.ism/.m3u8 is 14
2021-08-04 10:18:13,405 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Audio format sample rate:48000 bitrate:0 for stream: uzwuFQPmArDX1628072015914 source index:0 target index:0
2021-08-04 10:18:13,414 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:0 
2021-08-04 10:18:13,415 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Video format width:224 height:100 for stream: uzwuFQPmArDX1628072015914 source index:1 target index:1
2021-08-04 10:18:13,418 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:1 
2021-08-04 10:18:13,418 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Audio format sample rate:48000 bitrate:0 for stream: uzwuFQPmArDX1628072015914 source index:2 target index:2
2021-08-04 10:18:13,418 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:2 
2021-08-04 10:18:13,418 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Video format width:448 height:200 for stream: uzwuFQPmArDX1628072015914 source index:3 target index:3
2021-08-04 10:18:13,418 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:3 
2021-08-04 10:18:13,418 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Audio format sample rate:48000 bitrate:0 for stream: uzwuFQPmArDX1628072015914 source index:4 target index:4
2021-08-04 10:18:13,418 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:4 
2021-08-04 10:18:13,418 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Video format width:784 height:350 for stream: uzwuFQPmArDX1628072015914 source index:5 target index:5
2021-08-04 10:18:13,418 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:5 
2021-08-04 10:18:13,418 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Audio format sample rate:48000 bitrate:0 for stream: uzwuFQPmArDX1628072015914 source index:6 target index:6
2021-08-04 10:18:13,418 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:6 
2021-08-04 10:18:13,418 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Video format width:1680 height:750 for stream: uzwuFQPmArDX1628072015914 source index:7 target index:7
2021-08-04 10:18:13,419 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:7 
2021-08-04 10:18:13,419 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Audio format sample rate:48000 bitrate:0 for stream: uzwuFQPmArDX1628072015914 source index:8 target index:8
2021-08-04 10:18:13,419 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:8 
2021-08-04 10:18:13,419 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Video format width:1680 height:750 for stream: uzwuFQPmArDX1628072015914 source index:9 target index:9
2021-08-04 10:18:13,419 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:9 
2021-08-04 10:18:13,419 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Audio format sample rate:48000 bitrate:0 for stream: uzwuFQPmArDX1628072015914 source index:10 target index:10
2021-08-04 10:18:13,419 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:10 
2021-08-04 10:18:13,419 [Thread-12] INFO  io.antmedia.muxer.MuxAdaptor - Audio format sample rate:48000 bitrate:0 for stream: uzwuFQPmArDX1628072015914 source index:12 target index:11
2021-08-04 10:18:13,419 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with parameters and stream index:11 
2021-08-04 10:18:13,421 [Thread-12] INFO  io.antmedia.muxer.RtmpMuxer - rtmp muxer opening: rtmps://live-api-s.facebook.com:443/rtmp/FB-10158674800744317-0-Abyab4Kwk2DBTdkQ time:1628072293421
2021-08-04 10:18:13,894 [vert.x-eventloop-thread-10] INFO  i.a.AntMediaApplicationAdapter - update source quality for stream: uzwuFQPmArDX1628072015914 quality:null speed:0.01
2021-08-04 10:18:14,452 [Thread-12] INFO  io.antmedia.muxer.RtmpMuxer - avio open takes 1031
2021-08-04 10:18:14,452 [Thread-12] INFO  io.antmedia.muxer.RtmpMuxer - before writing rtmp muxer header to rtmps://live-api-s.facebook.com:443/rtmp/FB-10158674800744317-0-Abyab4Kwk2DBTdkQ
2021-08-04 10:18:14,453 [Thread-12] WARN  io.antmedia.muxer.RtmpMuxer - could not write header to rtmp url rtmps://live-api-s.facebook.com:443/rtmp/FB-10158674800744317-0-Abyab4Kwk2DBTdkQ
2021-08-04 10:18:14,453 [Thread-12] ERROR io.antmedia.muxer.MuxAdaptor - prepareIO returns false flv for stream: uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,458 [Thread-12] INFO  i.a.e.adaptive.base.AudioDecoder - audio decoder name:  aac for uzwuFQPmArDX1628072015914 sample rate:48000
2021-08-04 10:18:14,460 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - find decoder for stream: uzwuFQPmArDX1628072015914 
2021-08-04 10:18:14,461 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - video decoder name:  h264 for uzwuFQPmArDX1628072015914  video context timebase:0/2 wxh:224x100
2021-08-04 10:18:14,461 [Thread-12] INFO  i.a.e.adaptive.base.AudioDecoder - audio decoder name:  aac for uzwuFQPmArDX1628072015914 sample rate:48000
2021-08-04 10:18:14,461 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - find decoder for stream: uzwuFQPmArDX1628072015914 
2021-08-04 10:18:14,462 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - video decoder name:  h264 for uzwuFQPmArDX1628072015914  video context timebase:0/2 wxh:448x200
2021-08-04 10:18:14,462 [Thread-12] INFO  i.a.e.adaptive.base.AudioDecoder - audio decoder name:  aac for uzwuFQPmArDX1628072015914 sample rate:48000
2021-08-04 10:18:14,462 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - find decoder for stream: uzwuFQPmArDX1628072015914 
2021-08-04 10:18:14,463 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - video decoder name:  h264 for uzwuFQPmArDX1628072015914  video context timebase:0/2 wxh:784x350
2021-08-04 10:18:14,463 [Thread-12] INFO  i.a.e.adaptive.base.AudioDecoder - audio decoder name:  aac for uzwuFQPmArDX1628072015914 sample rate:48000
2021-08-04 10:18:14,463 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - find decoder for stream: uzwuFQPmArDX1628072015914 
2021-08-04 10:18:14,463 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - video decoder name:  h264 for uzwuFQPmArDX1628072015914  video context timebase:0/2 wxh:1680x750
2021-08-04 10:18:14,463 [Thread-12] INFO  i.a.e.adaptive.base.AudioDecoder - audio decoder name:  aac for uzwuFQPmArDX1628072015914 sample rate:48000
2021-08-04 10:18:14,464 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - find decoder for stream: uzwuFQPmArDX1628072015914 
2021-08-04 10:18:14,464 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - video decoder name:  h264 for uzwuFQPmArDX1628072015914  video context timebase:0/2 wxh:1680x750
2021-08-04 10:18:14,464 [Thread-12] INFO  i.a.e.adaptive.base.AudioDecoder - audio decoder name:  aac for uzwuFQPmArDX1628072015914 sample rate:48000
2021-08-04 10:18:14,465 [Thread-12] INFO  i.a.e.adaptive.base.AudioDecoder - audio decoder name:  aac for uzwuFQPmArDX1628072015914 sample rate:48000
2021-08-04 10:18:14,469 [Thread-12] INFO  io.antmedia.muxer.Muxer - Date time resource name: uzwuFQPmArDX1628072015914-2021-08-04_10-18-14.469 local date time: 2021-08-04_10:18:14.469
2021-08-04 10:18:14,473 [Thread-12] INFO  io.antmedia.muxer.HLSMuxer - hls time: 6, hls list size: 5
2021-08-04 10:18:14,475 [Thread-12] INFO  i.a.e.adaptive.StreamAdaptor - Stream adaptor scheduled job id 18 stream adaptor:678337429 for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,475 [Thread-12] INFO  io.antmedia.muxer.Muxer - Date time resource name: uzwuFQPmArDX1628072015914-2021-08-04_10-18-14.475 local date time: 2021-08-04_10:18:14.475
2021-08-04 10:18:14,476 [Thread-12] INFO  io.antmedia.muxer.HLSMuxer - hls time: 6, hls list size: 5
2021-08-04 10:18:14,476 [Thread-12] INFO  i.a.e.adaptive.StreamAdaptor - Stream adaptor scheduled job id 19 stream adaptor:1642013185 for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,476 [Thread-12] INFO  io.antmedia.muxer.Muxer - Date time resource name: uzwuFQPmArDX1628072015914-2021-08-04_10-18-14.476 local date time: 2021-08-04_10:18:14.476
2021-08-04 10:18:14,477 [Thread-12] INFO  io.antmedia.muxer.HLSMuxer - hls time: 6, hls list size: 5
2021-08-04 10:18:14,477 [Thread-12] INFO  i.a.e.adaptive.StreamAdaptor - Stream adaptor scheduled job id 20 stream adaptor:1281669134 for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,478 [Thread-12] INFO  io.antmedia.muxer.Muxer - Date time resource name: uzwuFQPmArDX1628072015914-2021-08-04_10-18-14.478 local date time: 2021-08-04_10:18:14.478
2021-08-04 10:18:14,479 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - Object detection is NOT enabled for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,479 [Thread-12] INFO  i.a.e.adaptive.StreamAdaptor - Stream adaptor scheduled job id 21 stream adaptor:1738601141 for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,479 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - incoming widthxheight:1680x750
2021-08-04 10:18:14,479 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - finding encoder for stream:uzwuFQPmArDX1628072015914 width/height:784/350 timebase:1/25 sampleAspectRatio:1/1 gopSize:50 bitrate:800000
2021-08-04 10:18:14,483 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - Video codec opened. Context gop size: 50  keyint mint -1 extradata size: 36 video codec timebase: 1/25  codecName: libx264 for stream: uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,483 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - encoder name: libx264 for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,484 [Thread-12] INFO  io.antmedia.muxer.RecordMuxer - codec par extradata size 36 codec id: 27
2021-08-04 10:18:14,485 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with stream index:9 out streamIndex:12
2021-08-04 10:18:14,485 [Thread-12] INFO  i.a.enterprise.webrtc.WebRTCMuxer - extra data 0: 0  extra data 1: 0, 2:0, 3:1, 4:103
2021-08-04 10:18:14,485 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - incoming widthxheight:1680x750
2021-08-04 10:18:14,485 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - finding encoder for stream:uzwuFQPmArDX1628072015914 width/height:1076/480 timebase:1/25 sampleAspectRatio:1/1 gopSize:50 bitrate:1000000
2021-08-04 10:18:14,490 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - Video codec opened. Context gop size: 50  keyint mint -1 extradata size: 37 video codec timebase: 1/25  codecName: libx264 for stream: uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,490 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - encoder name: libx264 for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,490 [Thread-12] INFO  io.antmedia.muxer.RecordMuxer - codec par extradata size 37 codec id: 27
2021-08-04 10:18:14,490 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with stream index:9 out streamIndex:13
2021-08-04 10:18:14,490 [Thread-12] INFO  i.a.enterprise.webrtc.WebRTCMuxer - extra data 0: 0  extra data 1: 0, 2:0, 3:1, 4:103
2021-08-04 10:18:14,491 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - incoming widthxheight:1680x750
2021-08-04 10:18:14,491 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - finding encoder for stream:uzwuFQPmArDX1628072015914 width/height:1568/700 timebase:1/25 sampleAspectRatio:1/1 gopSize:50 bitrate:1500000
2021-08-04 10:18:14,496 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - Video codec opened. Context gop size: 50  keyint mint -1 extradata size: 37 video codec timebase: 1/25  codecName: libx264 for stream: uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,497 [Thread-12] INFO  i.a.e.adaptive.video.H264Encoder - encoder name: libx264 for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,497 [Thread-12] INFO  io.antmedia.muxer.RecordMuxer - codec par extradata size 37 codec id: 27
2021-08-04 10:18:14,497 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with stream index:9 out streamIndex:14
2021-08-04 10:18:14,497 [Thread-12] INFO  i.a.enterprise.webrtc.WebRTCMuxer - extra data 0: 0  extra data 1: 0, 2:0, 3:1, 4:103
2021-08-04 10:18:14,497 [Thread-12] INFO  i.a.enterprise.preview.PngEncoder - preparing codec for stream: uzwuFQPmArDX1628072015914 source wxh:1680x750 target wxh:1076x480 
2021-08-04 10:18:14,498 [Thread-12] INFO  i.a.enterprise.preview.PngEncoder - leaving prepare codec for stream: uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,498 [Thread-12] INFO  i.a.e.adaptive.audio.OpusEncoder - encoder name libopus source sample rate 48000, channel layout 3
2021-08-04 10:18:14,498 [Thread-12] INFO  i.a.e.adaptive.audio.AACEncoder - name : aac 
2021-08-04 10:18:14,500 [Thread-12] INFO  io.antmedia.muxer.RecordMuxer - codec par extradata size 5 codec id: 86018
2021-08-04 10:18:14,500 [Thread-12] INFO  io.antmedia.muxer.HLSMuxer - copy codec parameter from context 0 stream index: 11
2021-08-04 10:18:14,500 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - copy codec parameter from context 0 stream index: 11
2021-08-04 10:18:14,500 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with stream index:11 out streamIndex:15
2021-08-04 10:18:14,501 [Thread-12] INFO  i.a.e.adaptive.audio.OpusEncoder - encoder name libopus source sample rate 48000, channel layout 3
2021-08-04 10:18:14,501 [Thread-12] INFO  i.a.e.adaptive.audio.AACEncoder - name : aac 
2021-08-04 10:18:14,502 [Thread-12] INFO  io.antmedia.muxer.RecordMuxer - codec par extradata size 5 codec id: 86018
2021-08-04 10:18:14,503 [Thread-12] INFO  io.antmedia.muxer.HLSMuxer - copy codec parameter from context 0 stream index: 11
2021-08-04 10:18:14,503 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - copy codec parameter from context 0 stream index: 11
2021-08-04 10:18:14,503 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with stream index:11 out streamIndex:16
2021-08-04 10:18:14,503 [Thread-12] INFO  i.a.e.adaptive.audio.OpusEncoder - encoder name libopus source sample rate 48000, channel layout 3
2021-08-04 10:18:14,503 [Thread-12] INFO  i.a.e.adaptive.audio.AACEncoder - name : aac 
2021-08-04 10:18:14,504 [Thread-12] INFO  io.antmedia.muxer.RecordMuxer - codec par extradata size 5 codec id: 86018
2021-08-04 10:18:14,505 [Thread-12] INFO  io.antmedia.muxer.HLSMuxer - copy codec parameter from context 0 stream index: 11
2021-08-04 10:18:14,505 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - copy codec parameter from context 0 stream index: 11
2021-08-04 10:18:14,505 [Thread-12] INFO  i.a.enterprise.muxer.DASHMuxer - addStream with stream index:11 out streamIndex:17
2021-08-04 10:18:14,508 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - could not write header. File: http://localhost:5080/flux/chunked/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914.mpd Error: Invalid argument
2021-08-04 10:18:14,509 [Thread-12] INFO  i.a.enterprise.webrtc.WebRTCAdaptor - registering uzwuFQPmArDX1628072015914 muxer with 350p and codec::H264 to webrtc adaptor
2021-08-04 10:18:14,509 [Thread-12] INFO  i.a.enterprise.webrtc.WebRTCAdaptor - Increasing number of live streams: 1 and stream id:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,511 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - could not write header. File: http://localhost:5080/flux/chunked/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914.mpd Error: Invalid argument
2021-08-04 10:18:14,512 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - could not write header. File: http://localhost:5080/flux/chunked/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914.mpd Error: Invalid argument
2021-08-04 10:18:14,512 [Thread-12] INFO  i.a.enterprise.webrtc.WebRTCAdaptor - registering uzwuFQPmArDX1628072015914 muxer with 480p and codec::H264 to webrtc adaptor
2021-08-04 10:18:14,514 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - could not write header. File: http://localhost:5080/flux/chunked/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914.mpd Error: Invalid argument
2021-08-04 10:18:14,516 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - could not write header. File: http://localhost:5080/flux/chunked/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914.mpd Error: Invalid argument
2021-08-04 10:18:14,516 [Thread-12] INFO  i.a.enterprise.webrtc.WebRTCAdaptor - registering uzwuFQPmArDX1628072015914 muxer with 700p and codec::H264 to webrtc adaptor
2021-08-04 10:18:14,517 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - could not write header. File: http://localhost:5080/flux/chunked/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914.mpd Error: Invalid argument
2021-08-04 10:18:14,519 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - could not write header. File: http://localhost:5080/flux/chunked/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914.mpd Error: Invalid argument
2021-08-04 10:18:14,524 [Thread-12] INFO  i.a.e.adaptive.EncoderAdaptor - getStreamInfoList size: 3 for stream: uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,528 [Thread-12] INFO  i.a.e.cluster.webrtc.OriginServer - Origin Server is starting video enabled:true audio enabled: true for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,577 [http-nio2-0.0.0.0-5080-exec-4] INFO  i.a.servlet.ChunkedTransferServlet - doPut key:/usr/local/antmedia/webapps/flux/streams/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914_0.m4s
2021-08-04 10:18:14,583 [http-nio2-0.0.0.0-5080-exec-76] INFO  i.a.servlet.ChunkedTransferServlet - doPut done key:/usr/local/antmedia/webapps/flux/streams/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914_0.m4s
2021-08-04 10:18:14,621 [Thread-12] INFO  i.a.e.cluster.webrtc.OriginServer - Origin Server is starting video enabled:true audio enabled: true for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,623 [Thread-12] INFO  i.a.e.cluster.webrtc.OriginServer - Origin Server is starting video enabled:true audio enabled: true for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,642 [Thread-12] INFO  i.a.AntMediaApplicationAdapter - start publish leaved for stream:uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,642 [http-nio2-0.0.0.0-5080-exec-101] INFO  i.a.servlet.ChunkedTransferServlet - doPut key:/usr/local/antmedia/webapps/flux/streams/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914_13.m4s
2021-08-04 10:18:14,643 [http-nio2-0.0.0.0-5080-exec-83] INFO  i.a.servlet.ChunkedTransferServlet - doPut done key:/usr/local/antmedia/webapps/flux/streams/uzwuFQPmArDX1628072015914/uzwuFQPmArDX1628072015914_13.m4s
2021-08-04 10:18:14,643 [Thread-12] WARN  io.antmedia.muxer.RecordMuxer - Not writing packet1 for uzwuFQPmArDX1628072015914 - Is running:true or stream index(11) is registered: false
2021-08-04 10:18:14,643 [Thread-12] WARN  io.antmedia.muxer.HLSMuxer - not registered stream index uzwuFQPmArDX1628072015914.m3u8
2021-08-04 10:18:14,643 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - Returning in writePacket. IsRunning: false, stream index 11 context: org.bytedeco.ffmpeg.avformat.AVFormatContext[address=0x7feda036b540,position=0,limit=0,capacity=0,deallocator=null]
2021-08-04 10:18:14,644 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - Returning in writePacket. IsRunning: false, stream index 10 context: org.bytedeco.ffmpeg.avformat.AVFormatContext[address=0x7feda036b540,position=0,limit=0,capacity=0,deallocator=null]
2021-08-04 10:18:14,645 [vert.x-eventloop-thread-11] INFO  i.a.e.cluster.webrtc.OriginServer - Setting stream cluster origin video port 36509 for stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,645 [vert.x-eventloop-thread-13] INFO  i.a.e.cluster.webrtc.OriginServer - Setting stream cluster origin audio port 43159 for stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,645 [vert.x-eventloop-thread-5] INFO  i.a.e.cluster.webrtc.OriginServer - Setting stream cluster origin audio port 39617 for stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,645 [vert.x-eventloop-thread-11] INFO  i.a.e.c.w.OriginServerStatusListener - video port(36509) for origin stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,645 [vert.x-eventloop-thread-13] INFO  i.a.e.c.w.OriginServerStatusListener - audio port(43159) for origin stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,645 [vert.x-eventloop-thread-5] INFO  i.a.e.c.w.OriginServerStatusListener - audio port(39617) for origin stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,645 [vert.x-eventloop-thread-11] WARN  i.a.e.c.w.OriginServerStatusListener - OriginServer not ready. Current video:36509 audio:0 data:0 for stream: uzwuFQPmArDX1628072015914 - codec:H264
2021-08-04 10:18:14,646 [vert.x-eventloop-thread-5] WARN  i.a.e.c.w.OriginServerStatusListener - OriginServer not ready. Current video:0 audio:39617 data:0 for stream: uzwuFQPmArDX1628072015914 - codec:H264
2021-08-04 10:18:14,646 [vert.x-eventloop-thread-13] INFO  i.a.e.c.w.OriginServerStatusListener - OriginServer ready now. Video enabled/port:true/36509 Audio enabled/port:true/43159 Data Channel enabled/port:false/0 for stream uzwuFQPmArDX1628072015914 with height: 700 codec:H264
2021-08-04 10:18:14,647 [vert.x-eventloop-thread-7] INFO  i.a.e.cluster.webrtc.OriginServer - Setting stream cluster origin video port 33685 for stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,647 [vert.x-eventloop-thread-13] INFO  i.a.enterprise.webrtc.WebRTCMuxer - register webrtc client(1239180542) to webrtc muxer(700p - codec:H264) for stream: uzwuFQPmArDX1628072015914 current viewer count:1
2021-08-04 10:18:14,647 [vert.x-eventloop-thread-7] INFO  i.a.e.c.w.OriginServerStatusListener - video port(33685) for origin stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,647 [vert.x-eventloop-thread-9] INFO  i.a.e.cluster.webrtc.OriginServer - Setting stream cluster origin audio port 32819 for stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,648 [vert.x-eventloop-thread-7] WARN  i.a.e.c.w.OriginServerStatusListener - OriginServer not ready. Current video:33685 audio:0 data:0 for stream: uzwuFQPmArDX1628072015914 - codec:H264
2021-08-04 10:18:14,648 [vert.x-eventloop-thread-9] INFO  i.a.e.c.w.OriginServerStatusListener - audio port(32819) for origin stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,648 [vert.x-eventloop-thread-9] INFO  i.a.e.c.w.OriginServerStatusListener - OriginServer ready now. Video enabled/port:true/33685 Audio enabled/port:true/32819 Data Channel enabled/port:false/0 for stream uzwuFQPmArDX1628072015914 with height: 480 codec:H264
2021-08-04 10:18:14,649 [vert.x-eventloop-thread-9] INFO  i.a.enterprise.webrtc.WebRTCMuxer - register webrtc client(74002440) to webrtc muxer(480p - codec:H264) for stream: uzwuFQPmArDX1628072015914 current viewer count:1
2021-08-04 10:18:14,649 [vert.x-eventloop-thread-3] INFO  i.a.e.cluster.webrtc.OriginServer - Setting stream cluster origin video port 33633 for stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,649 [vert.x-eventloop-thread-3] INFO  i.a.e.c.w.OriginServerStatusListener - video port(33633) for origin stream uzwuFQPmArDX1628072015914
2021-08-04 10:18:14,649 [vert.x-eventloop-thread-3] INFO  i.a.e.c.w.OriginServerStatusListener - OriginServer ready now. Video enabled/port:true/33633 Audio enabled/port:true/39617 Data Channel enabled/port:false/0 for stream uzwuFQPmArDX1628072015914 with height: 350 codec:H264
2021-08-04 10:18:14,649 [vert.x-eventloop-thread-3] INFO  i.a.enterprise.webrtc.WebRTCMuxer - register webrtc client(1272476897) to webrtc muxer(350p - codec:H264) for stream: uzwuFQPmArDX1628072015914 current viewer count:1
2021-08-04 10:18:14,650 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - Returning in writePacket. IsRunning: false, stream index 10 context: org.bytedeco.ffmpeg.avformat.AVFormatContext[address=0x7feda036b540,position=0,limit=0,capacity=0,deallocator=null]
2021-08-04 10:18:14,665 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - Returning in writePacket. IsRunning: false, stream index 10 context: org.bytedeco.ffmpeg.avformat.AVFormatContext[address=0x7feda036b540,position=0,limit=0,capacity=0,deallocator=null]
2021-08-04 10:18:14,667 [vert.x-worker-thread-14] ERROR i.a.e.adaptive.StreamAdaptor - java.lang.NullPointerException
    at io.antmedia.muxer.RecordMuxer.writePacket(RecordMuxer.java:607)
    at io.antmedia.enterprise.adaptive.audio.AACEncoder.encode(AACEncoder.java:127)
    at io.antmedia.enterprise.adaptive.base.AudioEncoder.writeFrame(AudioEncoder.java:318)
    at io.antmedia.enterprise.adaptive.StreamAdaptor.write2AudioEncoders(StreamAdaptor.java:313)
    at io.antmedia.enterprise.adaptive.StreamAdaptor.execute(StreamAdaptor.java:241)
    at io.antmedia.enterprise.adaptive.StreamAdaptor.lambda$start$0(StreamAdaptor.java:185)
    at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:829)

2021-08-04 10:18:14,685 [Thread-12] WARN  i.a.enterprise.muxer.DASHMuxer - Returning in writePacket. IsRunning: false, stream index 10 context: org.bytedeco.ffmpeg.avformat.AVFormatContext[address=0x7feda036b540,position=0,limit=0,capacity=0,deallocator=null]
2021-08-04 10:18:20,767 [main] INFO  org.red5.server.Launcher - Ant Media Server Enterprise 2.3.2
2021-08-04 10:18:20,769 [main] INFO  org.red5.server.Launcher - 

             `..-:/++oosssyyyyyyyysssoo++/::..`             
        .:+osyyyyysooo++///::::::///++ooosyyyyyso+:.        
     -+syyso/:-.`         ```````          `.-:/osyyy+-     
   .oyyo:.    ``.-:/+oossyyyyyys:`.+o+: `..`      `-+yys.   
   oyy-   `.-:://:::::///++ooo-`-oyo:../sys/`.::.    .yys   
   syy+`                       `.-. -oys/..:oys+:`   :yyy   
   syyyo-`                           `. `+so/.`   `-oyyyy   
   syy+sys+:.`                           ``   `.:+syyoyyy   
   syy``:+syyso`       `..`                 `osyyso:. syy   
   syy`   `.oyy.      :syyso:.`             `yys.`    syy   
   syy`     +yy.      syy:+syys+-`          `yyo      syy   
   syy`     +yy.      yyy  `.:osyso/.`      `yyo      syy   
   syy`     +yy.      yyy      `-/syys+.    `yyo      syy   
   syy`     +yy.      yyy         `./yyy    `yyo      syy   
   syy`     +yy.      yyy       `./oyys/    `yyo      syy   
   syy`     +yy.      yyy    .:+syyo/-`     `yyo      syy   
   syy`     +yy.      yyy`-/syys+:.         `yyo      syy   
   syy`     +yy.      +yyyyyo/.`            `yyo      yyy   
   /yy/     +yy.       -::-`                `yyo     :yy+   
    +yyo:.  +yy.                            `yyo  .-oyy+`   
     .+yyyysyyy.                            `yyysyyyy+-     
        .:/+++/                              :+//:-.        

2021-08-04 10:18:20,791 [main] INFO  o.s.c.s.FileSystemXmlApplicationContext - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@5f8e8a9d: startup date [Wed Aug 04 10:18:20 UTC 2021]; root of context hierarchy
2021-08-04 10:18:20,811 [main] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [red5.xml]
2021-08-04 10:18:20,897 [main] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [jee-container.xml]
2021-08-04 10:18:21,072 [main] INFO  o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2021-08-04 10:18:21,119 [main] INFO  o.r.spring.Red5ApplicationContext - setApplicationContext: org.springframework.context.support.FileSystemXmlApplicationContext@5f8e8a9d: startup date [Wed Aug 04 10:18:20 UTC 2021]; root of context hierarchy
...

Join [Google Group](https://groups.google.com/forum/#!forum/ant-media-server) and be a part of Ant Media Server Community.
mekya commented 3 years ago

Thank you for the issue. @choxnox

I've moved it to the backlog to schedule it. I think we can schedule it in next week or the week after.

Thank you

choxnox commented 3 years ago

Hi @mekya, any updates on this issue?

mekya commented 3 years ago

Hi @choxnox ,

It's still in the backlog and scheduled for the next week. I hope we can schedule on Monday. Sometimes due to workload and unfinished tasks, we cannot schedule enough issues. Sorry for that.

golgetahir commented 2 years ago

Hi all,

The issue is resolved in 2.4.1 version, please reach back to us if you face the issue again.

Thanks

mekya commented 2 years ago

There is another feedback that is not directly related to this issue. Anyway I'm creating an issue for this.

The Antmedia server does support AAC.

We believe we have identified the problem.

The ant-media server is susceptible to inbound streams that do not contain the AAC header in the FLV container. While the elementary stream contains the header the FLV container does not.  This causes the antmedia server to have a problem.

One of the sending systems was modified to use ffmpeg with the aac_seq_header_detect flag, and the antmedia server works correctly.  See:

http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183483.html

It would still be good if the antmedia server would accept streams without this header (since we have at least two systems that send RTMP streams without this header).