Parameter "--normalize-mix" does not do anything (perceptible)

Discussion of the HandBrake command line interface (CLI)
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.
Locked
murphy
Posts: 3
Joined: Mon Aug 29, 2016 7:48 am

Parameter "--normalize-mix" does not do anything (perceptible)

Post by murphy »

Hi,

I have this video:

Code: Select all

Complete name                            : G:\_RECODE-SOURCES\SOURCE.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 3.96 GiB
Duration                                 : 1 h 26 min
Overall bit rate                         : 6 579 kb/s
Encoded date                             : UTC 2011-10-27 11:05:36
Writing application                      : mkvmerge v4.4.0 ('Die Wiederkehr') built on Sep 12 2011 13:42:08
Writing library                          : libebml v1.2.1 + libmatroska v1.2.0

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Muxing mode                              : Header stripping
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 1 h 26 min
Bit rate                                 : 5 450 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Original frame rate                      : 23.976 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.237
Stream size                              : 3.34 GiB (84%)
Writing library                          : x264 core 107 r1745 4785e8e
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=24 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc=2pass / mbtree=0 / bitrate=5450 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
Language                                 : English
Default                                  : No
Forced                                   : No

Audio #1
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Muxing mode                              : Header stripping
Codec ID                                 : A_AC3
Duration                                 : 1 h 26 min
Bit rate mode                            : Constant
Bit rate                                 : 448 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 spf)
Compression mode                         : Lossy
Stream size                              : 276 MiB (7%)
Language                                 : German
Default                                  : Yes
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Muxing mode                              : Header stripping
Codec ID                                 : A_AC3
Duration                                 : 1 h 26 min
Bit rate mode                            : Constant
Bit rate                                 : 448 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 spf)
Compression mode                         : Lossy
Stream size                              : 276 MiB (7%)
Language                                 : English
Default                                  : No
Forced                                   : No
with a loud Audio #1 track and a faint Audio #2 track.

Neither applying:
--normalize-mix 1
nor applying:
--normalize-mix 1,1
according to:

Code: Select all

--normalize-mix     Normalize audio mix levels to prevent clipping.
       <string>     Separate tracks by commas.
                    0 = Disable Normalization (default)
                    1 = Enable Normalization
found here:
https://handbrake.fr/docs/en/latest/cli/cli-guide.html
as well as here:
https://trac.handbrake.fr/wiki/CLIGuide#options

does anything to the level of any of the audio tracks.

After realizing that the "Extra Options" field is apparently inappropriate to simply append additional command line options (see below), I used the command line directly, shifting the parameter to a sensible position:

Code: Select all

HandBrakeCLI.exe -i "G:\_RECODE-SOURCES\SOURCE.mkv" -t 1 --angle 1 -c 1 -o "E:\DESTINATION.mkv"  -f mkv  -w 1280 --crop 0:0:0:0 --loose-anamorphic  --modulus 2 -e x264 -q 21 --vfr -a 1,2 -E ac3,ac3 -6 5point1,5point1 -R Auto,48 -B 448,448 -D 0,0 --normalize-mix 1,1 --gain 0,0 --encoder-preset=veryfast  --encoder-tune="film"  --encoder-level="4.0"  --encoder-profile=main --verbose=1 2> cli-log.txt
CLI log:

Code: Select all

[11:43:46] hb_init: starting libhb thread
HandBrake 0.10.5 (2016021100) - MinGW x86_64 - https://handbrake.fr
8 CPUs detected
Opening G:\_RECODE-SOURCES\SOURCE.mkv...
[11:43:46] CPU: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
[11:43:46]  - Intel microarchitecture Sandy Bridge
[11:43:46]  - logical processor count: 8
[11:43:46] OpenCL device #1: NVIDIA Corporation Quadro NVS 295
[11:43:46]  - OpenCL version: 1.0 CUDA
[11:43:46]  - driver version: 341.92
[11:43:46]  - device type:    GPU
[11:43:46]  - supported:      no
[11:43:46] Intel Quick Sync Video support: no
[11:43:46] hb_scan: path=G:\_RECODE-SOURCES\SOURCE.mkv, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening G:\_RECODE-SOURCES\SOURCE.mkv/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening G:\_RECODE-SOURCES\SOURCE.mkv/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(G:\_RECODE-SOURCES\SOURCE.mkv) failed
[11:43:46] 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
[11:43:46] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'G:\_RECODE-SOURCES\SOURCE.mkv':
  Duration: 01:26:05.60, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264 (High), yuv420p, 1280x720, PAR 1:1 DAR 16:9, 25 fps, 1k tbn, 47.95 tbc
    Stream #0.1(ger): Audio: ac3, 48000 Hz, 5.1, fltp, 448 kb/s (default)
    Stream #0.2(eng): Audio: ac3, 48000 Hz, 5.1, fltp, 448 kb/s
[11:43:46] scan: decoding previews for title 1
[11:43:46] scan: audio 0x1: ac3, rate=48000Hz, bitrate=448000 Deutsch (AC3) (5.1 ch)
[11:43:46] scan: audio 0x2: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)

Scanning title 1 of 1, preview 5, 50.00 %[11:43:46] scan: 10 previews, 1280x720, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[11:43:46] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: G:\_RECODE-SOURCES\SOURCE.mkv
  + duration: 01:26:05
  + size: 1280x720, pixel aspect: 1/1, display aspect: 1.78, 25.000 fps
  + autocrop: 0/0/0/0
  + support opencl: no
  + support hwd: yes
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 01:26:05
  + audio tracks:
    + 1, Deutsch (AC3) (5.1 ch) (iso639-2: deu), 48000Hz, 448000bps
    + 2, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 448000bps
  + subtitle tracks:
[11:43:46] 1 job(s) to process
[11:43:46] starting job
[11:43:46] sync: expecting 129140 video frames
[11:43:46] job configuration:
[11:43:46]  * source
[11:43:46]    + G:\_RECODE-SOURCES\SOURCE.mkv
[11:43:46]    + title 1, chapter(s) 1 to 1
[11:43:46]    + container: matroska,webm
[11:43:46]  * destination
[11:43:46]    + E:\DESTINATION.mkv
[11:43:46]    + container: Matroska (libavformat)
[11:43:46]  * video track
[11:43:46]    + decoder: h264
[11:43:46]    + filters
[11:43:46]      + Framerate Shaper (0:27000000:1080000)
[11:43:46]        + frame rate: same as source (around 25.000 fps)
[11:43:46]      + Crop and Scale (1280:720:0:0:0:0)
[11:43:46]        + source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 1280 * 720
[11:43:46]    + loose anamorphic
[11:43:46]      + storage dimensions: 1280 * 720, mod 2
[11:43:46]      + pixel aspect ratio: 1 / 1
[11:43:46]      + display dimensions: 1280 * 720
[11:43:46]    + encoder: H.264 (libx264)
[11:43:46]      + preset:  veryfast
[11:43:46]      + tune:    film
[11:43:46]      + profile: main
[11:43:46]      + level:   4.0
[11:43:46]      + quality: 21.00 (RF)
[11:43:46]  * audio track 1
[11:43:46]    + decoder: Deutsch (AC3) (5.1 ch) (track 1, id 0x1)
[11:43:46]      + bitrate: 448 kbps, samplerate: 48000 Hz
[11:43:46]    + mixdown: 5.1 Channels
[11:43:46]    + normalized mixing levels
[11:43:46]    + encoder: AC3 (libavcodec)
[11:43:46]      + bitrate: 448 kbps, samplerate: 48000 Hz
[11:43:46]  * audio track 2
[11:43:46]    + decoder: English (AC3) (5.1 ch) (track 2, id 0x2)
[11:43:46]      + bitrate: 448 kbps, samplerate: 48000 Hz
[11:43:46]    + mixdown: 5.1 Channels
[11:43:46]    + normalized mixing levels
[11:43:46]    + encoder: AC3 (libavcodec)
[11:43:46]      + bitrate: 448 kbps, samplerate: 48000 Hz
[11:43:46] reader: first SCR 0 id 0x0 DTS 0
[11:43:46] encx264: encoding at constant RF 21.000000
[11:43:46] encx264: unparsed options: level=4.0:ref=1:deblock=-1,-1:8x8dct=0:weightp=1:subme=2:mixed-refs=0:trellis=0:psy-rd=1.00,0.15:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=10
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x264 [info]: profile Main, level 4.0
[11:55:51] reader: done. 1 scr changes
[11:55:52] work: average encoding speed for job is 177.878922 fps
[11:55:52] sync: got 129116 frames, 129140 expected
[11:55:52] render: lost time: 0 (0 frames)
[11:55:52] render: gained time: 0 (0 frames) (0 not accounted for)
[11:55:52] h264-decoder done: 129116 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:1335  Avg QP:17.70  size: 70666
x264 [info]: frame P:58533 Avg QP:20.85  size: 13165
x264 [info]: frame B:69248 Avg QP:22.71  size:  2877
x264 [info]: consecutive B-frames: 15.5% 35.0% 11.8% 37.7%
x264 [info]: mb I  I16..4: 40.9%  0.0% 59.1%
x264 [info]: mb P  I16..4: 11.6%  0.0%  1.4%  P16..4: 32.2% 12.9%  6.4%  0.0%  0.0%    skip:35.5%
x264 [info]: mb B  I16..4:  0.9%  0.0%  0.1%  B16..8: 13.1%  3.5%  0.4%  direct: 6.7%  skip:75.3%  L0:30.6% L1:51.3% BI:18.1%
x264 [info]: coded y,uvDC,uvAC intra: 30.9% 45.2% 10.6% inter: 9.2% 10.6% 0.2%
x264 [info]: i16 v,h,dc,p: 47% 24% 18% 11%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 19% 19%  6%  7%  7%  6%  6%  5%
x264 [info]: i8c dc,h,v,p: 57% 17% 22%  4%
x264 [info]: Weighted P-Frames: Y:2.7% UV:0.8%
x264 [info]: kb/s:1648.35
[11:55:52] ac3-decoder done: 0 frames, 0 decoder errors, 0 drops
[11:55:52] ac3-decoder done: 0 frames, 0 decoder errors, 0 drops
[11:55:52] mux: track 0, 129116 frames, 1064093745 bytes, 1647.97 kbps, fifo 2048
[11:55:52] mux: track 1, 161425 frames, 289273600 bytes, 448.00 kbps, fifo 4096
[11:55:52] mux: track 2, 161425 frames, 289273600 bytes, 448.00 kbps, fifo 4096
[11:55:52] libhb: work result = 0

Encode done!
HandBrake has exited.
That way, no errors occurred – the noticeable effect, however, was equally zero.
Audio #1 gain was still as high as before, Audio #2 gain was still as low as before.

So what's with this badly documented, yet documented, but apparently non- or ineffective command line parameter?







I tried to hide the rest ... alas, [hide] or [spoiler] aren't implemented here. And IMGs aren't even resizable, sorry for that.

Like mentioned above, on a first attempt I tried to provide the additional parameter within the GUI.
This is what you would expect an "Extra Options" field to be made for, as well known e.g. from here:

Image

Given there is no "Extra Options" field under "Audio", I was forced to enter the parameter under "Video".
Considering that command line parameters are generally exchangeable, I just thought to give it a try ...
... but inevitably, the following errors occured:
[08:47:19] + encoder: H.264 (libx264)
[...]
[08:47:19] + options: --normalize-mix
[...]
[08:47:19] x264 options: Unknown suboption --normalize-mix
[08:47:19] encx264: unparsed options: --normalize-mix:level=4.0:ref=1:deblock=-1,-1:8x8dct=0:weightp=1:subme=2:mixed-refs=0:trellis=0:psy-rd=1.00,0.15:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=10

Since that practice is obviously invalid, how to apply additional command line parameters using the GUI?
How to apply "Extra Options" for audio at all?
Why isn't there a checkbox "Normalize" (which is needed) just like there is a field "Gain" (which isn't suitable) under "Audio"?
Because normalization doesn't work anyway?
...

GUI log:

Code: Select all

HandBrake 0.10.5.0 - 64bit Version
OS: Microsoft Windows NT 6.1.7601 Service Pack 1 - 64bit
CPU: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
Ram: 16277 MB, 
GPU Information:
  NVIDIA Quadro NVS 295 - 9.18.13.4192
  Intel(R) HD Graphics 3000 - 9.17.10.2857
Screen: 2560x1440
Temp Dir: C:\Users\murphy\AppData\Local\Temp\
Install Dir: C:\Program Files\Handbrake
Data Dir: C:\Users\murphy\AppData\Roaming\HandBrake Team\HandBrake\0.10.5.0

-------------------------------------------
CLI Query:  -i "G:\_RECODE-SOURCES\SOURCE.mkv" -t 1 --angle 1 -c 1 -o "E:\DESTINATION.mkv"  -f mkv  -w 1280 --crop 0:0:0:0 --loose-anamorphic  --modulus 2 -e x264 -q 21 --vfr -a 1,2 -E ac3,ac3 -6 5point1,5point1 -R Auto,48 -B 448,448 -D 0,0 --gain 0,0 --audio-fallback ac3 --markers="C:\Users\murphy\AppData\Local\Temp\DESTINATION-1-chapters.csv" --encoder-preset=veryfast  --encoder-tune="film"  -x --normalize-mix 1,1 --encoder-level="4.0"  --encoder-profile=main  --verbose=1

[08:47:19] hb_init: starting libhb thread
HandBrake 0.10.5 (2016021100) - MinGW x86_64 - https://handbrake.fr
8 CPUs detected
Opening G:\_RECODE-SOURCES\SOURCE.mkv...
[08:47:19] CPU: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
[08:47:19]  - Intel microarchitecture Sandy Bridge
[08:47:19]  - logical processor count: 8
[08:47:19] OpenCL device #1: NVIDIA Corporation Quadro NVS 295
[08:47:19]  - OpenCL version: 1.0 CUDA
[08:47:19]  - driver version: 341.92
[08:47:19]  - device type:    GPU
[08:47:19]  - supported:      no
[08:47:19] Intel Quick Sync Video support: no
[08:47:19] hb_scan: path=G:\_RECODE-SOURCES\SOURCE.mkv, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening G:\_RECODE-SOURCES\SOURCE.mkv/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening G:\_RECODE-SOURCES\SOURCE.mkv/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(G:\_RECODE-SOURCES\SOURCE.mkv) failed
[08:47:19] 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
[08:47:19] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'G:\_RECODE-SOURCES\SOURCE.mkv':
  Duration: 01:26:05.60, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264 (High), yuv420p, 1280x720, PAR 1:1 DAR 16:9, 25 fps, 1k tbn, 47.95 tbc
    Stream #0.1(ger): Audio: ac3, 48000 Hz, 5.1, fltp, 448 kb/s (default)
    Stream #0.2(eng): Audio: ac3, 48000 Hz, 5.1, fltp, 448 kb/s
[08:47:19] scan: decoding previews for title 1
[08:47:19] scan: audio 0x1: ac3, rate=48000Hz, bitrate=448000 Deutsch (AC3) (5.1 ch)
[08:47:19] scan: audio 0x2: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
Scanning title 1 of 1, preview 5, 50.00 %[08:47:19] scan: 10 previews, 1280x720, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[08:47:19] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: G:\_RECODE-SOURCES\SOURCE.mkv
  + duration: 01:26:05
  + size: 1280x720, pixel aspect: 1/1, display aspect: 1.78, 25.000 fps
  + autocrop: 0/0/0/0
  + support opencl: no
  + support hwd: yes
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 01:26:05
  + audio tracks:
    + 1, Deutsch (AC3) (5.1 ch) (iso639-2: deu), 48000Hz, 448000bps
    + 2, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 448000bps
  + subtitle tracks:
Reading chapter markers from file C:\Users\murphy\AppData\Local\Temp\DESTINATION-1-chapters.csv
[08:47:19] 1 job(s) to process
[08:47:19] starting job
[08:47:19] sync: expecting 129140 video frames
[08:47:19] work: only 1 chapter, disabling chapter markers
[08:47:19] job configuration:
[08:47:19]  * source
[08:47:19]    + G:\_RECODE-SOURCES\SOURCE.mkv
[08:47:19]    + title 1, chapter(s) 1 to 1
[08:47:19]    + container: matroska,webm
[08:47:19]  * destination
[08:47:19]    + E:\DESTINATION.mkv
[08:47:19]    + container: Matroska (libavformat)
[08:47:19]  * video track
[08:47:19]    + decoder: h264
[08:47:19]    + filters
[08:47:19]      + Framerate Shaper (0:27000000:1080000)
[08:47:19]        + frame rate: same as source (around 25.000 fps)
[08:47:19]      + Crop and Scale (1280:720:0:0:0:0)
[08:47:19]        + source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 1280 * 720
[08:47:19]    + loose anamorphic
[08:47:19]      + storage dimensions: 1280 * 720, mod 2
[08:47:19]      + pixel aspect ratio: 1 / 1
[08:47:19]      + display dimensions: 1280 * 720
[08:47:19]    + encoder: H.264 (libx264)
[08:47:19]      + preset:  veryfast
[08:47:19]      + tune:    film
[08:47:19]      + options: --normalize-mix
[08:47:19]      + profile: main
[08:47:19]      + level:   4.0
[08:47:19]      + quality: 21.00 (RF)
[08:47:19]  * audio track 1
[08:47:19]    + decoder: Deutsch (AC3) (5.1 ch) (track 1, id 0x1)
[08:47:19]      + bitrate: 448 kbps, samplerate: 48000 Hz
[08:47:19]    + mixdown: 5.1 Channels
[08:47:19]    + encoder: AC3 (libavcodec)
[08:47:19]      + bitrate: 448 kbps, samplerate: 48000 Hz
[08:47:19]  * audio track 2
[08:47:19]    + decoder: English (AC3) (5.1 ch) (track 2, id 0x2)
[08:47:19]      + bitrate: 448 kbps, samplerate: 48000 Hz
[08:47:19]    + mixdown: 5.1 Channels
[08:47:19]    + encoder: AC3 (libavcodec)
[08:47:19]      + bitrate: 448 kbps, samplerate: 48000 Hz
[08:47:19] reader: first SCR 0 id 0x0 DTS 0
[08:47:19] x264 options: Unknown suboption --normalize-mix
[08:47:19] encx264: encoding at constant RF 21.000000
[08:47:19] encx264: unparsed options: --normalize-mix:level=4.0:ref=1:deblock=-1,-1:8x8dct=0:weightp=1:subme=2:mixed-refs=0:trellis=0:psy-rd=1.00,0.15:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=10
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x264 [info]: profile Main, level 4.0
[08:59:49] reader: done. 1 scr changes
[08:59:49] work: average encoding speed for job is 172.266479 fps
[08:59:49] sync: got 129116 frames, 129140 expected
[08:59:49] render: lost time: 0 (0 frames)
[08:59:49] render: gained time: 0 (0 frames) (0 not accounted for)
[08:59:49] h264-decoder done: 129116 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:1335  Avg QP:17.70  size: 70666
x264 [info]: frame P:58533 Avg QP:20.85  size: 13165
x264 [info]: frame B:69248 Avg QP:22.71  size:  2877
x264 [info]: consecutive B-frames: 15.5% 35.0% 11.8% 37.7%
x264 [info]: mb I  I16..4: 40.9%  0.0% 59.1%
x264 [info]: mb P  I16..4: 11.6%  0.0%  1.4%  P16..4: 32.2% 12.9%  6.4%  0.0%  0.0%    skip:35.5%
x264 [info]: mb B  I16..4:  0.9%  0.0%  0.1%  B16..8: 13.1%  3.5%  0.4%  direct: 6.7%  skip:75.3%  L0:30.6% L1:51.3% BI:18.1%
x264 [info]: coded y,uvDC,uvAC intra: 30.9% 45.2% 10.6% inter: 9.2% 10.6% 0.2%
x264 [info]: i16 v,h,dc,p: 47% 24% 18% 11%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 19% 19%  6%  7%  7%  6%  6%  5%
x264 [info]: i8c dc,h,v,p: 57% 17% 22%  4%
x264 [info]: Weighted P-Frames: Y:2.7% UV:0.8%
x264 [info]: kb/s:1648.35
[08:59:49] ac3-decoder done: 0 frames, 0 decoder errors, 0 drops
[08:59:49] ac3-decoder done: 0 frames, 0 decoder errors, 0 drops
[08:59:49] mux: track 0, 129116 frames, 1064093745 bytes, 1647.97 kbps, fifo 2048
[08:59:49] mux: track 1, 161425 frames, 289273600 bytes, 448.00 kbps, fifo 4096
[08:59:49] mux: track 2, 161425 frames, 289273600 bytes, 448.00 kbps, fifo 4096
[08:59:49] libhb: work result = 0
Encode done!
HandBrake has exited.
[/size]
Woodstock
Veteran User
Posts: 4621
Joined: Tue Aug 27, 2013 6:39 am

Re: Parameter "--normalize-mix" does not do anything (perceptible)

Post by Woodstock »

Are you assuming that handbrake will normalize the two tracks to balance out their differences?

Normalization of audio, in my experience, is within a single track - the audio is adjusted so that you do not swing too far above the average, and also to keep peaks out of saturation. If the peaks aren't approaching 100%, there isn't going to be a lot done to them.
mduell
Veteran User
Posts: 8206
Joined: Sat Apr 21, 2007 8:54 pm

Re: Parameter "--normalize-mix" does not do anything (perceptible)

Post by mduell »

It does what it says: avoids clipping. It has nothing to do with multiple tracks.

Normalize mix isn't a x264 option, so it doesn't go in the x264 options box.
Deleted User 11865

Re: Parameter "--normalize-mix" does not do anything (perceptible)

Post by Deleted User 11865 »

It normalizes mix (as in downmix) levels, and you're not downmixing the source audio (5.1 in, 5.1 out).

The only arguable issue (IMO) is that maybe the options should maybe be called --normalize-downmix-levels :P
murphy
Posts: 3
Joined: Mon Aug 29, 2016 7:48 am

Re: Parameter "--normalize-mix" does not do anything (perceptible)

Post by murphy »

Hi guys, thanks to you all for replying!

Happy readings :mrgreen:


@Woodstock
Woodstock wrote:Are you assuming that handbrake will normalize the two tracks to balance out their differences?
Yes, exactly ... it should normalize the two tracks by themselves, which would result in balanced out differences, to be even more precise.
Normalization of audio, in my experience, is within a single track
Correct. Hence, I also tried it out with a single track (remuxed with only the 2nd track left in, now being the first and only track) just to eliminate the possibility of "1,1" being the problem, but Handbrake also didn't normalize a single track as well.
the audio is adjusted so that you do not swing too far above the average, and also to keep peaks out of saturation.
Normalization is also making full use of the available dynamic range, and that doesn't happen, which is exactly the problem.
If the peaks aren't approaching 100%, there isn't going to be a lot done to them.
Or rather, nothing ... as far as I am able to perceive it with decent equipment.


@mduell
mduell wrote:It does what it says: avoids clipping.
If it only avoids clipping, it does not normalize.
It has nothing to do with multiple tracks.
It has, in so far as that you can normalize several tracks at the same time:

Code: Select all

Separate tracks by commas.
Following this, "--normalize-mix 1,1" should also work as well as "--normalize-mix 1" ... but neither doesn't.

OT PART
Normalize mix isn't a x264 option, so it doesn't go in the x264 options box.

See:
»Given there is no "Extra Options" field under "Audio", I was forced to enter the parameter under "Video".
Considering that command line parameters are generally exchangeable, I just thought to give it a try ...
... but inevitably, the following errors occured: [...]
Since that practice is obviously invalid,«

So I figured this out already. The arising questions were:
»how to apply additional command line parameters using the GUI?
How to apply "Extra Options" for audio at all?«



@Rodeo
Rodeo wrote:It normalizes mix (as in downmix) levels,
Where did you get that from? Since I couldn't find any hint in the documentation or anywhere else that normalizing only works in combination with downmixing (which are two completely different things) a source would be highly appreciated.
and you're not downmixing the source audio (5.1 in, 5.1 out).
Yes, indeed. Why would I? I want to normalize two AC3 tracks ... which implies 5.1 in, 5.1 out. No downmix desired.
I posted the logfiles to ensure that I didn't use AC3 passthru, which in fact would spoil any attempt to normalize! 8)
The only arguable issue (IMO) is that maybe the options should maybe be called --normalize-downmix-levels :P
This sounds like you had checked that functionality by yourself, observing that normalization only happens when downmixing?
The arguable issue is that "--normalize-mix" obviously doesn't normalize, and thus should maybe called "--prevent-clipping" ...


Last but not least, to clear up some misunderstandings above:

Full Definition of NORMALIZE

  1. to make conform to or reduce to a norm or standard
  2. to make normal (as by a transformation of variables)
  3. to bring or restore (as relations between countries) to a normal condition
[/i]
Audio Normalization

»Audio normalization is the application of a constant amount of gain to an audio recording to bring the average or peak amplitude to a target level (the norm). [...]«

Peak Normalization

»One type of normalization is peak normalization, wherein the gain is changed to bring the highest PCM sample value or analog signal peak to a given level – usually 0 dBFS, the loudest level allowed in a digital system. [...]«

Loudness Normalization

»Another type of normalization is based on a measure of loudness, wherein the gain is changed to bring the average amplitude to a target level. [...]«

How To Normalize Audio – Why Do It?

»To normalize audio is to change its overall volume by a fixed amount to reach a target level.«
The keyword here is "to reach".

»If you have a quiet audio file you may want to make it as loud as possible (0 dBFS ) without changing its dynamic range.«
This applies directly to my AC3 track Audio #2, see above.

»If you have a group of audio files at different volumes you may want to make them all as close as possible to the same volume.«
This applies to both my AC3 tracks of very different volume levels.


TL;DR

So of course I'm aware of the fact that simple peak normalization wouldn't necessarily bring both tracks to the exact same perceived loudness level, but I didn't even expect that. Given that Audio #1 and Audio #2 are tracks of the same movie, and peak levels are usually determined by music and sound effects, not by dialogue, peak normalization would be totally adequate and sufficient in this case. Also, clipping prevention isn't actually the same as normalization, as suggested by the Handbrake guides (and mduell). It can be used to prevent clipping by normalizing to a lower target level than 0dB, but if it really was used that would imply not only decreasing volume levels, but also increasing volume levels.

Handbrake, however, doesn't do anything like that ... therefore "--normalize-mix" does not normalize.



Sorry for the lengthy post! I'll try to respond in a more timely manner in the future.
Besides other failings mentioned above, reply notification is set to off by default :?
Deleted User 11865

Re: Parameter "--normalize-mix" does not do anything (perceptible)

Post by Deleted User 11865 »

murphy wrote:@Rodeo
Rodeo wrote:It normalizes mix (as in downmix) levels,
Where did you get that from? Since I couldn't find any hint in the documentation or anywhere else that normalizing only works in combination with downmixing (which are two completely different things) a source would be highly appreciated.
and you're not downmixing the source audio (5.1 in, 5.1 out).
Yes, indeed. Why would I? I want to normalize two AC3 tracks ... which implies 5.1 in, 5.1 out. No downmix desired.
I posted the logfiles to ensure that I didn't use AC3 passthru, which in fact would spoil any attempt to normalize! 8)
The only arguable issue (IMO) is that maybe the options should maybe be called --normalize-downmix-levels :P
This sounds like you had checked that functionality by yourself, observing that normalization only happens when downmixing?
The arguable issue is that "--normalize-mix" obviously doesn't normalize, and thus should maybe called "--prevent-clipping" ...
I mapped the option from HandBrake's code to libavresample's mix level normalization. What it does is compute the downmix matrix, but then reduces the matrix's coefficients so that none of them exceeds 1 (so all coefficients are normalized to 1).

We can argue over semantics and how the option should be named all day, the fact remains that it works as intended by the developers (and matches the documentation, however poorly written it may or may not be).
murphy
Posts: 3
Joined: Mon Aug 29, 2016 7:48 am

Re: Parameter "--normalize-mix" does not do anything (perceptible)

Post by murphy »

Hi, Rodeo.

My problem isn't about semantics, so there's no need to argue about that.

My problem is that the provided parameter --normalize-mix doesn't normalize*, which indeed would be helpful to a great deal of people.
From what I understand reading your post, this parameter literally doesn't come into effect unless downmixing is used at the same time?

This is, to my knowledge, neither documented nor expedient, regarding that actual normalization would easily solve volume level issues.

Having no choice, I used "gain" instead – also provided by the GUI – but that required multiple attempts to figure out appropriate values.
Also, "gain" inevitably puts you in trouble regarding clipping, which is exactly not prevented when using both parameters simultaneously.
(apparently due to what you clarified above)

* EDIT: audio levels
Deleted User 11865

Re: Parameter "--normalize-mix" does not do anything (perceptible)

Post by Deleted User 11865 »

The option was never called --normalize, and audio mix levels (as opposed to audio levels) are very much mentioned in the built-in help text (the most up-to-date source of documentation for the command-line interface). And it matches definition 2 provided by the dictionary you linked to.

I'm sorry that the documentation wasn't clear to you (and we should definitely look into improving the wording), but we're running in circles now.
Locked