Open SebastienChauvin opened 2 years ago
You didn't miss anything :) that's the behavior of the module. The initial idea was that if there is a single audio, the user has no choice, and then it doesn't matter what we put there. But we have recently got a request similar to what you wrote here - in Apple TV the audio is shown as 'Unknown' and some people don't like that. I'm not sure if we can just change the behavior, we'll need to run some tests... we may need to add some directive to control it.
[...] I'm not sure if we can just change the behavior, we'll need to run some tests... we may need to add some directive to control it.
Thanks a bunch for the reply and knowing that I am not alone helps me !
As said I do not mind trying something on my side, I will start looking at the code but any lead / idea on what to change will be welcome.
You can look for references to the multi_audio
flag, e.g.
HLS - https://github.com/kaltura/nginx-vod-module/blob/95cdcbd753513e77f94ce666f0cab5b5abcae888/vod/hls/m3u8_builder.c#L989
DASH - https://github.com/kaltura/nginx-vod-module/blob/8e7268a8239eb953c97a91b4668e79e077edd51f/vod/dash/dash_packager.c#L861
This flag is set when multiple audio labels exist in the set, and this is currently the criteria for using the label. You'll probably just need to change these conditions to check for label.len > 0 instead.
So I have tried a quick fix on our branch that seems to work fine for our purpose.
I have also started looking into a configuration, something to the tune of:
vod_map_label_language_for_single_audio
- syntax:
vod_map_label_language_for_single_audio on/off
- default:
off
- context:
http
,server
,location
When enabled the server outputs label and language even when there is only a single audio track When disabled the server outputs label 'default' and no language when there is only a single audio track
But I got stuck in the way the modules are structured: the m3u8_builder
only sees the m3u8_config_t
conf not the top level one and dash has a similar issue.
We could either forward this general config to both m3u8 and dash builders, or rename this multi_audio flag if that's the only point where it is used.
Anyhow, thanks for the help, we seem to have a solution on our fork and I will try to come back to this for a better proposition.
We have a setup where we need to always specify the audio language in HLS.
With
vod_hls_force_unmuxed_segments on
andwe can extract the audio and have the folowing HLS:
With his setup I have the following issue: The audio track does not contain a correct NAME and does not contain a LANGUAGE so my client does not know the language of the main track (would be much easier for statistics) I would expect:
What works: If I use
vod_hls_force_unmuxed_segments off
and describe multiple audios, I have correct HLSBut this does not work for single audio.
Did I miss something ? I do not mind fork / proposing a PR but I am a bit lost here maybe this is an HLS limitation I am not aware of.