Open eTiMaGo opened 7 years ago
The default behavior of the module is to mux each video with the audio of the same file. Most probable cause for the behavior you describe is that the higher bitrate audios are from an incompatible format. If that is the case, the module tries to match the video to whatever it has, which is the low mono audio. If you think the higher audio tracks are valid, please send a sample URL and your nginx.conf
Hi,
config:
`server { listen 80;
# vod settings
vod_mode local;
vod_last_modified 'Sun, 19 Nov 2000 08:52:00 GMT';
vod_last_modified_types *;
# vod caches
vod_metadata_cache metadata_cache 512m;
vod_response_cache response_cache 128m;
# gzip manifests
gzip on;
gzip_types application/vnd.apple.mpegurl;
# file handle caching / aio
open_file_cache max=1000 inactive=5m;
open_file_cache_valid 2m;
open_file_cache_min_uses 1;
open_file_cache_errors on;
aio on;
location / {
root /var/www/html/;
}
location /status {
vod_status;
}
location /vodmux/ {
alias /mnt/ds/;
vod hls;
vod_hls_absolute_master_urls off;
vod_hls_absolute_index_urls off;
vod_hls_absolute_iframe_urls off;
vod_hls_master_file_name_prefix playlist;
vod_hls_index_file_name_prefix chunklist;
vod_hls_force_unmuxed_segments on;
vod_align_segments_to_key_frames on;
add_header Access-Control-Allow-Headers '*';
add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
add_header Access-Control-Allow-Origin '*';
expires 100d;
}
location /vod/ {
proxy_pass http://localhost/vodmux/;
proxy_set_header Host $host;
proxy_cache STATIC;
proxy_cache_valid 200 7d;
proxy_cache_lock on;
add_header X-Cached $upstream_cache_status;
}
}
`
As for the URL, I am testing over a local network without access from outside. but this is the layout:
http://10.99.10.28/vod/movie/deathnote1/,360p.mp4,480p.mp4,720p.mp4,1080p.mp4,lang/tha/sub-tha.srt,lang/eng/sub-eng.vtt,.urlset/playlist.m3u8
And the Playlist generated:
`#EXTM3U
chunklist-f1-v1.m3u8
chunklist-f2-v1.m3u8
chunklist-f3-v1.m3u8
chunklist-f4-v1.m3u8
Ah, you didn't mention it was multilingual... I don't think HLS supports adaptive audio in this case, so you get one audio per language. However, the module does output multiple audio sets if you have multiple audio codecs (e.g. AAC, AC-3, EAC-3), but I'm quite sure the device does not switch between such sets during playback - it either supports EAC-3 and uses it or it doesn't.
Ah, my bad!
But from what I understand, it is a supported feature. From Flowplayer's hls.js docs:
audioABR | false | If multiple audio groups are present the hlsjs engine will load only one by default, regardless of the current video level. If this option is set to true the corresponding audio track will be loaded on level switch.
which links to this section of the HLS draft specs: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.4.1.1
specifically:
A Playlist MAY contain multiple Groups of the same TYPE in order to provide multiple encodings of that media type. If it does so, each Group of the same TYPE MUST have the same set of members, and each corresponding member MUST have identical attributes with the exception of the URI and CHANNELS attributes.
I never saw such a manifest in Apple's samples, I think by 'encodings' they may have referred only to the use case of multiple audio codecs. I sent them a question about this now. But anyway, this feature is currently not supported.
Understood, just one for the "wishlist" :)
Just to update this thread that I got the below response from Apple -
Got a question – is it possible to have multiple audio bitrates as well as alternative audio renditions in the same manifest? I saw the Apple advanced sample that has multiple audio groups – AAC, AC-3 & EAC-3, but the question is whether it’s ok to have, let’s say, an audio group for AAC 64kbps, one for AAC 128kbps etc.?
Yes. You do need to fill out the entire (two-dimensional, in this case, but it can be three-dimensional with multiple codecs) ladder. That is to say that there must be a group per bitrate, and each group in each bitrate must have a complete set of members.
Will an Apple device switch between such groups adaptively during playback or will it select one of them when playback starts?
Yes. What you need to do is associate each audio bitrate group with one or more Variant Streams (EXT-X-STREAM-INF tags). So for instance, your 64 kbps HE-AAC group might go with the 400 kbps and 800 kbps video variants, and the 128 kbps AAC-LC group might go with all the higher video variants. When the player switches from, say, the 400 kbps tier to the 2 Mbps tier, it will also switch from 64 kbps audio to 128 kbps audio.
I will leave this issue open, but don't think we'll be implementing this feature in the near future.
Cool, thanks for the update, will you post here when this is implemented?
Yes, but as I wrote above, probably won't happen soon
Hi,
Firstly, thanks for this awesome nginx module, I'm having a lot of fun tweaking it just as I need it :)
But a question. I have several video files for ABR, from 360p to 1080p. But each file also have the soundtrack at a different bitrate, i.e. 64kbps mono on 360p, to 256kbps stereo on 1080p
But, when generating a HLS playlist, only the soundtracks from the first file (so, the 64k mono version) are listed.
Is there a way to have sets for audio ABR as well?