[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
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
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