[FFmpeg-user] Extract all audio regardless of stream/channel count

Markku Vainio Markku.Vainio at craft.fi
Fri Feb 10 15:12:59 EET 2017


I've used this my AudioSplitter.bat script placed in windows "send to" folder for quick access. It could probably be much smarter but anyways it does the job for me. It loops now 50 times and creates 24bit wav files.

set ch=0
set tr=0
set count=0

ffmpeg -i %1 -map 0:%tr% -map_channel 0.%tr%.%ch% -acodec pcm_s24le %1_%tr%_0%ch%.wav
set /A ch +=1

IF %ERRORLEVEL% NEQ 0 goto :nexttrack

if /I %count%==50 goto :eof
set ch=0
set /a tr +=1
set /a count +=1

echo %ch%
echo %tr%
echo %count%





-----Original Message-----
From: ffmpeg-user [mailto:ffmpeg-user-bounces at ffmpeg.org] On Behalf Of Carles Vila
Sent: 10. helmikuutata 2017 13:40
To: FFmpeg user questions <ffmpeg-user at ffmpeg.org>
Subject: [FFmpeg-user] Extract all audio regardless of stream/channel count

I'd like to know if there is a simple way (script) to extract all audios individually from a video. The video could have N stereo streams (normally up to 16), M mono streams (up to 16), or a combination of both. Now I have to write the -map structure manually after probing the input. Ideally I need to end up with as many mono wavs as individual channels.
If you could give me a starting point, I could probably figure out.
Thank you!
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org

To unsubscribe, visit link above, or email ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".

More information about the ffmpeg-user mailing list