[FFmpeg-user] FFmpeg's HLS variant stream mappings for audio streams

Dennis Mungai dmngaie at gmail.com
Wed Sep 25 12:59:12 EEST 2019


Hello there,

When dealing with FFmpeg's HLS muxer's handling of audio streams when
the -var_stream_map option is applied, why is it that an audio stream
cannot be mapped twice to video streams variant?

Attempting to do so aborts with the error:

[hls @ 0x55a6e3f9f7c0] Same elementary stream found more than once in
two different variant definitions #0 and #1
[hls @ 0x55a6e3f9f7c0] Variant stream info update failed with status ffffffea
[tee @ 0x55a6e2ad3e40] Slave
'[bsfs/a=aac_adtstoasc:bsfs/v=dump_extra:f=hls:hls_wrap=30:hls_time=6:hls_list_size=6:hls_segment_type=fmp4:ignore_io_errors=1:hls_flags=+independent_segments:var_stream_map='v:0,a:0
v:1,a:0 v:2,a:0 v:3,a:0 v:4,a:0 v:5,a:0 v:6,a:0 v:7,a:0
v:8,a:0']/home/brainiarc7/Desktop/src/AWEHD/HLS/Gear-%v/manifest.m3u8':
error writing header: Invalid argument
[tee @ 0x55a6e2ad3e40] All tee outputs failed.

Is this limitation by design, and if so, can it be lifted?
There are cases where re-using outputs, such as common audio streams
can save significant CPU cycles by eliminating unneccessary
re-encoding, as demonstrated through the tee muxer.

The workflow in this case can be replicated with the tee muxer with no
issue, but with HLS, re-mapping the same audio output to multiple
variant streams results in error, as shown above.


More information about the ffmpeg-user mailing list