Log in

View Full Version : Transcoding FLAC


super.rad
24th May 2009, 22:09
I recently ripped my music collection as FLAC but at the time didn't know about the different compression levels. Is there a program for linux (or can someone tell me the commands for the terminal) that can transcode my flac files to the highest compression (smallest files) without any quality loss as I'm starting to run out of room on my drive. Thanks

Keiyakusha
25th May 2009, 02:02
You can use Foobar2000. Load all tracks, set path to the flac encoder and compression level in settings.
If your files have some tags - they should be saved.

super.rad
25th May 2009, 02:54
Thanks but foobar2000 doesn't have a linux version, and I dont want to install it in wine

Dark Shikari
25th May 2009, 02:57
The official flac encoder can do that, as can ffmpeg.

super.rad
25th May 2009, 12:19
Thanks, I've had a look through man flac but can't quite work out what I'd need to type to transcode a flac file to another flac file with compression level 8 (also how would i transcode .m4a files to flac compression level 8?)

J_Darnley
25th May 2009, 12:33
flac in.flac -o out.flac

As for decoding aac, try using faad2 after reading the docs (I haven't read them), with something like:
faad in.m4a -o - | flac - -o out.flac

super.rad
25th May 2009, 13:11
does it matter where I type the -V8 to set the compression level?

J_Darnley
25th May 2009, 13:22
No I don't think so, but the usual convention is to put them before the input file.

Inspector.Gadget
25th May 2009, 14:54
DO NOT TRANSCODE AAC .M4A files to FLAC. Lossy to lossless is dumb. If you're actually going from ALAC .M4A files, then use ffmpeg to decode ALAC and pipe to FLAC.

juhok
25th May 2009, 15:13
I've used this commandline for simple re-encoding of FLACs
find /top/level/directory -name '*.flac' -exec flac -8Vf {} \;

Here's a bash script for only re-encoding files encoded with older version of FLAC (than target 1.2.1).
#!/usr/local/bin/bash
#
# Original script from http://forums.slimdevices.com/showthread.php?t=34835
#
# Modified to spit out source and target version numbers
#
# Usage; reflac2.sh filename.flac
# Example; find . -name "*.flac" -exec reflac2.sh {} \;

# Target FLAC version
FLACV="1.2.1"

VERSION=$( metaflac --show-vendor "$1" | awk '{ print $3 }' );
if [ "${VERSION}" != "${FLACV}" ] ; then
echo ""${VERSION}" -> "${FLACV}" $1"
flac --best -V --force --silent "$1"
else
echo "NOP (="${VERSION}") $1"
fi

super.rad
25th May 2009, 17:31
DO NOT TRANSCODE AAC .M4A files to FLAC. Lossy to lossless is dumb. If you're actually going from ALAC .M4A files, then use ffmpeg to decode ALAC and pipe to FLAC.

They are ALAC .m4a, I know not to transcode lossy to lossless.
Thanks for the scripts juhok will give those a try