Opened 17 months ago
Last modified 17 months ago
#11560 new defect
HLS audio streams do not use var_stream_map name in master playlist
| Reported by: | Christian Koop | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | avformat |
| Version: | 7.1 | Keywords: | HLS |
| Cc: | Christian Koop | Blocked By: | |
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description (last modified by )
Summary of the bug:
Setting name in -var_stream_map for audio streams, allows overriding %v in all the related paths.
HLS also writes a name for audio streams into the master playlist,
but it does not use that name. Instead it will continue to use the 'old' auto-generated name (e.g. audio_1).
How to reproduce:
ffmpeg -f lavfi \
-i testsrc=duration=10:size=1280x720:rate=30 \
-f lavfi \
-i sine=frequency=1000:duration=10:sample_rate=44100 \
-c:v libx264 \
-c:a aac \
-shortest \
-f hls \
-hls_time 2 \
-master_pl_name master.m3u8 \
-hls_segment_filename stream_%v/chunk_%d.ts \
-hls_list_size 0 \
-var_stream_map 'v:0,agroup:audio,name:custom_video_name a:0,agroup:audio,name:custom_audio_name,language:und,default:yes' \
stream_%v/manifest.m3u8
Please, pay attention to the created stream_custom_audio_name/ directory and the contents of the master.m3u8 file.
It will contain the audio stream with the auto-generated name.
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_audio",NAME="audio_1" [...]
Why is this an issue?
This name can be used by video players to signal to the user what kind of audio track this is.
There may be multiple ones for a given language (e.g. English and Commentary (in English)), so only using the language to generate a name instead is not always an option.
I do not know of any other option that I could supply to ffmpeg, to add additional metadata to the streams that I could parse for the video player.
Right now, I have to supply a mapping next to the master playlist and use it for the UI.
What did I already find?
- Looks like the
nameparameter was added in https://github.com/FFmpeg/FFmpeg/commit/86f04b918c0d00a286180906279b7ed0f1cd0bed- It only touches
%vbut I think this is unexpected behavior and there should be some way to influence the stream's name
- It only touches
- The audio stream line for the master playlist seems to written in
libavformat/hlsplaylist.c#L48 - Subtitle streams have the parameter
snamethat is used in the master playlist- I am not sure, but maybe a new
anamemight make sense? So you can have%vbe a unique value but the 'display name' of the stream be something else?
- I am not sure, but maybe a new


