Notes about open source software, computers, other stuff.

Embedding album art in FLAC files

I recently wanted to add cover art to my collection of FLAC-encoded audio files. I wrote the following simple script to help me automate the process. Running this script in a given directory (I group my music in directories per artist, followed by a subdirectory for each album) with the name of the album art image file name as argument then automatically embeds the image in the FLAC/Vorbis tag.

#!/bin/bash
#
# This script embeds a given image (usually .jpg) as album art in the
# FLAC files in the present directory (and its subdirectories).
#
# Time-stamp: <2011-07-31 20:43:23 (lennart)>
 
coverart=$1
 
find . -name "*.flac" -print0 |xargs -0 metaflac --import-picture-from="$coverart"

Related Images:

5 Comments

  1. Marjan

    Knap hoor!

  2. Greg Starr

    so what would an example syntax be if I named the file “add-album-art.sh”

    • LCK

      That would be: ./add-album-art.sh cover.jpg, which will tag all flac files in the current directory with the cover.jpg image (assuming the cover image is also stored in the current directory).

  3. Daniel

    How about just using metaflac directly? There is no need for find:
    metaflac --import-picture-from=cover.jpg *.flac

  4. Brett

    I’ve been searching for a few days now.. not sure why it took me so long.. but THANK YOU!!!! For some reason finding how to embed album art into flac is hard to find

Leave a Reply to Brett Cancel reply

Your email address will not be published. Required fields are marked *

© 2024 Lennart's weblog

Theme by Anders NorénUp ↑