Ant-Media-Server icon indicating copy to clipboard operation
Ant-Media-Server copied to clipboard

When re-streaming an MP2T stream the audio get lost

Open JustJoostNL opened this issue 2 years ago • 31 comments

Short description

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

Environment

  • Ant Media Server version: Community Edition 2.5.2 20230105_1947

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.

JustJoostNL avatar Jan 27 '23 17:01 JustJoostNL

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

mekya avatar Jan 30 '23 09:01 mekya

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

JustJoostNL avatar Jan 30 '23 10:01 JustJoostNL

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.

mekya avatar Jan 30 '23 10:01 mekya

I’ll try it later today!

JustJoostNL avatar Jan 30 '23 10:01 JustJoostNL

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

JustJoostNL avatar Feb 01 '23 17:02 JustJoostNL

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

Mohit-3196 avatar Feb 01 '23 17:02 Mohit-3196

The email I used is: [email protected]

JustJoostNL avatar Feb 01 '23 17:02 JustJoostNL

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

Thank you

Mohit-3196 avatar Feb 01 '23 17:02 Mohit-3196

Thanks, going to test now!

JustJoostNL avatar Feb 01 '23 18:02 JustJoostNL

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

JustJoostNL avatar Feb 01 '23 18:02 JustJoostNL

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

Mohit-3196 avatar Feb 02 '23 10:02 Mohit-3196

@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?

JustJoostNL avatar Feb 02 '23 16:02 JustJoostNL

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

Mohit-3196 avatar Feb 02 '23 18:02 Mohit-3196

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

mekya avatar Feb 06 '23 12:02 mekya

@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

JustJoostNL avatar Feb 06 '23 15:02 JustJoostNL

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

Mohit-3196 avatar Feb 07 '23 12:02 Mohit-3196

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?

mekya avatar Feb 07 '23 13:02 mekya

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).

JustJoostNL avatar Feb 07 '23 13:02 JustJoostNL

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

Mohit-3196 avatar Feb 08 '23 15:02 Mohit-3196

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!

JustJoostNL avatar Feb 08 '23 15:02 JustJoostNL

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

Mohit-3196 avatar Feb 08 '23 16:02 Mohit-3196

Any updates on this? 🙂

JustJoostNL avatar Feb 13 '23 18:02 JustJoostNL

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.

Mohit-3196 avatar Feb 14 '23 16:02 Mohit-3196

Thanks!

JustJoostNL avatar Feb 14 '23 16:02 JustJoostNL

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.

Mohit-3196 avatar Feb 27 '23 08:02 Mohit-3196

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

JustJoostNL avatar Feb 27 '23 08:02 JustJoostNL

@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

messlaaa avatar Feb 04 '24 07:02 messlaaa

hi,

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

Cheers Oguz

mekya avatar May 06 '24 17:05 mekya

Hey @mekya

I am still interested in this.

Thanks.

JustJoostNL avatar May 06 '24 17:05 JustJoostNL

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

mekya avatar May 07 '24 14:05 mekya