FFMPEG channel 映射

标签 ffmpeg

我有一个包含 8 个 channel 的 24 位 WAV 文件。我需要做的是将其转换为 4 24 位两个 channel 文件,其中输出 wav 由源 channel (1,2)、(3,4)、(5,6)、(7,8) 组成。

有人知道使用 FFmpeg 实现这一点的最佳方法吗?

最佳答案

请参阅 ffmpeg docs 中的 -map 和 map_channel :

‘-map [-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]] | [linklabel] (output)’

Designate one or more input streams as a source for the output file. Each input stream is identified by the input file index input_file_id and the input stream index input_stream_id within the input file. Both indices start at 0. If specified, sync_file_id:stream_specifier sets which input stream is used as a presentation sync reference.

The first -map option on the command line specifies the source for output stream 0, the second -map option specifies the source for output stream 1, etc.

A - character before the stream identifier creates a "negative" mapping. It disables matching streams from already created mappings.

An alternative [linklabel] form will map outputs from complex filter graphs (see the ‘-filter_complex’ option) to the output file. linklabel must correspond to a defined output link label in the graph.

和map_channel:

‘-map_channel [input_file_id.stream_specifier.channel_id|-1][:output_file_id.stream_specifier]’

Map an audio channel from a given input to an output. If output_file_id.stream_specifier is not set, the audio channel will be mapped on all the audio streams.

Using "-1" instead of input_file_id.stream_specifier.channel_id will map a muted channel.

关于FFMPEG channel 映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12319129/

相关文章:

azure - 工作人员角色中的ffmpeg不会关闭窗口

javascript - 我如何在另一个 EC2 实例上运行部分代码

ffmpeg - ts 文件中的帧数

html - 按顺序在线播放视频文件,视频之间没有延迟/缓冲

xcode - 从 QtApp 链接到 FFmpeg 时出现 libavcodec.a 链接器错误

php - FFMPEG - 用于动画的 Palettegen 不起作用

python - 子进程中单引号和双引号之间的区别[Python 3.4]

ffmpeg - ffmpeg 中缺少 H264 和 mpeg 配置文件/编码器?

linux - 我需要将一个文件的部分音频添加到另一个文件

python - Pydub 无法定位 ffprobe