If I have a .opus file, how can I use FFmpeg to set the album art?

1

If I have a .opus file, how can I use FFmpeg to set the album art?

I've had success with:

ffmpeg -i Pogo.mp3 -i StellarDrone.png -map 0:0 -map 1:0 -codec copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" out.mp3

Using Pogo.mp3 and Stellardrone.png as test files. This doesn't work for .opus apparently though.

ffmpeg -i Hotlines.opus -i StellarDrone.png -map 0:0 -map 1:0 -codec copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" out.opus
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: 
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
Input #0, ogg, from 'Hotlines.opus':
  Duration: 00:04:01.00, start: -0.960000, bitrate: 359 kb/s
    Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
    Metadata:
      ARTIST          : ChrisKeya
      FMPS_PLAYCOUNT  : 0
      FMPS_RATING_AMAROK_SCORE: 0.04
      TITLE           : Hotlines
    Stream #0:1: Video: png, rgb24(pc), 1280x720 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Cover (front)
      title           : ChrisKeya - LateNight [Full EP].png
Input #1, png_pipe, from 'StellarDrone.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, rgb24(pc), 1280x720 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
[opus @ 0x55a1a7d72100] Unsupported codec id in stream 1
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
    Last message repeated 1 times

Of particular interest is the section is red:

[opus @ 0x55af9c499100] Unsupported codec id in stream 1
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

Sarah Szabo

Posted 2018-06-21T23:14:31.563

Reputation: 187

Not implemented. – Gyan – 2018-06-22T04:58:14.743

@Gyan Are you sure? – Sarah Szabo – 2018-06-22T05:04:11.937

Yes, this has been asked multiple times. – Gyan – 2018-06-22T05:06:39.490

@Gyan can you give a source? – Gruber – 2018-10-09T05:56:21.903

See https://trac.ffmpeg.org/ticket/4448 - the linked patch only implements it for .flac but flac and opus muxers are subtypes of the ogg muxer.

– Gyan – 2018-10-09T06:29:49.107

No answers