Allow for embedding of album art downloaded by the getalbumart fuction.
Currently this is available for flac (using metaflac), mp3 (using eyed3)
and m4a (using AtomicParsley). This can be invoked in 3 ways:
1. Use the commandline '-B' option (this will also call getalbumart)
2. Use the commandline '-a embedalbumart' option to add to list of actions
3. Use 'embedalbumart' in the 'ACTIONS' list in ~/.abcde.conf
Still needs more development but it is perfectly usable at the moment!
from online by typing in a URL or by typing in the path to a local file.
Q. What if I want my album art embedded?
-A. The philosophy of getalbumart at the moment is to simply place the album
- art in the same location as the encoded files. Perhaps this will change
- one day. In the meantime you can use abcde's post_encode function in
- your ~/.abcde.conf file to embed the album art. Here is an example for
- mp3 embedding using eyeD3:
-
- #----------------------------------------------------------------#
- post_encode ()
- {
- ARTISTFILE="$(mungefilename "$TRACKARTIST")"
- ALBUMFILE="$(mungefilename "$DALBUM")"
- YEAR=${CDYEAR:-$CDYEAR}
-
- if [ "$VARIOUSARTISTS" = "y" ] ; then
- FINDPATH="$(eval echo "$VAOUTPUTFORMAT")"
- else
- FINDPATH="$(eval echo "$OUTPUTFORMAT")"
- fi
-
- FINALDIR="$(dirname "$OUTPUTDIR/$FINDPATH")"
- cd "$FINALDIR"
-
- if [ "$OUTPUTTYPE" = "mp3" ] && [ "$TAGGER" = "$EYED3" ] ; then
- vecho "Preparing to embed the album art..." >&2
- else
- vecho "Not embedding album art, you need mp3 output and eyeD3 tagging..." >&2
- return 1
- fi
-
- if [ -e "cover.jpg" ] ; then
- for i in *.mp3
- do
- eyeD3 --add-image cover.jpg:FRONT_COVER "$i"
- done
- mkdir backup && mv cover.jpg backup
- vecho "Your files have had the album art embedded..." >&2
- else
- vecho "No album art found so no image embedded..." >&2
- fi
- }
- #----------------------------------------------------------------#
-
- Variations of the 'for' loop in this example should work for other encoding
- types. For example with flac:
-
- #--------------------
- for i in *.flac
- do
- metaflac --import-picture-from=cover.jpg "$i"
- done
- #--------------------
-
- With other appropriate adjustments to the $OUTPUTTYPE and $TAGGER checks of
- course...
-
+A. As of abcde 2.8.2 it is possible to have the album art automatically
+ embedded in the mp3 container using eyeD3, embedded in the flac container
+ using metaflac and embedded in the m4a container using AtomicParsley.
+
+ There are 3 different ways to accomplish this:
+
+ 1. Use the command line '-B' option (this will also call getalbumart)
+ 2. Use the command line '-a embedalbumart' option to add to list of actions
+ 3. Use 'embedalbumart' in the 'ACTIONS' list in ~/.abcde.conf
+
+ Next in line will be embedding album art in WavPack files using wvtag
+ and perhaps after that embedding in Ape files...
4. FORMATS
=======
Our_Lady_Peace/01.Supermans_Dead.ogg. This filename munging is customizable,
edit the mungefilename function in your abcde.conf to change it.
+abcde also has the ability to search for and download suitable album art as
+well as automatically embed the album art into the tracks of some containers.
+
Many of the questions related of problems executing abcde have been moved to the
FAQ, which should be distributed along with this package. Refer to that file
for more help.
echo "-1 Encode the whole CD in a single file"
echo "-a <action1[,action2]...>"
echo " Actions to perform:"
-echo " cddb,read,getalbumart,normalize,encode,tag,move,replaygain,playlist,clean"
+echo " cddb,read,getalbumart,embedalbumart,normalize,encode,tag,move,replaygain,playlist,clean"
#echo "-A Experimental actions (retag, transcode)"
echo "-b Enable batch normalization"
+echo "-B Embed albumart (this also activates getalbumart)"
echo "-c <file>"
echo " Specify a configuration file (overrides system and user config files)"
echo "-C <discid#>"
fi
}
+# Optionally embed the albumart downloaded by the getalbumart fuction.
+# FIXME: It would be nice to have this also selectable from within the
+# FIXME: getalbumart function itself. Andrew
+do_embedalbumart()
+{
+ # Set variables:
+ ARTISTFILE="$(mungefilename "$TRACKARTIST")"
+ ALBUMFILE="$(mungefilename "$DALBUM")"
+ YEAR=${CDYEAR:-$CDYEAR}
+
+ # Allow for multiple output formats:
+ for OUTPUT in $(echo $OUTPUTTYPE | tr , \ )
+ do
+
+ # Find the output directory:
+ if [ "$VARIOUSARTISTS" = "y" ] ; then
+ FINDPATH="$(eval echo "$VAOUTPUTFORMAT")"
+ else
+ FINDPATH="$(eval echo "$OUTPUTFORMAT")"
+ fi
+
+ FINALDIR="$(dirname "$OUTPUTDIR/$FINDPATH")"
+ cd "$FINALDIR"
+
+# Instructions for each format, feel free to add more. A good one to add in
+# next would be WavPack embedding using the the new wvtag utility shipped
+# with WavPack 5.1.0 and greater... Andrew.
+ if [ -e "$ALBUMARTFILE" ] ; then
+ case "$OUTPUT" in
+ mp3)
+ for i in *.mp3
+ do
+ "$EYED3" --add-image "$ALBUMARTFILE":FRONT_COVER "$i"
+ done
+ # FIXME: Make the backup process selectable...
+ mkdir "$FINALDIR"/albumart_backup
+ mv "$ALBUMARTFILE" "$FINALDIR"/albumart_backup
+ vecho "Successfully embedded the album art into your $OUTPUT tracks" >&2
+ ;;
+ flac)
+ for i in *.flac
+ do
+ "$METAFLAC" --import-picture-from="$ALBUMARTFILE" "$i"
+ done
+ # FIXME: Make the backup process selectable...
+ mkdir "$FINALDIR"/albumart_backup
+ mv "$ALBUMARTFILE" "$FINALDIR"/albumart_backup
+ vecho "Successfully embedded the album art into your $OUTPUT tracks" >&2
+ ;;
+ m4a)
+ for i in *.m4a
+ do
+ "$ATOMICPARSLEY" "$i" --artwork "$ALBUMARTFILE" --overWrite
+ done
+ # FIXME: Make the backup process selectable...
+ mkdir "$FINALDIR"/albumart_backup
+ mv "$ALBUMARTFILE" "$FINALDIR"/albumart_backup
+ vecho "Successfully embedded the album art into your $OUTPUT tracks" >&2
+ ;;
+ *) vecho "Sorry, abcde does not embed album art for the $OUTPUT container..." >&2
+ esac
+ else
+ vecho "Suitable cover image not found, no embedding done..." >&2
+ fi
+done
+}
+
# do_cdread [tracknumber]
# do_cdread onetrack [firsttrack] [lasttrack]
#
esac
# Parse command line options
-while getopts 1a:bc:C:d:DefgGhj:klLmMnNo:pPr:s:S:t:T:UvVxX:w:W:z opt ; do
+while getopts 1a:bBc:C:d:DefgGhj:klLmMnNo:pPr:s:S:t:T:UvVxX:w:W:z opt ; do
case "$opt" in
1) ONETRACK=y ;;
a) ACTIONS="$OPTARG" ;;
A) EXPACTIONS="$OPTARG" ;;
b) BATCHNORM=y ;;
+ B) GETALBUMART=y ; EMBEDALBUMART=y ;;
c) if [ -e "$OPTARG" ] ; then . "$OPTARG" ; else log error "config file \"$OPTARG\" cannot be found." ; exit 1 ; fi ;;
C) DISCID="$( echo ${OPTARG#abcde.} | tr -d /)" ;;
d) CDROM="$OPTARG" ;;
playlist) DOCDDB=y; DOPLAYLIST=y;;
clean) DOCLEAN=y;;
getalbumart) GETALBUMART=y;;
+ embedalbumart) GETALBUMART=y; EMBEDALBUMART=y;;
esac
done
[ "$MP3ENCODERSYNTAX" = "default" ] && MP3ENCODERSYNTAX=lame
[ "$DOTAG" = "y" ] && NEEDTAGGER=y
[ "$DOREPLAYGAIN" = "y" ] && NEEDMP3GAIN=y
+ [ "$EMBEDALBUMART" = "y" ] && NEEDEYED3=y
;;
flac)
[ "$FLACENCODERSYNTAX" = "default" ] && FLACENCODERSYNTAX=flac
[ "$DOTAG" = "y" ] && NEEDMETAFLAC=y
[ "$DOREPLAYGAIN" = "y" ] && NEEDMETAFLAC=y
[ "$ONETRACK" = "y" ] && [ "$DOCUE" = "y" ] && NEEDMETAFLAC=y
+ [ "$EMBEDALBUMART" = "y" ] && NEEDMETAFLAC=y
;;
spx)
[ "$SPEEXENCODERSYNTAX" = "default" ] && SPEEXENCODERSYNTAX=speexenc
[ "$AACENCODERSYNTAX" = "qaac" ] && NEEDWINE=y
[ "$AACENCODERSYNTAX" = "fhgaacenc" ] && NEEDWINE=y && NEEDATOMICPARSLEY=y
[ "$AACENCODERSYNTAX" = "ffmpeg" ] && [ "$DOTAG" = "y" ]
+ [ "$EMBEDALBUMART" = "y" ] && NEEDATOMICPARSLEY=y
;;
wav)
if [ "$KEEPWAVS" = "y" ]; then
${NEEDWVGAIN+WVGAIN} ${NEEDAPETAG+$APETAG} \
${NEEDCUE2DISCID+$CUE2DISCID} ${NEEDNEROAACTAG+$NEROAACTAG} \
${NEEDGLYRC+$GLYRC} ${NEEDWINE+$WINE} ${NEEDATOMICPARSLEY+$ATOMICPARSLEY} \
- ${NEEDMID3V2+$MID3V2}
+ ${NEEDMID3V2+$MID3V2} ${NEEDEYED3+$EYED3}
do
checkexec "$X"
done
do_replaygain
fi
+if [ "$EMBEDALBUMART" = "y" ]; then
+ do_embedalbumart
+fi
+
# Execute the user-defined post_encode function before cleaning up
post_encode
.B *
Download the album art appropriate for your music tracks with many
user configurable options for download and post download alterations
+including automated embedding of the album art for some containers
.TP
.B *
Grab an audio track (or all the audio CD tracks) from your CD
.TP
.B \-a [actions]
Comma-delimited list of actions to perform. Can be one or more of: cddb, cue,
-read, getalbumart, normalize, encode, tag, move, replaygain, playlist, clean.
-Normalize and encode imply read. Tag implies cddb, read, encode. Move implies
-cddb, read, encode, tag. Replaygain implies cddb, read, encode, tag and move.
-Playlist implies cddb. The default is to do all actions except cue, normalize,
-replaygain, getalbumart and playlist.
+read, getalbumart, embedalbumart, normalize, encode, tag, move, replaygain,
+playlist, clean. Normalize and encode imply read. Tag implies cddb, read,
+encode. Move implies cddb, read, encode, tag. Replaygain implies cddb, read,
+encode, tag and move. Playlist implies cddb. embedalbumart implies getalbumart.
+The default is to do all actions except cue, normalize, replaygain, getalbumart,
+embedalbumart and playlist.
.TP
.B \-b
Enable batch mode normalization. See the BATCHNORM configuration variable.
.TP
+.B \-B
+Enable automatic embedding of album art with certain containers. As of
+abcde 2.8.2 supported containers are mp3 (using eyeD3), flac (using
+metaflac) and m4a (using AtomicParsley). This command line option also
+calls the getalbumart function. Further details of album art embedding
+using the embedalbumart function can be found in the abcde FAQ document
+packaged with abcde.
+.TP
.B \-c [filename]
Specifies an additional configuration file to parse. Configuration options
in this file override those in \fI/etc/abcde.conf\fR or \fI$HOME/.abcde.conf\fR.
Will pass "\-b 192" to the Ogg/Vorbis encoder, without having to modify the
config file
.TP
+.B abcde \-o mp3,flac,m4a -B
+abcde will create mp3, flac and m4a files and also select suitable album art,
+download and embed the album art into all 3 sets of tracks.
+.TP
.B abcde \-W 1
For double+ CD settings: will create the 1st CD starting with the track number
101, and will add a comment "CD 1" to the tracks, the second starting with 201
# Actions to take
# Comma-separated list of one or more of the following:
-# cddb,cue,read,normalize,encode,tag,move,replaygain,playlist,getalbumart,clean,default
+# cddb,cue,read,normalize,encode,tag,move,replaygain,playlist,getalbumart,embedalbumart,clean,default
# encode implies read
# normalize implies read
# tag implies cddb,read,encode
# move implies cddb,read,encode,tag
# replaygain implies cddb,read,encode,tag,move
# playlist implies cddb
+# embedalbumart implies getalbumart
# An action can be added to the "default" action by specifying it along with
# "default", without having to repeat the default ones:
# ACTIONS=default,playlist
https://abcde.einval.com/bugzilla/show_bug.cgi?id=53
and also in the abcde mailing list:
https://lists.einval.com/pipermail/abcde-users/2017-January/000232.html
+ * Allow for embedding of album art downloaded by the getalbumart fuction.
+ Currently this is available for flac (using metaflac), mp3 (using eyed3)
+ and m4a (using AtomicParsley). This can be invoked in 3 ways:
+
+ 1. Use the commandline '-B' option (this will also call getalbumart)
+ 2. Use the commandline '-a embedalbumart' option to add to list of actions
+ 3. Use 'embedalbumart' in the 'ACTIONS' list in ~/.abcde.conf
+
+ Still needs more development but it is perfectly usable at the moment!
abcde 2.8.1.