I
I
Ilya2017-12-04 11:31:29
fmpeg
Ilya, 2017-12-04 11:31:29

How to get specific stereo audio channel from video using ffmpeg?

How to get specific stereo audio channel from video using ffmpeg?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Moskus, 2017-12-04
@Rimush

First run:
to get a list of streams, which will look something like this:

Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x800, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(ger): Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s (default)
    Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s
    Stream #0:3(ger): Subtitle: text (default)

Then - actually extract:
Take the parameter value -mapfrom the list. In this option, the channel will simply be copied without changes. If you also need to recompress it, then you need to -copyset the compression parameters instead.
In order to separate the stereo channels, the command would be:
I'm not sure if the option -map_channelwill work if called directly on a video file, so you may have to first extract the audio stream and then extract the desired channel from it with a second command.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question