HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - General => Topic started by: AliceWonder on 2012-09-03 07:25:59

Title: Ogg and Cover Art
Post by: AliceWonder on 2012-09-03 07:25:59
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.
Title: Ogg and Cover Art
Post by: AliceWonder on 2012-09-03 08:04:16
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*.
Title: Ogg and Cover Art
Post by: skamp on 2012-09-03 08:51:16
The official way (http://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE) is to use a FLAC METADATA_BLOCK_PICTURE structure (http://flac.sourceforge.net/format.html#metadata_block_picture). 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.
Title: Ogg and Cover Art
Post by: AliceWonder on 2012-09-03 11:02:18
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.
Title: Ogg and Cover Art
Post by: digital_ on 2013-01-04 14:38:29
Does Vorbis tag support BMP pictures?
I've tried to insert BMP file in Vorbis, but Foobar2000 reported an error.
Title: Ogg and Cover Art
Post by: lvqcl on 2013-01-04 15:12:57
from http://wiki.xiph.org/index.php/VorbisComment#Cover_art (http://wiki.xiph.org/index.php/VorbisComment#Cover_art) :

"Picture data should be stored in PNG or JPEG formats..."
Title: Ogg and Cover Art
Post by: Nekit1234007 on 2013-01-04 15:20:36
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.
Title: Ogg and Cover Art
Post by: Walen on 2013-08-18 10:53:32
Can anyone recommend a good player that supports METADATA_BLOCK_PICTURE? (windows/linux/android)
Title: Ogg and Cover Art
Post by: AliceWonder on 2014-03-21 17:19:15
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.
Title: Ogg and Cover Art
Post by: lothario15 on 2014-11-12 15:59:17
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.
Title: Ogg and Cover Art
Post by: marc2003 on 2014-11-12 22:16:40
^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.
Title: Ogg and Cover Art
Post by: lothario15 on 2014-11-16 23:35:55
^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.