Convert Plugin - Artwork not embedded

I have my library mostly as FLAC files with embedded artwork. When I use the convert plugin and the appropriate options, the resulting files do not have embedded artwork. This seems to happen with all file formats.

Below are example commands that I am using along with the convert section of my config file. I know the copy_album_art is only supposed to work with the -a flag, but artwork is not embedded whether I use it or not.

How can I get beets to embed the artwork in the resulting files?

beet convert -a album:in the garden
beet convert album:in the garden

convert:
    auto: no
    album_art_maxwidth: 2400
    copy_album_art: yes
    dest: ~/Music/_Converted
    embed: yes
    never_convert_lossy_files: yes
    paths:
        default: $albumartist/$album%aunique{}/%if{$multidisc,$disc-}$track - %if{$trackArtist,$artist - }$title
        singleton: $artist/$artist - $title
        comp: $albumartist/$album%aunique{}/%if{$multidisc,$disc-}$track - $artist - $title
    format: aac
    formats:
        flac:
            command: ffmpeg -i $source -y -vn -acodec flac -compression_level 8 $dest
        alac:
            command: ffmpeg -i $source -y -vn -acodec alac $dest
            extension: m4a
        opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
        aac:
            command: ffmpeg -i $source -y -vn -acodec aac -aq 2 $dest
            extension: m4a

Hmm; that’s odd—I think this should “just work” as is. Can you include a verbose log?

Here is a dump of beet -vv convert -a album:in the garden using the previously shown config file. Thanks for looking into this.

pete@iMac-2017 ~ % beet -vv convert -a album:in the garden
user configuration: /Users/pete/.config/beets/config.yaml
data directory: /Users/pete/.config/beets
plugin paths:
Sending event: pluginload
inline: adding item field disctot
inline: adding item field multidisc
inline: adding item field isLossless
inline: adding item field trackArtist
inline: adding item field source
inline: adding album field avgBitrate
lastgenre: Loading canonicalization tree ~/.config/beets/lastgenre_canonical.yaml
rewrite: adding template field artist Ace.*Paul Carrack
rewrite: adding template field artist Baz Luhrmann presents
rewrite: adding template field artist Black Sabbath.*
rewrite: adding template field artist Creedence Clearwater Revival.*
rewrite: adding template field artist .*Dan Gibson.*
rewrite: adding template field artist Elton John.*
rewrite: adding template field artist Emmett E. Miller.*
rewrite: adding template field artist .*Johann Sebastian Bach.*
rewrite: adding template field artist John Powell.*
rewrite: adding template field artist .*Ludwig van Beethoven.*
rewrite: adding template field artist Mason Williams.*
rewrite: adding template field artist Missy Elliott.*
rewrite: adding template field artist Orion Too.*
rewrite: adding template field artist Prince*
rewrite: adding template field artist Steven Halpern.*
rewrite: adding template field artist The Roc Project.*
rewrite: adding template field artist .*Wolfgang Amadeus Mozart.*
rewrite: adding template field albumartist Eric Clapton.*
rewrite: adding template field media .*Vinyl.*
rewrite: adding template field media 8cm CD
library database: /Users/pete/.config/beets/musiclibrary.db
library directory: /Volumes/Data/Music
Sending event: library_opened
Eurythmics - In the Garden - 1981 - 1981 - False
Convert? (Y/n) y
convert: Encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/01 - English Summer.flac
convert: Encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/02 - Belinda.flac
convert: Encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/03 - Take Me to Your Heart.flac
convert: Encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/04 - She's Invisible Now.flac
convert: Encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/05 - Your Time Will Come.flac
convert: Encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/06 - Caveman Head.flac
convert: Encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/07 - Never Gonna Cry Again.flac
convert: Encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/08 - All the Young (People of Today).flac
convert: Finished encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/07 - Never Gonna Cry Again.flac
Sending event: write
Sending event: after_write
Sending event: after_convert
convert: Encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/09 - Sing-Sing.flac
convert: Finished encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/04 - She's Invisible Now.flac
Sending event: write
Sending event: after_write
Sending event: after_convert
convert: Encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/10 - Revenge.flac
convert: Finished encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/03 - Take Me to Your Heart.flac
Sending event: write
Sending event: after_write
Sending event: after_convert
convert: Finished encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/02 - Belinda.flac
Sending event: write
Sending event: after_write
Sending event: after_convert
convert: Finished encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/01 - English Summer.flac
Sending event: write
Sending event: after_write
Sending event: after_convert
convert: Finished encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/06 - Caveman Head.flac
Sending event: write
Sending event: after_write
Sending event: after_convert
convert: Finished encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/08 - All the Young (People of Today).flac
Sending event: write
Sending event: after_write
Sending event: after_convert
convert: Finished encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/05 - Your Time Will Come.flac
Sending event: write
Sending event: after_write
Sending event: after_convert
convert: Finished encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/09 - Sing-Sing.flac
Sending event: write
Sending event: after_write
Sending event: after_convert
convert: Finished encoding /Volumes/Data/Music/Albums/E/Eurythmics/1981 - In the Garden [CD]/10 - Revenge.flac
Sending event: write
Sending event: after_write
Sending event: after_convert
Sending event: cli_exit

Aha, I think I see! The plugin only tries to embed converted artwork when there is associated art for the album—i.e., an image file, not art embedded in the track’s metadata.

I realize that’s somewhat counter-intuitive (the original files have embedded art, so why wouldn’t the new ones?), so maybe we should provide an option to fix that. But to explain what’s going on here, the plugin works in two phases:

  1. Do the transcoding (producing a metadata-less audio file).
  2. Apply metadata (including embedding art) to the transcoded files.

Step #2 works by getting data from the beets database, not from the embedded tags on the original files. So it’s logical that album art would work the same way: beets checks if it is aware of art associated with that album and embeds it. It doesn’t try to read the ID3 (or whatever) tags on the original files and move those over to the new files either.

I hope that clarifies! As I said above, maybe we should reconsider this—if it’s important to your workflow, please consider opening a feature request ticket.

That all makes sense. Thanks for the explanation. I will consider filing a feature request; however, I have found a workaround in the interim for FLAC, ALAC, and AAC files.

It seems like FFmpeg treats the embedded artwork as a video stream and the -vn switch in the default command is what removes it from the file. From the FFmpeg manual:

-vn ( input/output )

As an input option, blocks all video streams of a file from being filtered or being automatically selected or mapped for any output. See -discard option to disable streams individually.

If I modify the command and change -vn to -vcodec copy, then the artwork is embedded correctly in the output conversion. I’m not sure this is ideal since we normally want to deal with just audio and this assumes that the only video stream is the artwork, but this workaround seems solid and the output files play in a variety of players. This also has the added benefit that the -a flag is not required when writing the beet convert query and track level queries will still have embedded artwork.

Here are my complete format commands to be used in the convert section of my config file:

 formats:
        flac:
            command: ffmpeg -i $source -y vcodec copy -acodec flac -compression_level 8 $dest
        alac:
            command: ffmpeg -i $source -y -vcodec copy -acodec alac $dest
            extension: m4a
        aac:
            command: ffmpeg -i $source -y -vcodec copy -acodec aac -aq 4 $dest
            extension: m4a

Again this only works with FLAC, ALAC, and AAC. I was not able to get this to work with opus files (didn’t try others), so an official fix is probably best. Then the -vn switch can be inserted and the artwork still copied correctly.

1 Like