shahram kalantari
shahram kalantari

Reputation: 863

Using avconv to select only one audio channel in output

I have a two-channel AAC file and I am trying to get two separate AAC files, each of which with one of the two channels in the original AAC file. Is there an option in avconv that does that? Something like:

avconv -channel=0 -i input.aac input_ch1.aac

avconv -channel=1 -i input.aac input_ch2.aac

Upvotes: 1

Views: 729

Answers (2)

shahram kalantari
shahram kalantari

Reputation: 863

Solved.

This works for an input stereo aac file that has front left and front right channels.

avconv -i input.aac -filter_complex channelsplit="channel_layout=2[FL][FR]" -map [FL] channel1.aac -map [FR] channel2.aac

In case your input file has more than two channels, you can map each channel (either by name as in FL, or by their index starting from zero) to a separate single-channel file.

Upvotes: 3

dovetalk
dovetalk

Reputation: 1991

Assuming you're referring to channels (as opposed to streams), the following ffmpeg command should work:

ffmpeg -i input.aac -map_channel 0.0.0 left.aac -map_channel 0.0.1 right.aac

Upvotes: 1

Related Questions