How can I include cover art images when converting mp3 to mkv using ffmpeg?

I wish to include embedded cover art when converting an mp3 file to mkv (vorbis).

ffmpeg -i input.mp3 output.mkv

will render a file that does play (in mpv) showing an image but the moment I try to seek strange things start to happen.

ffprobe input.mp3

tells me

...
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 160 kb/s
Stream #0:1: Video: mjpeg (Progressive), yuvj444p(pc, bt470bg/unknown/unknown), 600x595 [SAR 1:1 DAR 120:119], 90k tbr, 90k tbn, 90k tbc (attached pic)
Metadata:
  title           : cover.jpg
  comment         : Cover (front)

while

ffprobe output.mkv

tells me

...
Stream #0:0: Video: h264, none(pc, progressive), 600x595, SAR 1:1 DAR 120:119, 1k tbr, 1k tbn, 2k tbc (default)
...
Stream #0:1: Audio: vorbis, 44100 Hz, stereo, fltp (default)

Apparently ffmpeg converts the image to h264 which is not what I want, I want an embedded picture.

How can I tell ffmpeg to just copy the embedded picture instead of converting it to h264?

Read more here: Source link