[FFmpeg-user] Problem with libfdk-aac and VBR quality option "quality out of range"

wtfux wtfux.dev at googlemail.com
Sun Sep 9 23:19:10 CEST 2012


Hi guys,
first off, there are so many aac encoders (faac, visual on, fdk-aac,
builtin aac, ...). Does someone know where I can read more about the
features so I can choose which is the best for me?

I used to use libfaac but I read that the implementation is considered 'bad
quality' and that fdk-aac is considered 'good quality'. So I built ffmpeg
with libfdk-aac support but there is a problem with using -q:a option to
set VBR quality. -b:a works fine but will produce a quite static bitrate, I
want to use a variable bitrate.

libfdk-aac supports a quality range of 1-5:

VBR quality X out of range, should be 1-5


However setting -q:a to 1 to 5 will produce an error:  [libfdk_aac @
0000000003da2b60] VBR quality 118 out of range, should be 1-5

------ LOG

ffmpeg started on 2012-09-09 at 23:09:44
Report written to "ffmpeg-20120909-230944.log"
Command line:
"Z:\\ffmpeg10bit\\ffmpeg.exe" -report -i "E:\\00003.m2ts" -vn -c:a
libfdk_aac -q:a 1 -t 00:01:00 -y "Z:\\test.aac"
ffmpeg version git-2012-09-04-3b6e9cd Copyright (c) 2000-2012 the FFmpeg
developers
  built on Sep  5 2012 14:44:42 with gcc 4.7.1 (GCC)
  configuration: --pkg-config=pkg-config --prefix=/root/win32
--enable-memalign-hack --arch=x86_64 --target-os=mingw32
--cross-prefix=x86_64-w64-mingw32- --enable-libfaac --enable-libfdk-aac
--enable-libx264 --enable-gpl --enable-nonfree --enable-version3
--enable-avfilter --enable-avisynth
  libavutil      51. 70.100 / 51. 70.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 15.103 /  3. 15.103
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 00000000002cf3e0] Format mpegts probed with size=2048 and
score=100
[mpegts @ 00000000002cf3e0] stream=0 stream_type=1b pid=1011
prog_reg_desc=HDMV
[mpegts @ 00000000002cf3e0] stream=1 stream_type=80 pid=1100
prog_reg_desc=HDMV
[mpegts @ 00000000002cf3e0] File position before
avformat_find_stream_info() is 0
[mpegts @ 00000000002cf3e0] parser not found for codec pcm_bluray, packets
or times may be invalid.
[h264 @ 00000000015cf9c0] no picture
[mpegts @ 00000000002cf3e0] parser not found for codec pcm_bluray, packets
or times may be invalid.
[mpegts @ 00000000002cf3e0] Probe buffer size limit 5000000 reached
rfps: 23.750000 0.014331
rfps: 23.833333 0.005712
rfps: 23.916667 0.000988
rfps: 24.000000 0.000161
rfps: 24.083333 0.003230
rfps: 24.166667 0.010195
rfps: 47.750000 0.011452
rfps: 47.833333 0.003954
rfps: 47.916667 0.000351
rfps: 47.916667 0.000351
rfps: 48.000000 0.000645
rfps: 48.083333 0.004834
rfps: 48.166667 0.012920
rfps: 23.976024 0.000000
rfps: 23.976024 0.000000
rfps: 47.952048 0.000000
rfps: 47.952048 0.000000
[mpegts @ 00000000002cf3e0] File position after avformat_find_stream_info()
is 0
Input #0, mpegts, from 'E:\00003.m2ts':
  Duration: 00:47:23.17, start: 4198.958300, bitrate: 36670 kb/s
  Program 1
    Stream #0:0[0x1011], 45, 1/90000: Video: h264 (High) (HDMV /
0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr,
90k tbn, 47.95 tbc
    Stream #0:1[0x1100], 477, 1/90000: Audio: pcm_bluray (HDMV /
0x564D4448), 48000 Hz, stereo, s16, 1536 kb/s
[abuffer @ 0000000003da0780] Setting entry with key 'time_base' to value
'1/48000'
[abuffer @ 0000000003da0780] Setting entry with key 'sample_rate' to value
'48000'
[abuffer @ 0000000003da0780] Setting entry with key 'sample_fmt' to value
's16'
[abuffer @ 0000000003da0780] Setting entry with key 'channel_layout' to
value '0x3'
[graph 0 input from stream 0:1 @ 0000000003da0660] tb:1/48000 samplefmt:s16
samplerate:48000 chlayout:0x3
[aformat @ 0000000003450ba0] Setting entry with key 'sample_fmts' to value
's16'
[aformat @ 0000000003450ba0] Setting entry with key 'channel_layouts' to
value '0x4,0x3,0x7,0x107,0x37,0x3f'
[libfdk_aac @ 0000000003da2b60] VBR quality 118 out of range, should be 1-5
Output #0, adts, to 'Z:\test.aac':
  Metadata:
    encoder         : Lavf54.25.104
    Stream #0:0, 0, 1/90000: Audio: aac, 48000 Hz, stereo, s16
Stream mapping:
  Stream #0:1 -> #0:0 (pcm_bluray -> libfdk_aac)
Press [q] to stop, [?] for help
size=     287kB time=00:00:09.55 bitrate= 246.2kbits/s
size=     594kB time=00:00:18.21 bitrate= 267.3kbits/s
size=     887kB time=00:00:26.98 bitrate= 269.2kbits/s
size=    1185kB time=00:00:35.60 bitrate= 272.7kbits/s
size=    1457kB time=00:00:44.94 bitrate= 265.5kbits/s
size=    1722kB time=00:00:54.24 bitrate= 260.0kbits/s
No more output streams to write to, finishing.
size=    1920kB time=00:01:00.00 bitrate= 262.1kbits/s

video:0kB audio:1920kB subtitle:0 global headers:0kB muxing overhead
0.000000%
[AVIOContext @ 00000000002cf9c0] Statistics: 291524752 bytes read, 2 seeks

------ LOG END




-q:a 2 will output: [libfdk_aac @ 0000000003f62b60] VBR quality 236 out of
range, should be 1-5
-q:a 3: [libfdk_aac @ 0000000003fb2b60] VBR quality 354 out of range,
should be 1-5
-q:a 4: [libfdk_aac @ 0000000004002b60] VBR quality 472 out of range,
should be 1-5
-q:a 5: [libfdk_aac @ 0000000004082b60] VBR quality 590 out of range,
should be 1-5

Only the range of -q:a 0.02 to 0.05 works: (0.06 shows: VBR quality 7 out
of range, should be 1-5)





------ LOG

ffmpeg started on 2012-09-09 at 23:12:30
Report written to "ffmpeg-20120909-231230.log"
Command line:
"Z:\\ffmpeg10bit\\ffmpeg.exe" -report -i "E:\\00003.m2ts" -vn -c:a
libfdk_aac -q:a 0.02 -t 00:01:00 -y "Z:\\test.aac"
ffmpeg version git-2012-09-04-3b6e9cd Copyright (c) 2000-2012 the FFmpeg
developers
  built on Sep  5 2012 14:44:42 with gcc 4.7.1 (GCC)
  configuration: --pkg-config=pkg-config --prefix=/root/win32
--enable-memalign-hack --arch=x86_64 --target-os=mingw32
--cross-prefix=x86_64-w64-mingw32- --enable-libfaac --enable-libfdk-aac
--enable-libx264 --enable-gpl --enable-nonfree --enable-version3
--enable-avfilter --enable-avisynth
  libavutil      51. 70.100 / 51. 70.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 15.103 /  3. 15.103
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 000000000193f400] Format mpegts probed with size=2048 and
score=100
[mpegts @ 000000000193f400] stream=0 stream_type=1b pid=1011
prog_reg_desc=HDMV
[mpegts @ 000000000193f400] stream=1 stream_type=80 pid=1100
prog_reg_desc=HDMV
[mpegts @ 000000000193f400] File position before
avformat_find_stream_info() is 0
[mpegts @ 000000000193f400] parser not found for codec pcm_bluray, packets
or times may be invalid.
[h264 @ 000000000031fa00] no picture
[mpegts @ 000000000193f400] parser not found for codec pcm_bluray, packets
or times may be invalid.
[mpegts @ 000000000193f400] Probe buffer size limit 5000000 reached
rfps: 23.750000 0.014331
rfps: 23.833333 0.005712
rfps: 23.916667 0.000988
rfps: 24.000000 0.000161
rfps: 24.083333 0.003230
rfps: 24.166667 0.010195
rfps: 47.750000 0.011452
rfps: 47.833333 0.003954
rfps: 47.916667 0.000351
rfps: 47.916667 0.000351
rfps: 48.000000 0.000645
rfps: 48.083333 0.004834
rfps: 48.166667 0.012920
rfps: 23.976024 0.000000
rfps: 23.976024 0.000000
rfps: 47.952048 0.000000
rfps: 47.952048 0.000000
[mpegts @ 000000000193f400] File position after avformat_find_stream_info()
is 0
Input #0, mpegts, from 'E:\00003.m2ts':
  Duration: 00:47:23.17, start: 4198.958300, bitrate: 36670 kb/s
  Program 1
    Stream #0:0[0x1011], 45, 1/90000: Video: h264 (High) (HDMV /
0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr,
90k tbn, 47.95 tbc
    Stream #0:1[0x1100], 477, 1/90000: Audio: pcm_bluray (HDMV /
0x564D4448), 48000 Hz, stereo, s16, 1536 kb/s
[abuffer @ 0000000003f00740] Setting entry with key 'time_base' to value
'1/48000'
[abuffer @ 0000000003f00740] Setting entry with key 'sample_rate' to value
'48000'
[abuffer @ 0000000003f00740] Setting entry with key 'sample_fmt' to value
's16'
[abuffer @ 0000000003f00740] Setting entry with key 'channel_layout' to
value '0x3'
[graph 0 input from stream 0:1 @ 0000000003f00620] tb:1/48000 samplefmt:s16
samplerate:48000 chlayout:0x3
[aformat @ 00000000035afac0] Setting entry with key 'sample_fmts' to value
's16'
[aformat @ 00000000035afac0] Setting entry with key 'channel_layouts' to
value '0x4,0x3,0x7,0x107,0x37,0x3f'
Output #0, adts, to 'Z:\test.aac':
  Metadata:
    encoder         : Lavf54.25.104
    Stream #0:0, 0, 1/90000: Audio: aac, 48000 Hz, stereo, s16
Stream mapping:
  Stream #0:1 -> #0:0 (pcm_bluray -> libfdk_aac)
Press [q] to stop, [?] for help
size=     159kB time=00:00:13.28 bitrate=  98.2kbits/s
size=     316kB time=00:00:26.13 bitrate=  99.0kbits/s
size=     471kB time=00:00:39.06 bitrate=  98.8kbits/s
size=     610kB time=00:00:52.11 bitrate=  95.9kbits/s
No more output streams to write to, finishing.
size=     699kB time=00:01:00.00 bitrate=  95.4kbits/s

video:0kB audio:699kB subtitle:0 global headers:0kB muxing overhead
0.000000%
[AVIOContext @ 000000000193f9e0] Statistics: 291524752 bytes read, 2 seeks

------ LOG END



I don't know if this is on purpose or if it's a bug.


More information about the ffmpeg-user mailing list