[FFmpeg-user] Problems with Audio Codec: almost solved it

Tom Evans tevans.uk at googlemail.com
Tue Aug 13 15:47:41 CEST 2013


On Fri, Aug 9, 2013 at 5:48 PM, James Board <jpboard2 at yahoo.com> wrote:
>>What exactly does ffmpeg output when you do ffmpeg -i <your-input-file>?
>
>
> For the audio code, it displays: audio pcm_s16le 48000 Hz s1g, 1536 kb/s.
>
> I guess that means I should use '-c:a pcm_s16le'.
>
> Is there an ffmpeg option that tells it to use whatever audio codec
> that the input file used?

Yes, you can do this by saying to copy the audio with "-c:a copy".
Bear in mind that not every format can contain every codec, and so you
cannot for instance put pcm_s16 into an mp4 container, mp4 (according
to wikipedia) can only take MPEG4 Part 3 codecs, limiting you to
things like AAC, MP1, MP2, MP3 and some less well known codecs, and
not ac3 nor pcm.

Other containers are more permissive, eg the nut container will take
almost anything that ffmpeg can produce, but probably won't be played
back by anything other than ffplay and possibly mplayer. mkv is a good
choice.

>
> Alternatively, if I want to compress the audio, what is a good suggestion
> for an audio codec that is most widely supported?  I want to ensure it
> works with mencoder, mplayer, and whatever tool I might use in the
> future.  What's the best bet?  '-c:a mp2'?  I use Linux machines almost
> exclusively.

mp2 is fine, if a little long in the tooth. I would use ac3 if you
want high quality, or aac if you want a small file size.

Cheers

Tom


More information about the ffmpeg-user mailing list