View Full Version : Audio codec and PCM
David1105
8th June 2007, 01:42
When using the following command:
ffmpeg -i input.mov -y -f avi -s 320x180 output.avi
What audio codec is used by default? How to alter the line to make sure audio is output as PCM data stream?
Thanks!
foxyshadis
8th June 2007, 04:05
Just start the encode and it'll tell you:
C:\Program Files\music-video\encoding>ffmpeg -i D:\video\NadaSurfAlwaysLove.avi -y -f avi -s 320x180 output.avi
FFmpeg version SVN-r8797, Copyright (c) 2000-2007 Fabrice Bellard, et al.
....
Input #0, avi, from 'D:\video\NadaSurfAlwaysLove.avi':
Duration: 00:03:26.1, start: 0.000000, bitrate: 1038 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 700x376, 29.97 fps(r)
Stream #0.1: Audio: mp3, 44100 Hz, stereo, 128 kb/s
Output #0, avi, to 'output.avi':
Stream #0.0: Video: mpeg4, yuv420p, 320x180, q=2-31, 200 kb/s, 29.97 fps(c)
Stream #0.1: Audio: mp2, 44100 Hz, stereo, 64 kb/s
........
You can type ffmpeg and ffmpeg -formats to get a full list of options (infinitely more useful than mencoder's help); what you probably want is -acodec pcm_s16le, but there are a ton of pcm formats, so you might have to test a few different ones.
David1105
8th June 2007, 20:33
There's so many options related to PCM and I don't know which one to use...
Why did you recommended "pcm_s16le" for uncompressed PCM audio data?
Is there a document on explaining this?
***********************************
DEA pcm_alaw
DEA pcm_mulaw
DEA pcm_s16be
DEA pcm_s16le
DEA pcm_s24be
DEA pcm_s24daud
DEA pcm_s24le
DEA pcm_s32be
DEA pcm_s32le
DEA pcm_s8
DEA pcm_u16be
DEA pcm_u16le
DEA pcm_u24be
DEA pcm_u24le
DEA pcm_u32be
DEA pcm_u32le
DEA pcm_u8
foxyshadis
9th June 2007, 19:10
Well, the wav standard is little endian, 8-bit unsigned and 16+-bit signed. (AIFF is big endian and always signed, or pcm_s16be and so on.) It's possible to define a custom format tag to use any of the other formats, but most software probably won't recognize it. The multitude of formats are basically just to be complete, in case any software/format out there might need unsigned higher-bit formats.
pcm_s24daud is lpcm. I have no idea what's different about it.
A-law and μ-law are predictive ADPCM telephone codecs that can't really be called PCM at all. (But since they shipped with windows, I guess an exception is made.)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.