I want to convert my archived .flac library to .ogg for daily use. Using

find ./ -iname '*.flac' -print0 | xargs -0 -n1 oggenc -q6 

on the root music folder and then deleting every .flac (having copies of them in archive) seems straight forward, after trying it with one file it worked and all of the tags were transfered, too, except for one: Embedded album art!
I always prefer emedded covers over folder images, since I have some albums with varying covers.

One possible solution is discussed here, but the script only works if the image is already extracted: https://superuser.com/questions/169151/embed-album-art-in-ogg-through-command-line-in-linux

One possible solution I thought about was extracting album art from every song (not every song has one, though, and some even 2 or 3!), temporarily saving it and then using the script to include it into the finished .ogg.
But then I want to increase the number of processes xargs runs simultaniously to save time, so the temp images need to have a distinct name.

Is there a (linux) program that knows how to handle this? Or is there a finished script floating around somewhere?

It would be nice if oggenc supported adding embedded coverart and it really is a shame, since these two formats should (in theory) share the same tag format.

  • Did you mean -iname '.wav'? Not -iname '.flac'? I assume the WAVs are not temporary files created from the FLACs because they wouldn't transport any of the tags. Are you using METADATA_BLOCK_PICTURE in the FLACs? Or a different tag for the cover art?
    – Dan Gravell
    Commented Nov 8, 2012 at 10:41
  • @DanGravell Yeah, I meant -iname .flac of course. I directly copied it from the ubuntuusers wiki for convenience’s sake and forgot to change it. I want to stay as close to the specification as possible, so yeah, I want to use METADATA_BLOCK_PICTURE.
    – Profpatsch
    Commented Nov 8, 2012 at 14:27
  • Ok, well another way might be to use metaflac's --export-picture-to=- option to output the picture to stdout and then run that through base64, then import that using vorbiscomment. You would have to use tee to allow multiple processes to work off the file listing, or you could just do it in two batches.
    – Dan Gravell
    Commented Nov 8, 2012 at 15:37
  • If that’s the way to go, why don’t you post it as an answer? I am quite a noob in the shell, still don’t know how to use tee, awk, sed etc, xargs is kind of my maximum capacity atm.
    – Profpatsch
    Commented Nov 8, 2012 at 16:05
  • Because it was an incomplete answer... I didn't have the time to investigate the perfect command line myself. Maybe if you do before me you should post it as the answer.
    – Dan Gravell
    Commented Nov 8, 2012 at 16:44

1 Answer 1


You could try using ffmpeg instead...

ffmpeg -i input.flac -c:a libvorbis -q:a 6 output.ogg

It uses the same vorbis encoding lib that oggenc does, and -q:a is directly mapped to oggenc's -q option. This should preserve all metadata, including album covers.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.