FFmpeg pan filter and clipping I have a file that has one video stream and one audio stream with 8 channels. I want to create a new file that will only contain the first 2 channels of the audio stream (no video). I can do this using the pan filter. I also want to clip the file. I can do this using the -ss and -t options. However, when I try to do both together, I get an error.

So, if I run:

ffmpeg -i a.mov -filter_complex "[0:1]pan=2c|c0=c0|c1=c1[stereo]" -map "[stereo]" "a.audio.mov"


It works fine - I get the audio file with the correct channels.

But when I run:

ffmpeg -i a.mov -filter_complex "[0:1]pan=2c|c0=c0|c1=c1[stereo]" -map "[stereo]" -ss 00:00:01 "a.audio.mov"


I get the following error


  [trim for output stream 0:0 @ 0000000002145720] Cannot select channel
  layout for the link between filters trim for output stream 0:0 and
  output stream 0:0.
  [trim for output stream 0:0 @ 0000000002145720] 
  Unknown channel layouts not supported, try specifying a channel layout
  using 'aformat=channel_layouts=something'.


Anyone have any ideas what I'm doing wrong and how to fix it?
This was bug in atrim filter, not supporting unknown channel layouts, it should be fixed in latest ffmpeg.