[FFmpeg-user] Need help splitting stereo FLAC into two separate files

Reino Wijnsma rwijnsma at xs4all.nl
Sun Apr 5 20:46:22 EEST 2020

On 2020-04-05T18:45:27+0200, Net Net <dastiegen at gmail.com> wrote:
> [...] I tried map_channel and it worked great for a single file:
> *ffmpeg -i 1.flac -map_channel 0.0.0 1left.flac -map_channel 0.0.1 1right.flac*
> Now, I have several hundred of these flacs to split, named 001.flac,
> 002.flac, 003.flac etc.  I want them to be split into eg. 001left.flac,
> 001right.flac etc.  A few attempts with Windows wildcards didn't work.
> Can anyone tell me how, or point me to the right documentation pack for
> figuring this out?
Use a for-loop:

FOR %A IN (*.flac) DO @ffmpeg -i %A -map_channel 0.0.0 %~nAleft%~xA -map_channel 0.0.1 %~nAright%~xA

This will process all flac-files sorted by filename. If you want to process them sorted by date for instance, then you can do:

FOR /F "delims=" %A IN ('DIR /B /O:D *.flac') DO @ffmpeg -i %A -map_channel 0.0.0 %~nAleft%~xA -map_channel 0.0.1 %~nAright%~xA

-- Reino

P.s. Please don't top-post <http://www.idallen.com/topposting.html> here. Thank you.

More information about the ffmpeg-user mailing list