9

I am trying to convert some flac files which all have coverart embedded to opus with ffmpeg. All but the coverart gets copied over just fine, but I find myself unable to move the cover over as well. Tried all sorts of -mapmetadata stuff I could find so far, but no luck, the result is always missing the coverart.

While the original .flac reports to have a video stream with the coverart

Duration: 00:02:53.51, start: 0.000000, bitrate: 910 kb/s    Stream
#0:0: Audio: flac, 44100 Hz, stereo, s16    Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 500x500 [SAR 1:1 DAR 1:1], 90k
tbr, 90k tbn, 90k tbc

the created opus files does not have any graphics:

size=    2815kB time=00:02:53.51 bitrate= 132.9kbits/s speed= 104x
video:0kB audio:2793kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.811556%

I tried -vcodec copy, -mapmetadata 0, -mapmetadata 0:s:0 so far, with no luck. Doesnt seem to have anything todo with opus, as I have the same problem converting to aac.

So is there a way to get the cover out of the flac file and move it over to the new file in on go using ffmpeg, or do I have to extract it first and then glue it back again later to the new file with extra commands?

Tupsi
  • 91
  • 1
  • 2

2 Answers2

4

ffmpeg doesn't preserve the coverart for opus outfile, but preserve for flac outfile.

makeshift:

$ ffmpeg -i 01.mp3 -f flac - | opusenc - 01.opus

1

This feature, adding cover art to Opus or Ogg files is not implemented yet in ffmpeg. Existing ticket.

Gyan
  • 38,955