fb2k.net

March 14, 2009

How to encode to ALAC using foobar2000

Filed under: tips and tricks — Canar @ 9:56 pm

This one should be pretty easy. I thought it would be almost obvious. But someone asked on IRC and even assumed it was not possible. So, here is how you can encode to ALAC using foobar2000.

  1. Grab a copy of FFmpeg. I am currently hosting FFmpeg v0.5 here on the site because it’s kind of hard to find.
  2. Extract ffmpeg.exe somewhere. I recommend C:\Windows\System32.
  3. Go to Tools -> Converter -> Output formats -> Add new.
  4. Choose Encoder: Custom
  5. Click the “…” button, and browse to where you extracted ffmpeg.exe.
  6. Extension: m4a
  7. Parameters:  -i – -acodec alac %d
  8. Format is: lossless (or hybrid)
  9. Highest BPS supported: 16-bit
  10. Encoder name: ALAC

And now you can encode using ALAC just as you would with any other encoding format! Note that FFmpeg’s ALAC support still has a few bugs, notably the length of the file will be altered. (This means that it is not truly lossless, even though the audio content will not be altered.)

12 Comments »

  1. Thanks Canar. This is exactly what I was looking for. Just ran through this setup and tested. Works as expected. Your instructions are solid. I haven’t done a listen or compare on the stereo running through the Benchmark DAC-1 and Quad 12L Active speakers. I will try to fit that in this weekend and let you know how it sounds.

    Comment by mtnbike — June 11, 2009 @ 2:44 pm

  2. Not working with foobar2000 v1.1 . Can anyone explain why? Or there are newer methods to achieve encoding to alac format^ Thanks

    Comment by baco75 — November 1, 2010 @ 2:21 pm

  3. Just tried and it and got this error:
    An error occurred while writing to file (The encoder has terminated prematurely with code 1 (0×00000001); please re-check parameters) : “H:\My Music\other\Ben Folds\[2010] Lonely Avenue\A Working Day.m4a”
    Additional information:
    Encoder stream format: 44100Hz / 2ch / 16bps
    Command line: “C:\Users\michelle\Downloads\ffmpeg\ffmpeg-0.5\ffmpeg.exe” -i – -acodec alac “A Working Day.m4a”
    Working folder: H:\My Music\other\Ben Folds\[2010] Lonely Avenue\

    What did I do wrong? :(

    Comment by Pete — December 29, 2010 @ 5:09 am

  4. I got the same thing Pete from December 29, 2010 has. Tried to modify all settings still get the error.
    Any one knows how to fix this?

    Comment by XEXE — February 5, 2011 @ 4:26 pm

  5. You can grab the latest ffmpeg at the following link: http://sourceforge.net/projects/mplayer-win32/files/FFmpeg/

    Other than that, I used the same procedure as is listed, and it still works fine. I don’t know what your problems are. I can’t fix them. :/

    ffmpeg has matured, and the warning I gave is no longer valid with the ffmpeg at the link in this comment.

    Comment by Canar — February 5, 2011 @ 5:40 pm

  6. I tried to convert FLAC to ALAC but it didn’t work that parameter written here. I modified to convert using temporary file and it’s working now great:

    -i %s -acodec alac %d

    Comment by BolhasBohom — February 27, 2011 @ 10:33 pm

  7. Hi All!

    Many thanks to Canar! I also had to use the temporary file like BolhasBohom — February 27, 2011 to fix the error message described by Pete — December 29, 2010 -> and it works great!

    Comment by Ondra — May 4, 2011 @ 11:39 am

  8. 1 out of 1 tracks converted with major problems.

    Source: “E:\Música del Cowon\GENESIS-SELLING ENGLAND BY THE POUND\GENESIS-1973 Selling England by the pound-01-Dancing with the moonlit knight.flac”
    An error occurred while writing to file (The encoder has terminated prematurely with code 1 (0×00000001); please re-check parameters) : “C:\Users\Miguel\Documents\FLACS\Dancing with the Moonlit Knight. m4a. m4a. m4a”
    Additional information:
    Encoder stream format: 96000Hz / 2ch / 16bps
    Command line: “C:\Users\Miguel\Desktop\m\ffmpeg-0.5\ffmpeg.exe” -i – -acodec alac “Dancing with the Moonlit Knight. m4a. m4a. m4a”
    Working folder: C:\Users\Miguel\Documents\FLACS\

    Conversion failed: The encoder has terminated prematurely with code 1 (0×00000001); please re-check parameters.

    Hi, I saw your post and I installed ffmpeg and what I copied above is what appears when I try to encode Alac.Do you have any idea what happens? greetings and thanks.

    Comment by Iturribarrigorri — May 14, 2011 @ 2:18 pm

  9. Hello
    First I got the error too. I think you take the config string ‘-i – -acodec alac %d’
    like I did, with copy’n'paste.
    fill it in by hand with your keyboard and it works.

    cu

    Comment by dicemaster — July 31, 2011 @ 8:47 pm

  10. Thanks Canar,

    This perimeter work for me. Cut and paste work for me.

    Comment by nasa88my — November 24, 2011 @ 6:09 pm

  11. -i %s -acodec alac %d

    Thanks Canar, the above perimeter work for me. Great and thanks for solving this great problem for everyone.

    Comment by nasa88my — November 24, 2011 @ 6:11 pm

  12. Hi thanks for your answers, I did it all again as you say but I do not work. I get the same text above , converted with major problems.
    If you think of something let me know, thanks

    Comment by iturribarrigorri — December 8, 2011 @ 1:04 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress