Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Ogg and Cover Art (Read 31697 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Ogg and Cover Art

This is what I tried, from command shell:

echo "METADATA_BLOCK_PICTURE=`base64 --wrap=0 cover.jpg`" > picture.meta
vorbiscomment -c picture.meta song.ogg

When I look at song.ogg I can see it is in the vorbis comments, but when I add the song to my rhythmbox library - no album art.

Am I do something wrong or does rhythmbox just not support album art with ogg?

It does with both flac and mp3 but both metaflac and lame have switches for adding album art, vorbiscomment does not appear to.

Ogg and Cover Art

Reply #1
Gawd - I'm reading osdir mailing list archives trying to find how to do this from command line tools and suddenly audio adverts start blasting.
Why osdir ?? why? You use to be one of the good guys. *ah well*.

Ogg and Cover Art

Reply #2
The official way is to use a FLAC METADATA_BLOCK_PICTURE structure. Base64 data of the picture itself is not enough. I haven't tested embedded artwork in Ogg files though, I don't know what playback software supports it.

Ogg and Cover Art

Reply #3
If it is suppose to end up looking the way an embedded image within a flac file looks, looks like I'm out of luck with the reference encoder and vorbiscomment then, I guess I'll have to wait for them to come up with a command switch similar to what is in metaflac for adding artwork. I believe I'm running the latest vorbis-tools, I don't want to mess with a third party tool to embed them.

Ogg and Cover Art

Reply #4
Does Vorbis tag support BMP pictures?
I've tried to insert BMP file in Vorbis, but Foobar2000 reported an error.


Ogg and Cover Art

Reply #6
Does Vorbis tag support BMP pictures?
I've tried to insert BMP file in Vorbis, but Foobar2000 reported an error.

This is a bad idea to store BMP pictures as an album art inside audio files, especially if they’re big. You can convert those to png without any loss of quality and they are supported pretty much by all of the media containers.

 

Ogg and Cover Art

Reply #7
Can anyone recommend a good player that supports METADATA_BLOCK_PICTURE? (windows/linux/android)

Ogg and Cover Art

Reply #8
Can anyone recommend a good player that supports METADATA_BLOCK_PICTURE? (windows/linux/android)


It's working for me in any of the GStreamer based audio players.

Flac, ogg vorbis. ogg opus - all display art added with that tag.

Ogg and Cover Art

Reply #9
I thought I'd resurrect an old thread to share my solution for adding cover art to Ogg files.

Formerly, I encoded from FLAC to Vorbis with simple bash/batch scripts and added a jpeg to the output folder as cover art.  For a while, this was great; my FLAC to Vorbis scripts use metaflac-extracted values to create an output folder structure and the encoders automatically transfer metadata.  Minimal user input = perfect.

However, new devices have since necessitated that I move from the cover.jpg-in-music-folder approach to embedding a jpeg in the file's metadata.  Initially, I relied on a GUI tool to ensure cover art was written and could be read correctly; in Linux I used Puddletag and when using Windows I used MP3Tag.

Being lazy, I soon tired of the monotony of manually adding cover art using a GUI so sought commands that I could add to scripts to automate the process.  I tried the base64-encoding method described by the OP but also found the results unsatisfactory.  Fortunately, a little digging uncovered kid3-cli.

kid3-cli ticked all my boxes; it's a cross-platform, it's a command-line utility and it can be called in scripts.  I appended the following to my scripts to automatically add cover art:

Code: [Select]
kid3-cli -c "select all" -c 'set picture:"/path/to/Cover.jpg" "back cover"' "/path/to/*.ogg"


In this example, the command selects all .ogg files in a directory and adds the image at /path/to/Cover.jpg as the back cover.  Like Puddletag, it uses the mutagen library to write the METADATA_BLOCK_PICTURE and handles Vorbis files without issues (the only problem I've had is its failure to add cover art to Opus files in Linux with opus-tools 0.1.8).  The kid3-cli.exe Windows executable works identically (and works perfectly with Opus files too).

Apologies for the long post but hope it helps somebody.

Ogg and Cover Art

Reply #10
^it's cool that you've posted a cross-platform solution but seeing as you mentioned mp3tag, it is worth noting it has options to batch embed art for a whole collection at once. another windows option is to use foobar2000. if embedded art exists in the source file, it can be transferred during conversion into any of the formats that it can tag.

Ogg and Cover Art

Reply #11
^it's cool that you've posted a cross-platform solution but seeing as you mentioned mp3tag, it is worth noting it has options to batch embed art for a whole collection at once. another windows option is to use foobar2000. if embedded art exists in the source file, it can be transferred during conversion into any of the formats that it can tag.


Yeah, I used the Puddletag/MP3Tag 'Import cover' action to batch import cover art to my existing files but my problem was with new additions to my music library.

I'm regularly discovering new music but I'm old-school - I need to own it rather than merely stream it.  It quickly becomes tiresome ripping to FLAC, then manually clicking around in GUI to transcode using two different Ogg settings, then resizing the transferred cover art (I use high quality jpeg/png images in my archival FLAC library which can sometimes be 5MB or more; I resize them to 600px to save space on my mobile device), then clicking around to batch import the resized images, then finally deleting those images.  That's why it had to be a command-line solution.

I now have a transcode script which uses metaflac to extract the high-quality cover art from the FLAC files,
Code: [Select]
metaflac  --export-picture-to=COVERFILE.jpg

resizes the extracted art to a 600px jpeg at 85% quality with imagemagick's mogrify command,
Code: [Select]
mogrify -resize 600x600 -quality 85 "$COVERFILE.jpg"

transcodes the FLAC files to two Ogg settings with oggenc,
Code: [Select]
oggenc -q5.5 --ignorelength -o "${FLACFILE%.flac}.ogg" "$FLACFILE"

imports the resized cover art with kid3,
Code: [Select]
kid3-cli -c "select all" -c 'set picture:"/path/to/COVERFILE.jpg" ""' "/path/to/*.ogg"

and deletes the jpegs.
Code: [Select]
rm -f *.jpg


This workflow saves me time; hope it helps someone.