can I convert one of this format to compatible 16000.0 Sample Rate FLAC file?

kAudioFormatLinearPCM                   = 'lpcm',
kAudioFormatAppleIMA4                   = 'ima4',
kAudioFormatMPEG4AAC                    = 'aac ',
kAudioFormatMACE3                       = 'MAC3',
kAudioFormatMACE6                       = 'MAC6',
kAudioFormatULaw                        = 'ulaw',
kAudioFormatALaw                        = 'alaw',
kAudioFormatMPEGLayer1                  = '.mp1',
kAudioFormatMPEGLayer2                  = '.mp2',
kAudioFormatMPEGLayer3                  = '.mp3',
kAudioFormatAppleLossless               = 'alac'

I tried using ffmpeg

ffmpeg -i audio.xxx -acodec flac audio.flac

but result is

FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
Mac OSX universal build for ffmpegX
  configuration:  --enable-memalign-hack --enable-mp3lame --enable-gpl --disable-vhook --disable-ffplay --disable-ffserver --enable-a52 --enable-xvid --enable-faac --enable-faad --enable-amr_nb --enable-amr_wb --enable-pthreads --enable-x264 
  libavutil version: 49.0.0
  libavcodec version: 51.9.0
  libavformat version: 50.4.0
  built on Apr 15 2006 04:58:19, gcc: 4.0.1 (Apple Computer, Inc. build 5250)
Input #0, wsaud, from 'audio.alac':
  Duration: 00:00:03.8, start: 0.000000, bitrate: 199 kb/s
  Stream #0.0: Audio: adpcm_ima_ws, 24931 Hz, stereo, 199 kb/s
Unable for find a suitable output format for 'audio.flac'

I also installed flac codec for mac, but nothing...

I tried also use convtoflac.sh (from http://legroom.net/software/convtoflac) but result is similar.

Any idea to convert in flac?

link|improve this question
Your version of ffmpeg has probably been built without FLAC support. Try ffmpeg -formats | grep flac and ffmpeg -codecs | grep flac to see. – grawity Sep 23 '11 at 10:29
Flac was present: D A flac! – elpsk Sep 23 '11 at 10:32
In both 'codecs' and 'formats'? Also, the D means "decoding". Without Encoding support you're not going to make it work. – grawity Sep 23 '11 at 10:34
ffmpeg -codecs | grep flac won't work! I don't find any codec options.... – elpsk Sep 23 '11 at 10:38
feedback

1 Answer

up vote 4 down vote accepted

Forget the FFmpeg version that's included within ffmpegX – it's really old. Obviously it wasn't compiled with FLAC support.

You could:

  • Install it from source. Here's also a newer guide. It's probably not that hard to do, but might not work as expected.
  • Install it using Homebrew, a package manager for OS X.

Because Homebrew takes care of all possible dependencies for you, installation should be easier. You need XCode installed in order to compile FFmpeg though. If you're on pre-Lion OS X, you should also have them on your installation disc, otherwise you need to register with Apple Connect and download Xcode 3.2.6 for Snow Leopard ("Download" menu, under "Developer Tools").

Then run this to install Homebrew.

/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"

Follow the steps outlined there. Then, install ffmpeg:

brew install ffmpeg

This takes a while because all the dependencies (like LAME, x264) will also be installed. When you're done, you should have a working up-to-date ffmpeg installation.

Then, just try it again:

Input #0, mp3, from 'input.mp3':
  Duration: 00:02:16.09, start: 0.000000, bitrate: 128 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
Output #0, flac, to 'test.flac':
  Metadata:
    encoder         : Lavf53.4.0
    Stream #0.0: Audio: flac, 44100 Hz, stereo, s16, 64 kb/s
link|improve this answer
XCode has been free on the App Store since 4.1, and doesn't require the free Apple Developer registration. – Lri Sep 23 '11 at 12:15
I reinstall theora and now it's ok, because link returns No such keg: /usr/local/Cellar/libtheora. Thanks a lot man! – elpsk Sep 23 '11 at 12:54
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.