kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
2k stars 439 forks source link

HLS audio detection problem. #960

Closed ppllaxxa closed 5 years ago

ppllaxxa commented 5 years ago

Hello, we got an issue during trying to play HLS playlist with multiple audio. Player don't detect different audio. It detects only one.

There is our example: https://api.plsolutions.pro/streamer/hls/none/3a570755-3d5f-4aed-95c5-13713da17b5d/x264/master.m3u8

But on below example: https://bitmovin-a.akamaihd.net/content/sintel/hls/playlist.m3u8 It successfully detect all audio.

We are using player based on this: https://www.w3schools.com/html/html5_video.asp

and also trying in: https://bitmovin.com/demos/drm

erankor commented 5 years ago

The manifest you sent has an AC-3 Russian track and an AAC English track. Since the codecs are different, the module renders each one in a separate audio group. You need to have AAC English + AAC Russian, and optionally also AC-3 English + AC-3 Russian, if you want to use surround.

ppllaxxa commented 5 years ago

Thank you for quick reply.

I understood the reason. But we have the source with 2 audio:

  1. rus in AC-3
  2. eng in AAC

Could you please give us a peace of advise how we could solve such problem?

erankor commented 5 years ago

You can transcode the AC-3 to AAC using ffmpeg. While AC-3 may be higher quality, not all devices support it, so you probably want AAC. If you currently have the audio tracks in a single file with the video, you may want to generate the Russian AAC audio to a separate file, and provide both to the module. You can make it ignore the AC-3 Russian by sending a1 or a2 on the first file (depending on which audio track appears first)

ppllaxxa commented 5 years ago

Thank you,

In source file we have

  1. 6 x mono for 5.1 rus
  2. 2 x mono for stereo eng

Could you please give us a peace of advise which codec we should use for both audio?

erankor commented 5 years ago

As I wrote, I think that for max device coverage, you should use AAC (Stereo)

ppllaxxa commented 5 years ago

Is there a way to stay eng stereo and 5.1 rus and have the possibility in player to switch between them?

We have requirements to provide 5.1 rus and stereo eng in player for users.

erankor commented 5 years ago

I think it's problematic, for example, what happens if some device does not support surround? If you need to support surround, you should create 4 audio tracks - English AAC/AC-3 + Russian AAC/AC-3. You can use ffmpeg to generate the two tracks you are currently missing. Naturally, for English it will have to duplicate the existing 2 channels, so it won't be 'real' surround.

ppllaxxa commented 5 years ago

Thank you!