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 622 forks source link

When re-streaming an MP2T stream the audio get lost #4779

Open JustJoostNL opened 1 year ago

JustJoostNL commented 1 year ago

Short description

When re-streaming an MP2T stream, the audio (MPEG AUDIO) stream is lost, only the video is left.

Environment

Steps to reproduce

  1. Open AMS, and click 'New Live Stream'
  2. Click stream source
  3. Fill in a name and ID
  4. Paste in a MP2T stream

Expected behavior

When watching the output (the produced m3u8 by AMS), there is working audio and video.

Actual behavior

When watching the output (the produced m3u8 by AMS), there is only video.

The MP2T stream I use really contains audio and video.

Logs

The logs only contain 1 strange thing:

2023-01-27 17:46:19,663 [Thread-32] io.antmedia.muxer.HLSMuxer - Not writing packet1 for TestStream - Is running:true or stream index(1) is registered: false

BTW: Someone already created an issue for this, but that one got closed since there wasn't enough information. Feel free to ask me for more information if needed.

mekya commented 1 year ago

Hi @JustJoostNL , I think it's about the compatibility. M3U8 does support AAC audio. On the other hand, I think MP2T has some other audio codec. In order to support that, the audio should be transcoded to AAC and transcoding is the feature in Enterprise edition.

If you would like to try quickly, you can just spin up an instance in AWS marketplace for a couple of hours. Check this out

Please let me know if I can help further.

Regards Oguz

JustJoostNL commented 1 year ago

If I use the enterprise edition, is it guaranteed to work?

mekya commented 1 year ago

You can try easily without any license payment . You can also get the trial from https://antmedia.io If it does work, you are good to go. If it does not work, please let us know.

Please add adaptive bitrate to the server side to let the server transcode it.

JustJoostNL commented 1 year ago

I’ll try it later today!

JustJoostNL commented 1 year ago

Still waiting to receive a reply on my trail request. 🙂

Mohit-3196 commented 1 year ago

Hi @JustJoostNL , Can you please share your mail address with which you requested the trail license from https://antmedia.io/ I will quicky check it and provide you the details.

Thank you, Mohit Dubey

JustJoostNL commented 1 year ago

The email I used is: justjoostnl@outlook.com

Mohit-3196 commented 1 year ago

Hi @JustJoostNL, I shared it on the mail. Please let me know if it's received.

Thank you

JustJoostNL commented 1 year ago

Thanks, going to test now!

JustJoostNL commented 1 year ago

Tested with transcoding on, and unfortunately there is still no audio.

Mohit-3196 commented 1 year ago

Hi @JustJoostNL , Is it possible for you to share your Ant Media Server Web Panel login credentials with me over the mail thread that we have so that I can check it more?

Thank you

JustJoostNL commented 1 year ago

@Mohit-3196 Since it is still running local (and I do not want to open it up yet) that is unfortunately not possible. You do not have enough information from the logs?

Mohit-3196 commented 1 year ago

Hi @JustJoostNL , Sure, please share the ant-media-server.log file and the streamId along with the time frame of the issue so that I can check it.

Thank you

mekya commented 1 year ago

Hi @Mohit-3196 & @JustJoostNL ,

Thank you for your collaboration.

I think we can also approach the issue in a reproduction scenario. Shall we get your MP2T file to test it on our end? @JustJoostNL

Take care

Regards Oguz

JustJoostNL commented 1 year ago

@mekya Sure, here's the MP2T URL I am using (this URL is valid for 48 hours, please ask a new one if needed).

URL: http://lemon.catchmeifyo.com:8000/61455002095/49329202058/16268

Mohit-3196 commented 1 year ago

Hi, @mekya abi, Thank you for your inputs. @JustJoostNL , Thank you for providing the MP2T file.

I checked the issue and created a stream with the MP2T source file with adaptive bitarte, for WebRTC play the audio seems distorted whereas for HLS there is no audio. The source seems to have multiple audio codecs as ffprobe

We will check about the compatibility of these and get back to you @JustJoostNL

Thank you

mekya commented 1 year ago

Thank you @Mohit-3196 and @JustJoostNL ,

Shall we record the stream source for a couple of minutes with ffmpeg so that we can make the tests anytime we want? Here is the typical command for that.

ffmpeg -i STREAM_SOURCE -codec copy  output_video.ts

@JustJoostNL , Your expectation is to play all audio streams in WebRTC playback or is it ok to get started with just one of them?

JustJoostNL commented 1 year ago

If you want to record it, that’s fine.

I didn’t know there were multiple audio streams, but for me it’s fine to just playback with 1 of them (the main one).

Mohit-3196 commented 1 year ago

Hi @mekya abi, Thank you for your input.

@JustJoostNL , For a workaround solution, you can add the MP2T source in OBS studios as VLC Media source and stream to your Ant Media Server with RTMP. In this case, you will not have to use transcoding on the server side. I checked and it worked for me. Let me know if the workaround solution works for you and meanwhile we will check the codec issue.

Thank you

JustJoostNL commented 1 year ago

Thanks for your answer!

I know it does work in OBS, but I do not have access to it all time time, and it would also be nice to use it in my current streaming stack.

Thanks for taking the time to try and resolve this issue!

Mohit-3196 commented 1 year ago

Hi @JustJoostNL , OK, I see. We'll investigate the codec comparability issue and resolve it soon.

JustJoostNL commented 1 year ago

Any updates on this? 🙂

Mohit-3196 commented 1 year ago

Hi @JustJoostNL , I couldn't follow up on this on Monday. I will discuss this more with the developer and will update you about the roadmap.

Thank you.

JustJoostNL commented 1 year ago

Thanks!

Mohit-3196 commented 1 year ago

Hi @JustJoostNL and everyone, Currently, the team is already loaded with existing development tasks. So we look forward to adding support for decoding these codecs (AC3 and MP2) in the future and the issue will be scheduled in the coming weeks as per the availability of the team and the priority.

FYI, please.

Thank you.

JustJoostNL commented 1 year ago

No problem! If in some time it gets implemented, please let me know 🙂

messlaaa commented 8 months ago

@mekya Sure, here's the MP2T URL I am using (this URL is valid for 48 hours, please ask a new one if needed).

URL: http://lemon.catchmeifyo.com:8000/61455002095/49329202058/16268

http://lemon.catchmeifyo.com:8000 where can i buy thiss iptv can you tell me thnxx

mekya commented 4 months ago

hi,

This feature is not implemented. @JustJoostNL if you're interested, we can revisit this issue to set the priority again.

Cheers Oguz

JustJoostNL commented 4 months ago

Hey @mekya

I am still interested in this.

Thanks.

mekya commented 4 months ago

Hi @JustJoostNL,

Thank you. We've fixed one scenario about the audio issue in MP2T streams. I'm wondering if that fix helps for this issue.

Is there anything that I can test?

Btw, if this is working for you, how many streams and viewers do you have at a time? I'm just looking for some reasons to increase the priority of this issue on our end in allocating resources.

Cheers Oguz

JustJoostNL commented 4 months ago

Hey @mekya,

Unfortunately I don't have any MP2T stream to test, but I think it should be pretty easy to create such a stream using FFMPEG.