简体   繁体   English

ffmpeg 连接丢弃音频 stream

[英]ffmpeg concat discards audio stream

What I want to achieve我想要达到的目标
I have two input videos which I do want to concatenate using ffmpeg.我有两个输入视频,我想使用 ffmpeg 连接它们。

Issue问题
The input videos contain two stereo audio channels:输入视频包含两个立体声音频通道:
在此处输入图像描述

after concatenation, the second audio stream is lost:串联后,第二个音频 stream 丢失:
在此处输入图像描述

steps to reproduce重现步骤
The Command I used is我使用的命令是

ffmpeg -f concat -i list.txt -c:a copy -c:v copy demuxed.mp4

Additional Information附加信息
The Console Output shows the second audio stream in input properly:控制台 Output 正确显示输入的第二个音频 stream: 在此处输入图像描述

The Output settings also show that there is only one audio output stream. But I want to have the exact same settings in to out, just concatenated: Output 设置还显示只有一个音频 output stream。但我希望输入到输出的设置完全相同,只是连接起来: 在此处输入图像描述

Assuming that all input videos have matching audio streams, add mapping.假设所有输入视频都有匹配的音频流,添加映射。

ffmpeg -f concat -i list.txt -map 0:v -map 0:a -c:a copy -c:v copy demuxed.mp4

See http://ffmpeg.org/ffmpeg.html#Stream-selection , especially the section on automatic stream selection for details on how ffmpeg selects streams.参见http://ffmpeg.org/ffmpeg.html#Stream-selection ,特别是关于自动 stream 选择的部分,详细了解 ffmpeg 如何选择流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM