Opened 12 years ago

Closed 11 years ago

#1346 closed defect (fixed)

-aq makes only a minimal output file size difference for aac

Reported by: Carl Eugen Hoyos Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: aac
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

The native aac encoder source code contains hints that global_quality is respected, but setting -aq makes only a minimal output file size difference.
This used to work before release 0.6.

$ ffmpeg -i fate-suite/lossless-audio/luckynight-partial.tta -strict experimental -q:a 0.001 -t 8 out.aac
ffmpeg version N-40960-ge15f128 Copyright (c) 2000-2012 the FFmpeg developers
  built on May 23 2012 13:44:40 with gcc 4.3.2
  configuration: --cc=/usr/local/gcc-4.3.2/bin/gcc --enable-gpl --enable-libopenjpeg --enable-libvorbis --enable-libspeex --enable-libmp3lame --enable-libtheora --extra-ldflags=-lm
  libavutil      51. 53.100 / 51. 53.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 76.100 /  2. 76.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, tta, from 'fate-suite/lossless-audio/luckynight-partial.tta':
  Duration: 00:01:00.48, start: 0.000000, bitrate: 138 kb/s
    Stream #0:0: Audio: tta, 44100 Hz, stereo, s16
[aformat @ 0x8f14200] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
[aresample @ 0x8f0b920] r:44100Hz -> r:44100Hz
Output #0, adts, to 'out.aac':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Audio: aac, 44100 Hz, stereo, flt, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (tta -> aac)
Press [q] to stop, [?] for help
size=     137kB time=00:00:08.35 bitrate= 134.6kbits/s
video:0kB audio:135kB global headers:0kB muxing overhead 1.826173%
$ ffmpeg -i fate-suite/lossless-audio/luckynight-partial.tta -strict experimental -q:a 100000 -t 8 out.aac
ffmpeg version N-40960-ge15f128 Copyright (c) 2000-2012 the FFmpeg developers
  built on May 23 2012 13:44:40 with gcc 4.3.2
  configuration: --cc=/usr/local/gcc-4.3.2/bin/gcc --enable-gpl --enable-libopenjpeg --enable-libvorbis --enable-libspeex --enable-libmp3lame --enable-libtheora --extra-ldflags=-lm
  libavutil      51. 53.100 / 51. 53.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 76.100 /  2. 76.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, tta, from 'fate-suite/lossless-audio/luckynight-partial.tta':
  Duration: 00:01:00.48, start: 0.000000, bitrate: 138 kb/s
    Stream #0:0: Audio: tta, 44100 Hz, stereo, s16
[aformat @ 0x8f14200] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
[aresample @ 0x8f0b920] r:44100Hz -> r:44100Hz
Output #0, adts, to 'out.aac':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Audio: aac, 44100 Hz, stereo, flt, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (tta -> aac)
Press [q] to stop, [?] for help
size=     144kB time=00:00:08.35 bitrate= 140.9kbits/s
video:0kB audio:141kB global headers:0kB muxing overhead 1.742700%

Change History (3)

comment:1 by Michael Niedermayer, 11 years ago

Summary: q:a for -acodec aac-aq makes only a minimal output file size difference for aac

comment:2 by llogan, 11 years ago

The behavior has changed, but I am unsure of which commits are responsible:

$ ffmpeg -y -i fate-suite/lossless-audio/luckynight-partial.tta -c:a aac -strict experimental -q:a 0.1 -t 8 ../0.1.aac
ffmpeg version N-54901-g55db06a Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 23 2013 13:37:06 with gcc 4.8.1 (GCC)
  configuration: --prefix=/usr --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-nonfree --enable-x11grab
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 81.102 /  3. 81.102
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, tta, from 'fate-suite/lossless-audio/luckynight-partial.tta':
  Duration: 00:01:00.48, start: 0.000000, bitrate: 138 kb/s
    Stream #0:0: Audio: tta, 44100 Hz, stereo, s16
Output #0, adts, to '../0.1.aac':
  Metadata:
    encoder         : Lavf55.12.102
    Stream #0:0: Audio: aac, 44100 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (tta -> aac)
Press [q] to stop, [?] for help
[tta @ 0x250a9c0] CRC error
[output stream 0:0 @ 0x250a680] 100 buffers queued in output stream 0:0, something may be wrong.
size=      14kB time=00:00:08.01 bitrate=  14.5kbits/s    
video:0kB audio:12kB subtitle:0 global headers:0kB muxing overhead 20.019879%
$ ffmpeg -y -i fate-suite/lossless-audio/luckynight-partial.tta -c:a aac -strict experimental -q:a 10 -t 8 ../10.aac
ffmpeg version N-54901-g55db06a Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 23 2013 13:37:06 with gcc 4.8.1 (GCC)
  configuration: --prefix=/usr --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-nonfree --enable-x11grab
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 81.102 /  3. 81.102
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, tta, from 'fate-suite/lossless-audio/luckynight-partial.tta':
  Duration: 00:01:00.48, start: 0.000000, bitrate: 138 kb/s
    Stream #0:0: Audio: tta, 44100 Hz, stereo, s16
Output #0, adts, to '../10.aac':
  Metadata:
    encoder         : Lavf55.12.102
    Stream #0:0: Audio: aac, 44100 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (tta -> aac)
Press [q] to stop, [?] for help
[tta @ 0x2c899c0] CRC error
[output stream 0:0 @ 0x2c89680] 100 buffers queued in output stream 0:0, something may be wrong.
size=     464kB time=00:00:08.01 bitrate= 474.7kbits/s    
video:0kB audio:462kB subtitle:0 global headers:0kB muxing overhead 0.511038%

Ticket #2686 may introduce more changes.

comment:3 by llogan, 11 years ago

Resolution: fixed
Status: newclosed

Considering this fixed as varying -aq values now make significant differences in output file size and quality, but I did not attempt to find responsible commits.

Note: See TracTickets for help on using tickets.