[FFmpeg-user] vbr with libfdk_aac ?

sean darcy seandarcy2 at gmail.com
Fri Apr 19 17:13:45 CEST 2013


On 04/18/2013 10:45 PM, Timothy Gu wrote:
> On Thu, Apr 18, 2013 at 11:57 AM, sean darcy <seandarcy2 at gmail.com> wrote:
>> ffmpeg -i 17.wav -vn -c:a libfdk_aac -vbr 2 -afterburner 1 17.m4a
>> ffmpeg version N-52058-g423089e Copyright (c) 2000-2013 the FFmpeg
>> developers
>>    built on Apr 13 2013 19:19:37 with gcc 4.7.2 (GCC) 20120921 (Red Hat
>> 4.7.2-2)
>>    configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg
>> --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man
>> --arch=x86_64 --cpu=amdfam10 --optflags='-Ofast -march=native -mtune=native
>> -fopenmp -fomit-frame-pointer -pipe -fPIC' --enable-avresample
>> --enable-libopencore-amrnb --enable-libopencore-amrwb
>> --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd
>> --enable-frei0r --enable-libfdk-aac --enable-gnutls --enable-libass
>> --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack
>> --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal
>> --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse
>> --enable-librtmp --enable-libschroedinger --enable-libspeex
>> --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx
>> --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
>> --enable-postproc --enable-pthreads --disable-static --enable-shared
>> --enable-gpl --enable-nonfree --enable-zlib   libavutil      52. 26.100 /
>> 52. 26.100
>>    libavcodec     55.  2.100 / 55.  2.100
>>    libavformat    55.  2.100 / 55.  2.100
>>    libavdevice    55.  0.100 / 55.  0.100
>>    libavfilter     3. 53.101 /  3. 53.101
>>    libavresample   1.  1.  0 /  1.  1.  0
>>    libswscale      2.  2.100 /  2.  2.100
>>    libswresample   0. 17.102 / 0. 17.102
>>    libpostproc    52.  3.100 / 52.  3.100
>> [wav @ 0xe1ba00] max_analyze_duration 5000000 reached at 5015510
>> microseconds
>> Guessed Channel Layout for  Input Stream #0.0 : stereo
>> Input #0, wav, from '17.wav':
>>    Duration: 00:30:31.07, bitrate: 1411 kb/s
>>      Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo,
>> s16, 1411 kb/s
>> [libfdk_aac @ 0xe43280] Note, the VBR setting is unsupported and only works
>> with some parameter combinations
>
> Question for Sean:
>
> Is the output OK? If it is, then it shouldn't be a problem. (Also see
> question a) below)
>
> I also have a couple of questions for developers for the library.
> Please correct me (and please don't consider me rude) if I am wrong.
>
> a) According to the official libfdk-aac available in mstorsjo's repo,
> it does not say anything about VBR, or values between 1-5 for param
> AACENC_BITRATEMODE. But in line 185 of libavcodec/libfdk-aacenc.c,
> ffmpeg is setting it for VBR. In my opinion, not say it can do VBR
> stuff means it can't.
>
> b) Shouldn't -vbr be -q:a? And if it is for abbreviating "-flags
> +qscale -global_quality [1-5]", shouldn't it also map to other codecs
> requiring this option?
>
> Timothy G.
>

Well the output is ok, but I'm expecting a better result than 90kb/s for 
just speech.

Wasted some time checking out results of different vbr settings.

ffprobe for ffmpeg -i 17.wav -vn -c:a libfdk_aac -vbr 2  -afterburner 1 
17-ffmpeg.m4a

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '17-ffmpeg.m4a':
   Metadata:
     major_brand     : M4A
     minor_version   : 512
     compatible_brands: isomiso2
     encoder         : Lavf55.2.100
   Duration: 00:30:31.11, start: 0.046440, bitrate: 91 kb/s
     Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 
fltp, 90 kb/s

Same but -vbr 5

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '17-ffmpeg.m4a':
   Metadata:
     major_brand     : M4A
     minor_version   : 512
     compatible_brands: isomiso2
     encoder         : Lavf55.2.100
   Duration: 00:30:31.11, start: 0.046440, bitrate: 187 kb/s
     Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 
fltp, 185 kb/s

So the vbr spec is doing something. But is it just changing a CBR or is 
it actually allocating bits to different passages?

I also used fdkaac - a direct CLI for libfdk_aac.

ffrobe on fdkaac -p 2 -m 2 17.wav


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '17-fdkaac.m4a':
   Metadata:
     major_brand     : M4A
     minor_version   : 0
     compatible_brands: M4A mp42isom
     creation_time   : 2013-04-19 14:42:11
     encoder         : fdkaac 0.2.0, libfdk-aac 3.3.3, VBR mode 2
   Duration: 00:30:31.13, start: 0.000000, bitrate: 91 kb/s
     Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 
fltp, 90 kb/s

And VBR 5:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '17-fdkaac.m4a':
   Metadata:
     major_brand     : M4A
     minor_version   : 0
     compatible_brands: M4A mp42isom
     creation_time   : 2013-04-19 14:52:02
     encoder         : fdkaac 0.2.0, libfdk-aac 3.3.3, VBR mode 5
   Duration: 00:30:31.13, start: 0.000000, bitrate: 187 kb/s
     Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 
fltp, 185 kb/s

So ffmpeg is generating identical bit rates for vbr settings as fdkaac. 
But again, hard to know if this is just a CBR setting or really VBR.

sean








More information about the ffmpeg-user mailing list