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?

2
  • Did you try with -map 0 and -vcodec copy? The picture is registered as a regular stream, not metadata.
    – Gyan
    May 15, 2017 at 18:57
  • I already tried -vcodec copy as mentioned above. -map 0 gives me an error,
    – Tupsi
    May 16, 2017 at 16:16

2 Answers 2

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.

2
  • so I would first dump the cover to a file (with ffmpeg?), convert it to opus and then stitch the cover back onto the opus file with a different program?
    – Tupsi
    May 16, 2017 at 17:21
  • yeah ok, its simple, just found opusenc and it is doing just fine what I need. Anyway thanks for the pointers!
    – Tupsi
    May 16, 2017 at 17:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .