[FFmpeg-user] How to crop extra audio channels?

Deron deron at pagestream.org
Sat Mar 17 04:57:50 CET 2012


I have a file I want to general a mono audio file from, but this file 
has 16 audio channels in a single stream (near as I can tell, only the 
first 2 channels have any data in them. Must have been captured from 
HD-SDI). Normally, this works:

ffmpeg -i "file.mov" -f s8 -vn -ac 2 -ar 48000 -acodec pcm_s8 -y 
"file.audio"

Works find for me, but this particular file belches out:

[SWR @ 0x2fe68a0] Input channel layout isnt supported
swr_init() failed
Can not resample 16 channels @ 48000 Hz to 2 channels @ 48000 Hz

What can I do to strip out the offending 14 channels?

Thanks,
Deron

--------------

ffmpeg -i "file.mov" -f s8 -vn -ac 2 -ar 48000 -acodec pcm_s8 -y 
"file.audio"
ffmpeg version N-37208-g01fcbdf Copyright (c) 2000-2012 the FFmpeg 
developers
   built on Jan 26 2012 21:23:21 with gcc 4.5.2
   configuration: --enable-gpl --enable-nonfree --enable-libxvid 
--enable-libx264 --enable-libmp3lame --enable-libvorbis --enable-libfaac
   libavutil      51. 34.101 / 51. 34.101
   libavcodec     53. 60.100 / 53. 60.100
   libavformat    53. 31.100 / 53. 31.100
   libavdevice    53.  4.100 / 53.  4.100
   libavfilter     2. 60.100 /  2. 60.100
   libswscale      2.  1.100 /  2.  1.100
   libswresample   0.  6.100 /  0.  6.100
   libpostproc    52.  0.100 / 52.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2fd53a0] decoding for stream 1 failed
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file.mov':
   Metadata:
     major_brand     : qt
     minor_version   : 537199360
     compatible_brands: qt
     creation_time   : 2012-03-11 02:48:44
   Duration: 00:58:31.21, start: 0.000000, bitrate: 236019 kb/s
     Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, 
720x486, 223724 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 2997 tbc
     Metadata:
       creation_time   : 2012-03-11 03:47:15
       handler_name    : ?Apple Alias Data Handler
     Stream #0:1(eng): Data: none (tmcd / 0x64636D74)
     Metadata:
       creation_time   : 2012-03-11 03:47:15
       handler_name    : ?Apple Alias Data Handler
       timecode        : 00:00:00;00
     Stream #0:2(eng): Audio: pcm_s16be (lpcm / 0x6D63706C), 48000 Hz, 
16 channels, s16, 12288 kb/s
     Metadata:
       creation_time   : 2012-03-11 03:47:15
       handler_name    : ?Apple Alias Data Handler
Incompatible sample format 's16' for codec 'pcm_s8', auto-selecting 
format 'u8'
Output #0, s8, to 'file.audio':
   Metadata:
     major_brand     : qt
     minor_version   : 537199360
     compatible_brands: qt
     creation_time   : 2012-03-11 02:48:44
     encoder         : Lavf53.31.100
     Stream #0:0(eng): Audio: pcm_s8, 48000 Hz, 2 channels, u8, 768 kb/s
     Metadata:
       creation_time   : 2012-03-11 03:47:15
       handler_name    : ?Apple Alias Data Handler
Stream mapping:
   Stream #0:2 -> #0:0 (pcm_s16be -> pcm_s8)
Press [q] to stop, [?] for help
[SWR @ 0x2fe68a0] Input channel layout isnt supported
swr_init() failed
Can not resample 16 channels @ 48000 Hz to 2 channels @ 48000 Hz



More information about the ffmpeg-user mailing list