FFMPEG – Codec type mismatch for mapping #0.0 -> #0.0

Maybe you have already faced this error while trying to mix an audio with a video file, and it is very frustrating, mainly if you have a very pressed customer. In my case, this was my command line:

ffmpeg -i 1.wav -i 1.webm -map 0:0 -map 1:0 1.mp4

And the corresponding error:

Codec type mismatch for mapping #0.0 -> #0.0

This occured because:

  • Firstly, i was mixing the audio file before the video file, while ffmpeg only expects streams in the following order “video, audio”, maybe because of videos random bitrates, don’t ask me why, if you have an idea to share, you’re welcome.
  • Secondly, my ffmpeg version on my Linux server was experimental about AAC formats, because ffmpeg converts my .wav to .aac, so the tip was to specify that are in experimental mode. This is the working command:

ffmpeg -i 1.webm -i 1.wav -stric experimental -map 0:0 -map 1:0 1.mp4

That’s all, hope this could be helpful for you in the future.

FFMPEG – Codec type mismatch for mapping #0.0 -> #0.0