[FFmpeg-user] Codec "same" as opposed to "copy"?

Bob Maple bobm-ffmpeg at burner.com
Thu Nov 20 07:58:36 CET 2014


I'm trying to do some audio channel processing, stripping off a bunch of
audio channels from an audio stream with 16 channels, taking the first 2
channels and turning them into 2 mono streams, dumping the remaining 14
channels:

ffmpeg -i manyaudio.mov -map 0:v -map 0:a -map 0:a \
  -codec:v copy -codec:a copy \
  -map_channel 0.1.0:0.1.0 -map_channel 0.1.1:0.2.0 \
  dualmono.mov

However when I use '-codec:a copy' it ignores my channel mapping and I
wind up with 2 x 16-channel streams.

My source's audio codec will typically be either pcm_s16le or pcm_s24le,
but ideally I don't want to care and want to say "use the same codec as
the source."  Is there a way to accomplish this that I'm missing, so I
don't have to probe the source file first to determine the codec in
order to specifically pass it along?


More information about the ffmpeg-user mailing list