5

I'm developing Android application, and im using ffmpeg for conversion of files.
I want my binary file to be as slim as possible since i don't have many input formats and output formats, and my operation is quite basic.And of course not to bloat the APK.

In my program ffmpeg receives a file, and copys the audio stream (-acodec copy), the audio stream will always be aac (mp4a). What i need is to save the stream to file.
My command looks like this : ffmpeg -i {Input} -vn -acodec copy output.aac.

What muxer do i need to for muxing aac to file? I have tried flv,mp3,mov but i always get
Unable to find a suitable output format for 'output.aac', so these options are wrong.
I don't need an encoder for stream copy btw.

Side note: this command work flawlessly on full installation of ffmpeg , but I don't know which muxer it uses. If there is a way to output the muxer it uses from regular ffmpeg run, it would work too.

David Barishev
  • 534
  • 7
  • 30

3 Answers3

5

A common file format for AAC is BMFF/MOV/MP4/M4A. If you specify the m4a file extension, FFmpeg will take care of it for you.

ffmpeg -i {input} -vn -acodec copy output.m4a

If you just want raw AAC, you can use ADTS as a lightweight container of sorts, as Mulvya suggested.

ffmpeg -i {input} -vn -acodec copy -f adts output.aac
Brad
  • 159,648
  • 54
  • 349
  • 530
0

I had to add the -f for me to work (on FFmpeg 3.22): ffmpeg -i {input} -vn -acodec copy -f adts output.m4a

Eli
  • 707
  • 8
  • 16
0

You have to add adts to --enable-muxer when configuring ffmpeg, eg. ./configure --disable-everything (...) --enable-muxer=adts. Then you will be able to save to .aac file

Filip Kwiatkowski
  • 615
  • 2
  • 9
  • 20