VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. I want to separate the channels from a stereo audio to individual mono audio, but the outputs aren't mono files, still stereo audio. Apparently, FFmpeg separates the channels, but instead of getting mono audio, it duplicates the separated channel and generates a stereo audio for each output. I have checked the files in MediaInfo and when I imported it into software as Audition.

    Code:
    FOR %%I in (%idir%\*.%extai%) DO "%ffmpeg%" ^
      -i "%%I" ^
      -filter_complex "[0:a]channelsplit=channel_layout=stereo[left][right]" ^
      -map "[left]" ^
      "%odir%\%%~nI_front_left.%extai%" ^
      -map "[right]" ^
      "%odir%\%%~nI_front_right.%extai%"
    Code:
    FOR %%I in (%idir%\*.%extai%) DO "%ffmpeg%" ^
      -i "%%I" ^
      -filter_complex ^
      "[0:0]pan=1|c0=c0[left];[0:0]pan=1|c0=c1[right]" ^
      -map "[left]" ^
      "%odir%\%%~nI_front_left.%extai%" ^
      -map "[right]" ^
      "%odir%\%%~nI_front_right.%extai%"
    Code:
    FOR %%I in (%idir%\*.%extai%) DO "%ffmpeg%" ^
      -i "%%I" ^
      -filter_complex "channelsplit=channel_layout=stereo[FL][FR]" ^
      -map  "[FL]" "%odir%\%%~nI_front_left.%extai%" ^
      -map  "[FR]" "%odir%\%%~nI_front_right.%extai%"
    I used these codes, but the result was the same.
    Quote Quote  
  2. Use clever FFmpeg-GUI.
    Load your video/audio, click main page, click encode audio stream.
    Set channels to Split channels and click split.
    Done.
    Quote Quote  
  3. Originally Posted by ProWo View Post
    Use clever FFmpeg-GUI.
    Load your video/audio, click main page, click encode audio stream.
    Set channels to Split channels and click split.
    Done.
    There are several files that I want to separate the audio channels into individual files, there is no use for a GUI based on FFmpeg that only allows me to open one file. Also, if a GUI can do that, even more so should be able to do it via CLI.
    Quote Quote  
  4. I've already tested that, and it doesn't work. The answer to that question is supposedly based on FFmpeg help info, and in fact, my scripts are based on that, but the separated audio isn't mono.
    Quote Quote  
  5. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    When I use the command referred to above,
    Code:
    ffmpeg -i stereo.wav -map_channel 0.0.0 left.wav -map_channel 0.0.1 right.wav
    I get two mono wav files

    Image
    [Attachment 86793 - Click to enlarge]
    Quote Quote  
  6. Originally Posted by davexnet View Post
    When I use the command referred to above,
    Code:
    ffmpeg -i stereo.wav -map_channel 0.0.0 left.wav -map_channel 0.0.1 right.wav
    I get two mono wav files

    Image
    [Attachment 86793 - Click to enlarge]
    Thanks, this worked with the mp3 and ac3 audios that I wanted to separate channels. I don't understand why "-filter_complex "channelsplit=channel_layout=" didn't correctly separate channels from stereo audio to mono, but it does with the 5.1 audios.
    Quote Quote  
  7. Try to use https://ffmpeg.org/ffmpeg-filters.html#toc-aformat-1 for left and right output - perhaps ffmpeg automatically add audio format copied from source.
    Quote Quote  
  8. @ naoto89 ,
    I do not know if i can do what you want.
    I just want to make sure I know what you want.
    Is it to take a stereo file with two channels & rip each channel to a mono channel creating two mono channels.
    Then joining those two mono channels into one mono channel that has both the mono channels joined.

    This will split a stereo .wav into left & right mono .wavs.
    Code:
    ffmpeg -i stereo.wav -filter_complex "[0:a]channelsplit=channel_layout=stereo[left][right]" -map "[left]" left.wav -map "[right]" right.wav
    I can not figure out how to merge the left & right mono .wavs into one mono .wav.

    I'm not good with batch script.
    Last edited by cholla; 1st May 2025 at 16:36.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!