AAC (avodec) low bitrate bad timbre

HandBrake for Windows 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
andrewk89
Novice
Posts: 65
Joined: Thu Jun 13, 2013 4:29 pm

AAC (avodec) low bitrate bad timbre

Post by andrewk89 »

Please detail your question or problem in as much detail as possible:
Transcoding a bunch of files with the intent to reduce disk space usage. Target container is MP4 or MKV. I'm happy with my video settings. For audio, using AAC (avcodec). I noticed that 96 kbps Stereo is about as low a bitrate without severe degradation. I tried some videos at 80 kbps Stereo and noticed that playback with VLC sounded like the speakers were in a bucket or under water - odd timbre change vs. the source file. This occurs even when the source file has lower bitrate but a different codec. So something that has 40 bit WMA Stereo, or something like that, I'm forced to re-encode at at least 96 kbps to make it sound like the original.

Googled
avcodec bitrate samplerate
and nothing obvious came up regarding codec quality.

Is there a known issue with AAC (avcodec) at low(er) bitrates? For lower bitrates, would I be better off with MP3 or AC3?

Tell us about your environment. What version of HandBrake? What version of Windows are you running. etc.
1.0.7 Windows x64 on Windows 10 Creators Update

If there was any exception or error displayed, please copy it and paste it here:

Please include the scan or encode log:
rollin_eng
Veteran User
Posts: 4854
Joined: Wed May 04, 2011 11:06 pm

Re: AAC (avodec) low bitrate bad timbre

Post by rollin_eng »

Could you please post your logs, instructions can be found here:

viewtopic.php?f=6&t=31236
mduell
Veteran User
Posts: 8198
Joined: Sat Apr 21, 2007 8:54 pm

Re: AAC (avodec) low bitrate bad timbre

Post by mduell »

Yea, it's a crap AAC encoder. The good AAC encoder (FDK-AAC) was removed for political reasons, but you can get it if you compile yourself.
andrewk89
Novice
Posts: 65
Joined: Thu Jun 13, 2013 4:29 pm

Re: AAC (avodec) low bitrate bad timbre

Post by andrewk89 »

"AAC (avcodec) is a crap encoder" sounds like a pretty accurate diagnosis.
For completeness, here is the requested log, in the hopes that a "not crappy" solution is available.

Code: Select all

HandBrake 1.0.7 (2017040900) - 64bit
OS: Microsoft Windows NT 10.0.15063.0 - 64bit
CPU: Intel(R) Core(TM) i5-3350P CPU @ 3.10GHz
Ram: 8149 MB, 
GPU Information:
  NVIDIA GeForce GTX 650 Ti - 22.21.13.8205
Screen: 1920x1080
Temp Dir: d:\Users\Andrew\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: d:\Users\Andrew\AppData\Roaming\HandBrake Team\HandBrake\1.0.7.0

-------------------------------------------


# Starting Encode ...

[19:10:57] hb_init: starting libhb thread
[19:10:57] 1 job(s) to process
[19:10:57] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 64,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 2048
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "File": "D:\\r64kbps.mp4",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": 131072
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 4,
        "Settings": {
          "mode": "7"
        }
      },
      {
        "ID": 3,
        "Settings": {
          "block-height": "16",
          "block-thresh": "40",
          "block-width": "16",
          "filter-mode": "2",
          "mode": "3",
          "motion-thresh": "1",
          "spatial-metric": "2",
          "spatial-thresh": "1"
        }
      },
      {
        "ID": 8,
        "Settings": {
          "cb-spatial": "1",
          "cb-temporal": "3",
          "cr-spatial": "1",
          "cr-temporal": "3",
          "y-spatial": "2",
          "y-temporal": "2"
        }
      },
      {
        "ID": 11,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "480",
          "width": "848"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "0"
        }
      }
    ]
  },
  "PAR": {
    "Num": 160,
    "Den": 159
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "D:\\r_edit.mp4"
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": false,
      "Forced": false
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 4096,
    "Level": "auto",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "medium",
    "Profile": "auto",
    "Quality": 25.0,
    "OpenCL": false,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[19:10:57] CPU: Intel(R) Core(TM) i5-3350P CPU @ 3.10GHz
[19:10:57]  - Intel microarchitecture Ivy Bridge
[19:10:57]  - logical processor count: 4
[19:10:57] Intel Quick Sync Video support: no
[19:10:57] hb_scan: path=D:\r_edit.mp4, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:274: failed opening UDF image D:\r_edit.mp4
src/libbluray/disc/disc.c:352: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:352: error opening file BDMV\BACKUP\index.bdmv
[19:10:57] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.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
[19:10:57] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\r_edit.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.25.100
  Duration: 00:44:14.90, start: 0.000000, bitrate: 5190 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) [avc1 / 0x31637661]
      yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 4990 kb/s
      30 fps, 30k tbn (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) [mp4a / 0x6134706D]
      44100 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
[19:10:57] scan: decoding previews for title 1
[19:10:57] scan: audio 0x1: aac, rate=44100Hz, bitrate=192148 English (AAC) (2.0 ch)
[19:10:57] scan: 10 previews, 1280x720, 30.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[19:10:57] scan: supported video decoders: avcodec qsv
[19:10:57] libhb: scan thread found 1 valid title(s)
[19:10:57] starting job
[19:10:57] decomb filter thread started for segment 0
[19:10:57] decomb filter thread started for segment 1
[19:10:57] decomb filter thread started for segment 2
[19:10:57] decomb filter thread started for segment 3
[19:10:57] decomb check thread started for segment 0
[19:10:57] decomb check thread started for segment 1
[19:10:57] decomb check thread started for segment 2
[19:10:57] decomb check thread started for segment 3
[19:10:57] mask filter thread started for segment 0
[19:10:57] mask filter thread started for segment 1
[19:10:57] mask filter thread started for segment 2
[19:10:57] mask filter thread started for segment 3
[19:10:57] mask erode thread started for segment 0
[19:10:57] mask erode thread started for segment 1
[19:10:57] mask erode thread started for segment 2
[19:10:57] mask erode thread started for segment 3
[19:10:57] mask dilate thread started for segment 0
[19:10:57] mask dilate thread started for segment 1
[19:10:57] mask dilate thread started for segment 2
[19:10:57] mask dilate thread started for segment 3
[19:10:57] yadif thread started for segment 0
[19:10:57] yadif thread started for segment 1
[19:10:57] yadif thread started for segment 2
[19:10:57] yadif thread started for segment 3
[19:10:57] work: track 1, dithering not supported by codec
[19:10:57] work: only 1 chapter, disabling chapter markers
[19:10:57] job configuration:
[19:10:57]  * source
[19:10:57]    + D:\r_edit.mp4
[19:10:57]    + title 1, chapter(s) 1 to 1
[19:10:57]    + container: mov,mp4,m4a,3gp,3g2,mj2
[19:10:57]    + data rate: 5190 kbps
[19:10:57]  * destination
[19:10:57]    + D:\r64kbps.mp4
[19:10:57]    + container: MPEG-4 (libavformat)
[19:10:57]  * video track
[19:10:57]    + decoder: h264
[19:10:57]      + bitrate 4990 kbps
[19:10:57]    + filters
[19:10:57]      + 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)
[19:10:57]      + Decomb (mode=39)
[19:10:57]      + Framerate Shaper (mode=0)
[19:10:57]        + frame rate: same as source (around 30.000 fps)
[19:10:57]      + Denoise (hqdn3d) (y-spatial=2:cb-spatial=1:cr-spatial=1:y-temporal=2:cb-temporal=3:cr-temporal=3)
[19:10:57]      + Crop and Scale (width=848:height=480:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[19:10:57]        + source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 848 * 480
[19:10:57]    + Output geometry
[19:10:57]      + storage dimensions: 848 x 480
[19:10:57]      + pixel aspect ratio: 160 : 159
[19:10:57]      + display dimensions: 853 x 480
[19:10:57]    + encoder: H.265 (libx265)
[19:10:57]      + preset:  medium
[19:10:57]      + profile: auto
[19:10:57]      + quality: 25.00 (RF)
[19:10:57]  * audio track 1
[19:10:57]    + decoder: English (AAC) (2.0 ch) (track 1, id 0x1)
[19:10:57]      + bitrate: 192 kbps, samplerate: 44100 Hz
[19:10:57]    + mixdown: Stereo
[19:10:57]    + encoder: AAC (libavcodec)
[19:10:57]      + bitrate: 64 kbps, samplerate: 44100 Hz
[19:10:57] sync: expecting 79647 video frames
x265 [info]: HEVC encoder version 2.1
x265 [info]: build info [Windows][GCC 5.3.1][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x265 [info]: Main profile, Level-3 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 2 / wpp(8 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut       : 30 / 300 / 40
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-25.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 rskip signhide tmvp strong-intra-smoothing
x265 [info]: tools: deblock sao
[19:10:57] sync: first pts video is 0
[19:10:57] sync: "Chapter 1" (1) at frame 1 time 0
[19:10:57] sync: first pts audio 0x1 is 1800
[19:57:14] reader: done. 1 scr changes
[19:57:19] work: average encoding speed for job is 28.655922 fps
[19:57:19] comb detect: heavy 15 | light 197 | uncombed 79435 | total 79647
[19:57:19] decomb: deinterlaced 15 | blended 197 | unfiltered 79435 | total 79647
[19:57:19] vfr: lost time: 0 (0 frames)
[19:57:19] vfr: gained time: 0 (0 frames) (0 not accounted for)
[19:57:19] aac-decoder done: 114332 frames, 0 decoder errors
[19:57:19] h264-decoder done: 79647 frames, 0 decoder errors
[19:57:19] sync: got 79647 frames, 79647 expected
[19:57:19] sync: framerate min 30.000 fps, max 30.000 fps, avg 30.000 fps
x265 [info]: frame I:    289, Avg QP:24.17  kb/s: 2606.91
x265 [info]: frame P:  17558, Avg QP:26.20  kb/s: 856.65
x265 [info]: frame B:  61800, Avg QP:31.66  kb/s: 181.90
x265 [info]: Weighted P-Frames: Y:8.2% UV:4.9%
x265 [info]: consecutive B-frames: 3.1% 4.3% 8.1% 12.1% 72.4%
encoded 79647 frames in 2781.89s (28.63 fps), 339.45 kb/s, Avg QP:30.43
[19:57:19] mux: track 0, 79647 frames, 112968939 bytes, 340.40 kbps, fifo 8192
[19:57:19] mux: track 1, 114332 frames, 21471317 bytes, 64.70 kbps, fifo 16384
[19:57:19] libhb: work result = 0

# Encode Completed ...

rollin_eng
Veteran User
Posts: 4854
Joined: Wed May 04, 2011 11:06 pm

Re: AAC (avodec) low bitrate bad timbre

Post by rollin_eng »

Your source is AAC so use passthrough to retain 100% quality, however you won't save any space via audio.
mduell
Veteran User
Posts: 8198
Joined: Sat Apr 21, 2007 8:54 pm

Re: AAC (avodec) low bitrate bad timbre

Post by mduell »

andrewk89 wrote: Tue Jun 06, 2017 1:34 am"AAC (avcodec) is a crap encoder" sounds like a pretty accurate diagnosis.
For completeness, here is the requested log, in the hopes that a "not crappy" solution is available.
Compile yourself with FDK-AAC enabled.
Post Reply