how to extract multiple audio streams to separate files

Questions involving a Windows version of FFmpeg.
Post Reply
cainishe
Posts: 1
Joined: Sat Oct 19, 2019 4:00 pm

how to extract multiple audio streams to separate files

Post by cainishe » Sat Oct 19, 2019 4:05 pm

Is there any way to extract multiple audio streams from video to separate files only by means of ffmpeg, if we do not know the exact number of income audio streams?
E.G. we have folder in which different video files appear, we need to take only sound from these files (one stream - one file) and input files can have from 2 to 16 audio streams.

pandy
Posts: 255
Joined: Mon Feb 24, 2014 1:46 pm

Re: how to extract multiple audio streams to separate files

Post by pandy » Tue Oct 22, 2019 4:30 pm

Should be possible as ffmpeg support conditional stream processing
something like: -map 0:a:6? should work in your case - if audio stream will be not present then no error - only command line will be long, all 15 mappings with also conditional -c:a? copy plus separate file name like "%~n1_atrack6.mkv"
...

Post Reply
'