I'm having video streams containing two audio streams (stereo and surround) like this:
Input #0, mpegts, from 'my-stream.ts':
Duration: 00:59:58.72, start: 26.658667, bitrate: 8013 kb/s
Program 1
Metadata:
service_provider: FFmpeg
Stream #0:0[0x100](deu): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 129 kb/s
Stream #0:1[0x101](deu): Audio: eac3 (EAC3 / 0x33434145), 48000 Hz, 5.1(side), fltp, 256 kb/s
Stream #0:2[0x102]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Now I'm trying to convert the streams into HLS so it can by played on an android with ExoPlayer and the user can choose between the audio streams (means if the user hits the gear button on the bottom right, both audio streams are offered to select between).
I've tried to convert it with a command like this:
ffmpeg -i my-stream.ts -map 0:v:0 -map 0:a:0 -map 0:a:1 -codec:v copy -codec:a copy -f hls -hls_time 5 -hls_list_size 0 -hls_segment_filename "segment_%03d.ts" -master_pl_name "master.m3u8" -var_stream_map "v:0,a:0 v:0,a:1" -hls_flags independent_segments stream_%v.m3u8
but it fails with error
Same elementary stream found more than once in two different variant definitions #0 and #1
I must admit that I have absolutely no idea what all that does, hence I don't know where to go from here.
How to properly create the playlist?