HLS ABR + separated audio tracks

Hi,

I'm working on a online transcoding system,

and we're looking to transcode video files to HLS multi bitrate quality


Now,

I transcode the source file into 4 resolutions using ffmpeg


using this kind of command:

ffmpeg -i ${source} \
-pix_fmt yuv420p \
-c:v libx264 \
-b:v 5000k -minrate:v 5000k -maxrate:v 5000k -bufsize:v 3000k \
-profile:v High -level 4.1 \
-x264opts scenecut=0:keyint=75:min-keyint=75 \
-hls_time 3 \
-hls_playlist_type vod \
-r 25 \
-vf scale=w=1920:h=1080:force_original_aspect_ratio=decrease \
-c:a aac \
-b:a 128k \
-ar:a 48000 \
-ac:a 2 \
-hls_segment_filename ../OUT/${base_name}/1080p/1080pp_%06d.ts ../OUT/${base_name}/1080p/1080p.m3u8


which generate this folder & file structure:

master.m3u8
/180p/
/180p/180p.m3u8
/360p/
/360p/360p.m3u8
/720p/
/720p/720p.m3u8
/1080p/
/720p/1080p.m3u8

all those resolutions are muxed (video x264 + audio aac)


But, I'd like to stream un muxed files

- 180p (video only)

- 360p (video only)

- 720p (video only)

- 1080p (video only)

- Audio1 (audio only)


So my question are,

How can FFMPEG generate playlist with elementary streams, and keep synchronisation audio/video ?

How can I structurate my Master Playlist ?

Which muxer do I have to use ? TS or fMP4 ?


The explaination, later on I would like to add additional audio tracks without having to re-encode everything

just re-writing master playlist


Thanks,