Search code examples
audioffmpegconcatenation

ffmpeg concat discards audio stream


What I want to achieve
I have two input videos which I do want to concatenate using ffmpeg.

Issue
The input videos contain two stereo audio channels:
enter image description here

after concatenation, the second audio stream is lost:
enter image description here

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: enter image description here

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: enter image description here


Solution

  • 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.