AAC Audio Not Encoded at Proper Bitrate?

HandBrake for Mac support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Allistah
Posts: 7
Joined: Wed May 01, 2019 8:48 pm

AAC Audio Not Encoded at Proper Bitrate?

Post by Allistah »

Description of problem or question:
When I encode a video and set the audio to AAC and a bitrate of 128, the resulting audio track in the output file is shown to have a bitrate of 105k. It seems like it is always off. AC3 tracks seem to be spot on. Any idea what I'm doing wrong? I'm using the program called "MediaInfo" to look at the output file tracks. I'm encoding from a MKV file - not sure if that matters.

Shouldn't I see a 128 number there in the output file?


Steps to reproduce the problem (If Applicable):
Take a look at the activity file below for settings details and version info.



HandBrake version (e.g., 1.0.0):
[08:10:42] macgui: Handbrake Version: 1.3.1 (2020010400)



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Catalina 10.15.2.



HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

[08:10:42] macgui: Handbrake Version: 1.3.1 (2020010400)
[08:10:49] macgui: QueueCore scanning specifically for title: 1
[08:10:49] CPU: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
[08:10:49]  - Intel microarchitecture Haswell
[08:10:49]  - logical processor count: 8
[08:10:49] hb_scan: path=/Volumes/Storage/testInputFile.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image /Volumes/Storage/testInputFile.mkv
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
bluray.c:2585: nav_get_title_list(/Volumes/Storage/testInputFile.mkv/) failed
[08:10:49] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[08:10:49] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from '/Volumes/Storage/testInputFile.mkv':
  Metadata:
    encoder         : libebml v1.3.6 + libmatroska v1.4.9
    creation_time   : 2018-08-22T05:08:32.000000Z
  Duration: 01:27:14.82, start: 0.000000, bitrate: 7639 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1278x720, SAR 1:1 DAR 71:40, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS-eng         : 7253135
      DURATION-eng    : 01:27:14.813000000
      NUMBER_OF_FRAMES-eng: 125510
      NUMBER_OF_BYTES-eng: 4746100894
      _STATISTICS_WRITING_APP-eng: mkvmerge v25.0.0 ('Prog Noir') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-08-22 05:08:32
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
    Metadata:
      BPS-eng         : 384000
      DURATION-eng    : 01:27:14.816000000
      NUMBER_OF_FRAMES-eng: 163588
      NUMBER_OF_BYTES-eng: 251271168
      _STATISTICS_WRITING_APP-eng: mkvmerge v25.0.0 ('Prog Noir') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-08-22 05:08:32
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Subtitle: subrip
    Metadata:
      BPS-eng         : 81
      DURATION-eng    : 01:22:36.883000000
      NUMBER_OF_FRAMES-eng: 1332
      NUMBER_OF_BYTES-eng: 50418
      _STATISTICS_WRITING_APP-eng: mkvmerge v25.0.0 ('Prog Noir') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-08-22 05:08:32
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:3(eng): Subtitle: subrip
    Metadata:
      title           : SDH
      BPS-eng         : 119
      DURATION-eng    : 01:26:43.229000000
      NUMBER_OF_FRAMES-eng: 1592
      NUMBER_OF_BYTES-eng: 77614
      _STATISTICS_WRITING_APP-eng: mkvmerge v25.0.0 ('Prog Noir') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2018-08-22 05:08:32
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[08:10:49] scan: decoding previews for title 1
[08:10:49] scan: audio 0x1: ac3, rate=48000Hz, bitrate=384000 English (AC3) (5.1 ch) (384 kbps)
[08:10:49] scan: 10 previews, 1278x720, 23.976 fps, autocrop = 0/0/0/0, aspect 1.77:1, PAR 1:1
[08:10:49] libhb: scan thread found 1 valid title(s)
[08:10:49] macgui: QueueCore scan done
[08:10:49] macgui: QueueCore started encoding testOutputFile.m4v
[08:10:49] macgui: QueueCore with preset 480p, 2 Ch 160k, 5.1 Ch 448k AC3, Eng Subs
[08:10:49] Starting work at: Fri Feb 14 08:10:49 2020

[08:10:49] 1 job(s) to process
[08:10:49] Starting Task: Encoding Pass
[08:10:49] work: only 1 chapter, disabling chapter markers
[08:10:49] job configuration:
[08:10:49]  * source
[08:10:49]    + /Volumes/Storage/testInputFile.mkv
[08:10:49]    + title 1, start 00:00:0.00 stop 00:05:14.00
[08:10:49]    + container: matroska,webm
[08:10:49]    + data rate: 7639 kbps
[08:10:49]  * destination
[08:10:49]    + /Volumes/Storage/testOutputFile.m4v
[08:10:49]    + container: MPEG-4 (libavformat)
[08:10:49]      + optimized for HTTP streaming (fast start)
[08:10:49]      + align initial A/V stream timestamps
[08:10:49]  * video track
[08:10:49]    + decoder: h264
[08:10:49]    + filters
[08:10:49]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[08:10:49]      + Decomb (mode=39)
[08:10:49]      + Framerate Shaper (mode=1:rate=27000000/1126125)
[08:10:49]        + frame rate: 23.976 fps -> constant 23.976 fps
[08:10:49]      + Crop and Scale (width=852:height=480:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[08:10:49]        + source: 1278 * 720, crop (0/0/0/0): 1278 * 720, scale: 852 * 480
[08:10:49]    + Output geometry
[08:10:49]      + storage dimensions: 852 x 480
[08:10:49]      + pixel aspect ratio: 1 : 1
[08:10:49]      + display dimensions: 852 x 480
[08:10:49]    + encoder: H.264 (libx264)
[08:10:49]      + preset:  veryfast
[08:10:49]      + tune:    film,fastdecode
[08:10:49]      + profile: high
[08:10:49]      + level:   3.1
[08:10:49]      + quality: 21.00 (RF)
[08:10:49]      + color profile: 1-1-1
[08:10:49]  * subtitle track 1, English [UTF-8] (track 0, id 0x2, Text) -> Passthrough
[08:10:49]  * audio track 1
[08:10:49]    + decoder: English (AC3) (5.1 ch) (384 kbps) (track 1, id 0x1)
[08:10:49]      + bitrate: 384 kbps, samplerate: 48000 Hz
[08:10:49]    + mixdown: Dolby Surround
[08:10:49]    + dither: triangular
[08:10:49]    + encoder: AAC (Apple AudioToolbox)
[08:10:49]      + bitrate: 128 kbps, samplerate: 48000 Hz
[08:10:49]  * audio track 2
[08:10:49]    + decoder: English (AC3) (5.1 ch) (384 kbps) (track 1, id 0x1)
[08:10:49]      + bitrate: 384 kbps, samplerate: 48000 Hz
[08:10:49]    + mixdown: 5.1 Channels
[08:10:49]    + dither: triangular
[08:10:49]    + encoder: AC3 (libavcodec)
[08:10:49]      + bitrate: 448 kbps, samplerate: 48000 Hz
[08:10:49] sync: expecting 7552 video frames
[08:10:49] encx264: min-keyint: 24, keyint: 240
[08:10:49] encx264: encoding at constant RF 21.000000
[08:10:49] encx264: unparsed options: level=3.1:ref=1:weightb=0:no-deblock=1:cabac=0:weightp=0:subme=2:mixed-refs=0:trellis=0:psy-rd=1,0.15:vbv-bufsize=17500:vbv-maxrate=17500:rc-lookahead=10
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile High, level 3.1, 4:2:0, 8-bit
[08:10:49] sync: first pts video is 0
[08:10:49] sync: "Chapter 1" (1) at frame 1 time 0
[08:10:49] sync: first pts audio 0x1 is 0
[08:10:49] sync: first pts audio 0x1 is 0
[08:11:15] sync: first pts subtitle 0x2 is 11876940
[08:11:57] sync: reached audio 0x1 pts 28261440, exiting early
[08:11:57] sync: reached audio 0x1 pts 28261440, exiting early
[08:11:57] sync: reached video pts 28261983, exiting early
[08:11:57] work: average encoding speed for job is 111.762848 fps
[08:11:57] comb detect: heavy 0 | light 112 | uncombed 7417 | total 7529
[08:11:57] decomb: deinterlaced 0 | blended 112 | unfiltered 7417 | total 7529
[08:11:57] vfr: 7529 frames output, 0 dropped and 0 duped for CFR/PFR
[08:11:57] vfr: lost time: 0 (0 frames)
[08:11:57] vfr: gained time: 0 (0 frames) (0 not accounted for)
[08:11:57] ac3-decoder done: 10025 frames, 0 decoder errors
[08:11:57] ac3-decoder done: 10025 frames, 0 decoder errors
[08:11:57] h264-decoder done: 7675 frames, 0 decoder errors
[08:11:57] sync: got 7529 frames, 7552 expected
[08:11:57] sync: framerate min 23.976 fps, max 23.976 fps, avg 23.976 fps
x264 [info]: frame I:52    Avg QP:19.72  size: 56879
x264 [info]: frame P:2044  Avg QP:21.90  size: 19944
x264 [info]: frame B:5433  Avg QP:24.64  size:  6036
x264 [info]: consecutive B-frames:  2.3%  3.4%  2.8% 91.4%
x264 [info]: mb I  I16..4: 16.4% 35.8% 47.9%
x264 [info]: mb P  I16..4:  7.6% 21.1%  5.8%  P16..4: 31.2% 14.5%  6.8%  0.0%  0.0%    skip:12.9%
x264 [info]: mb B  I16..4:  1.5%  2.9%  0.4%  B16..8: 20.5%  9.7%  1.5%  direct:15.6%  skip:47.9%  L0:30.7% L1:38.2% BI:31.1%
x264 [info]: 8x8 transform intra:59.6% inter:30.2%
x264 [info]: coded y,uvDC,uvAC intra: 80.4% 65.9% 25.2% inter: 21.7% 14.0% 0.6%
x264 [info]: i16 v,h,dc,p: 19% 22% 38% 21%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 26% 23%  5%  6%  6%  7%  5%  8%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 28% 14%  6%  7%  7%  8%  6%  8%
x264 [info]: i8c dc,h,v,p: 48% 27% 18%  6%
x264 [info]: kb/s:1949.34
[08:11:57] mux: track 0, 7529 frames, 76515021 bytes, 1949.03 kbps, fifo 2048
[08:11:57] mux: track 1, 14722 frames, 4112797 bytes, 104.76 kbps, fifo 4096
[08:11:57] mux: track 2, 9813 frames, 17584896 bytes, 447.93 kbps, fifo 2048
[08:11:57] mux: track 3, 36 frames, 2355 bytes, 0.06 kbps, fifo 16
[08:11:57] Finished work at: Fri Feb 14 08:11:57 2020

[08:11:57] libhb: work result = 0
[08:11:58] macgui: Queue Done, there are no more pending encodes
[08:11:58] macgui: QueueCore work done
Deleted User 11865

Re: AAC Audio Not Encoded at Proper Bitrate?

Post by Deleted User 11865 »

The AudioToolbox AAC encoder is set to use Constrained VBR encoding, so such bitrate deviations are normal and expected. If we configured the encoder for CBR, bitrate would be spot on but the audio quality wouldn't be any better (and in some cases, worse).
Allistah
Posts: 7
Joined: Wed May 01, 2019 8:48 pm

Re: AAC Audio Not Encoded at Proper Bitrate?

Post by Allistah »

Ah! Ok, thanks for the info - really appreciate the explanation!
Post Reply