24

I have the following setup for FFmpeg:

ffmpeg version N-54790-g1816f55-syslint Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 17 2013 21:34:32 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-3)
  configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 81.101 /  3. 81.101
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100

I am trying to use FFmpeg to convert my m4a or mp3 files to

AAC, Low Complexity Profile (LC)

I am really struggling to find a command line that works for me. Is it even possible with my FFmpeg setup?

Thanks

Arete
  • 1,321
  • 7
  • 28
  • 50
user1503606
  • 485
  • 2
  • 6
  • 10
  • possible duplicate of [ffmpeg: 1 image + 1 audio file = 1 video](http://stackoverflow.com/questions/5887311/ffmpeg-1-image-1-audio-file-1-video) – user1503606 Dec 06 '13 at 16:05

2 Answers2

26

AAC-LC is the default for all of the AAC encoders supported by ffmpeg.

Example:

ffmpeg -i input.m4a -codec:a aac output.aac

See FFmpeg Wiki: AAC Encoding Guide for more details and examples.

Mateusz Piotrowski
  • 4,016
  • 4
  • 28
  • 53
llogan
  • 57,139
  • 15
  • 118
  • 145
  • Cool, I didn't know about the Fraunhofer encoder. I'm guessing the test were done at super-low bitrates that I'll never use, but good info! – Louis Waweru Mar 13 '15 at 06:01
8

To re-encode any format to AAC-LC in an ADTS container (.aac file) using FFmpegs's native AAC encoder (second best after non-free Fraunhofer's libfdk_aac according to https://trac.ffmpeg.org/wiki/Encode/AAC -- doesn't support any HE-AAC though), you also need to specify -strict experimental (or -strict -2):

ffmpeg -i input.mp3 -strict experimental -c:a aac -b:a 128k output.aac

When converting to .aac from a source in m4a/mp4, you don't even need to re-encode:

ffmpeg -i input.m4a -c:a copy output.aac

Note: FFmpeg tries to guess the output format from the output file name. If you need to force the format for ADTS (.aac file), use -f adts (e.g. when working with piped streams instead of files):

cat input.wav | ffmpeg -i pipe:0 -c:a aac -c:b 128k -f adts pipe:1 ­> output.aac
Bigue Nique
  • 201
  • 2
  • 6
  • 2
    You don't need `-strict experimental` unless you're using an old `ffmpeg`. – llogan Mar 22 '16 at 04:28
  • @LordNeckbeard Thanks for the update! That would mean the native encoder has reached a satisfying level of maturity... – Bigue Nique Mar 23 '16 at 23:29
  • 2
    Yes, but there is more work planned for it. Also see [The native FFmpeg AAC encoder is now stable!](http://ffmpeg.org/index.html#aac_encoder_stable) – llogan Mar 23 '16 at 23:33