[Abcde-users] How to get the CD folder for the post_encode function

Bernd Fischer-Krellenberg (gmail) bernd.fischerkrellenberg at gmail.com
Fri Jun 19 15:45:36 BST 2015


Hi Andrew,

thanks for the code.
Tested with avconv on Mint and it
works as expected.

Congrats to 2.7.

Best regards,
   Bernd


On 18.06.2015 23:53, andrew wrote:
> Hi again Bernd:
>
> On Thu, Jun 18, 2015 at 09:39:39PM +0200, Bernd Fischer-Krellenberg (gmail) wrote:
>
>> tried to write a post encode function to convert flac to alac.  The
>> point is I can't get the the actual CD folder.  I can get the
>> general output directory with $OUTPUTDIR, but there seems to be no
>> variable for the CD folder.  Tried to use $ALBUMFILE, but this
>> doesn’t work.
>>
>> Any one an idea how to solve this?
> The good news is that now abcde 2.7 has been released my next plan
> involves looking at encoding to alac but I admit that this will
> probably use wine and qaac rather than either avconv or FFmpeg.
>
> But certainly in the short term I have just tested the following
> post_encode function and it works well enough with FFmpeg and
> doubtless will also work with avconv:
>
> #-------------------------------------------------#
> #                                                 #
> # A post_encode function to convert flac files to #
> # alac using FFmpeg (it will probably work with   #
> # avconv as well...).                     Andrew  #
> #                                                 #
> #-------------------------------------------------#
> post_encode ()
> {
> ARTISTFILE="$(mungefilename "$TRACKARTIST")"
> ALBUMFILE="$(mungefilename "$DALBUM")"
>
> if [ "$VARIOUSARTISTS" = "y" ] ; then
> FINDPATH="$(eval echo "$VAOUTPUTFORMAT")"
> else
> FINDPATH="$(eval echo "$OUTPUTFORMAT")"
> fi
>
> FINALDIR="$(dirname "$OUTPUTDIR/$FINDPATH")"
> cd "$FINALDIR"
>
> for j in *.flac
> do
> ffmpeg -i "$j" -c:a alac "${j%.flac}.m4a"
> done
>
> mkdir backup
> mv *.flac backup
> }
>
> A modern FFmpeg neatly copies across the meta data as well which is a
> nice bonus.
>
> All the best,
>
> Andrew
>




More information about the Abcde-users mailing list