Find the answer to your Linux question:
Results 1 to 6 of 6
I have a lot of FLAC files from backing up my CD collection. When I ripped them to FLAC, I did not realize different compression rates existed, so these were ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2011
    Posts
    13

    Question Need to compress preexisting FLAC files.


    I have a lot of FLAC files from backing up my CD collection. When I ripped them to FLAC, I did not realize different compression rates existed, so these were all ripped with -0.

    I'd like to compress these to -8. (Please don't turn this thread into a compression rate debate) Is there a way -using linux- to compress these files, or do I have to re-rip my CD's alllll over again?

    A tool that could do this in bulk, say one directory at a time would be the best I could hope for. I could run this at night or when away from the computer when there are plenty of clock-cycles just waiting to be used.

    Thank you for your help.

  2. #2
    JDT
    JDT is offline
    Just Joined!
    Join Date
    Feb 2005
    Posts
    4
    FLAC is lossless so this parameter only affects file size verses decoding speed. The quality is always the same as the original.

    It's probably not worth bothering unless you want the smallest possible file size. Not sure what difference the "Compression Level Parameter" will make to the file size.

    It would be quite easy to write a small bash script that would call ffmpeg on all flac files in a folder. convert them back to .wav, then re-convert them to flac again.

  3. #3
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,890
    Quote Originally Posted by JDT View Post
    It would be quite easy to write a small bash script that would call ffmpeg on all flac files in a folder. convert them back to .wav, then re-convert them to flac again.
    Is it not possible to have ffmpeg just re-encode (i.e. input file type of flac and output file type also of flac) without going to WAV? Anyway, to help the OP along, here is the documentation page for ffmpeg - it's a very capable tool.
    Linux user #126863 - see http://linuxcounter.net/

  4. #4
    Just Joined!
    Join Date
    May 2011
    Posts
    13
    Quote Originally Posted by JDT View Post
    FLAC is lossless so this parameter only affects file size verses decoding speed. The quality is always the same as the original.

    It's probably not worth bothering unless you want the smallest possible file size. Not sure what difference the "Compression Level Parameter" will make to the file size.
    It can be fairly significant as the following shows. These are the first 3 tracks off an audio book ripped at 0, 4 and 8. As you can see the space savings -especially when repeated over a lot of files, can really add up.


    0
    Code:
    -rw------- 1 Wyatt users  4676467 Nov 23 10:32 Track 01.flac
    -rw------- 1 Wyatt users  2990916 Nov 23 10:33 Track 02.flac
    -rw------- 1 Wyatt users 17690350 Nov 23 10:42 Track 03.flac

    4
    Code:
    -rw------- 1 Wyatt users 2290614 Nov 23 10:43 Track 01.flac
    -rw------- 1 Wyatt users 1457597 Nov 23 10:44 Track 02.flac
    -rw------- 1 Wyatt users 8702583 Nov 23 10:48 Track 03.flac

    8
    Code:
    -rw------- 1 Wyatt users 2267143 Nov 23 10:49 Track 01.flac
    -rw------- 1 Wyatt users 1445076 Nov 23 10:50 Track 02.flac
    -rw------- 1 Wyatt users 8647509 Nov 23 10:54 Track 03.flac








    It would be quite easy to write a small bash script that would call ffmpeg on all flac files in a folder. convert them back to .wav, then re-convert them to flac again.
    That (a script) was kind of what I was hoping someone would be able to help with. :o)

  5. #5
    JDT
    JDT is offline
    Just Joined!
    Join Date
    Feb 2005
    Posts
    4
    Well, after a very quick bit of DuckDuckGo -ing, I have found this article:
    https: // blogs.fsfe.org / marklindhout / 2012 / 11 / converting-flac-files-to-mp3-with-ffmpeg-and-bash/

    Probably by modifying the ffmpeg command it can be adapted to do what you want.

    Also look-up bash: "foreach".

    Edit: I am not allowed to post URL's so have inserted a few spaces into the URL above!

  6. #6
    Just Joined!
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    38
    Code:
    find . -name '*.flac' -exec flac -8 -f '{}' \;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •