Can Handbrake be made to show min&max bitrate in the log?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
smu johnson
Posts: 5
Joined: Mon May 02, 2022 5:03 am

Can Handbrake be made to show min&max bitrate in the log?

Post by smu johnson »

Description of problem or question:

x264 and/or Handbrake doesn't tell you in the log files what the min and max bitrates it found were when encoding a video stream. This would be handy to know so that I can tell if the L encoder level I'm setting (e.g., 3.0, 3.1, etc) is the right choice. A lot of different DVDs pick 3.0, 3.1, and even 4.1 when Handbrake's "Encoder level" is set to "Auto" with "VerySlow" and Constant Quality: 16.

Long story short: I'm trying to see if forcing 3.0 is a good idea despite auto going as high as 4.1 on some DVDs. Knowing the min and max would probably give me a rough idea of what a good choice would be. Maybe 3.1 for them all? :roll:


Steps to reproduce the problem (If Applicable):

Encode some video, look at the log files.


HandBrake version (e.g., 1.0.0):

1.5.1


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

Windows 11 21H2


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

Code: Select all

HandBrake 1.5.1 (2022011000)
OS: Microsoft Windows NT 10.0.22000.0
CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Ram: 8051 MB, 
GPU Information:
  Intel(R) HD Graphics 520 - 20.19.15.4474
Screen: 1366x768
Temp Dir: C:\Users\sjohnson\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake\
Data Dir: C:\Users\sjohnson\AppData\Roaming\HandBrake

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

 # Starting Encode ...

[22:41:38] base preset: Super HQ 480p30 Surround (Modified)
[22:41:39] Remote Process started with Process ID: 12468 using port: 8037. Max Allowed Instances: 1
[22:41:39] Worker: Starting HandBrake Engine ...
[22:41:39] Worker: Starting Web Server on port 8037 ...
[22:41:40] Worker: Disconnected worker monitoring enabled!
[22:41:40] Compile-time hardening features are enabled
Cannot load nvEncodeAPI64.dll
Cannot load nvEncodeAPI64.dll
Cannot load nvEncodeAPI64.dll
Cannot load nvEncodeAPI64.dll
ting libhb thread
[22:41:40] Starting work at: Sun May 01 22:41:40 2022
[22:41:40] 1 job(s) to process
[22:41:40] json job:
{
  "Audio": {
    "AudioList": [
      {
        "DRC": 0,
        "Encoder": "copy:ac3",
        "Gain": 0,
        "Mixdown": -1,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      "copy:aac",
      "copy:ac3",
      "copy:dtshd",
      "copy:dts",
      "copy:eac3",
      "copy:flac",
      "copy:mp3",
      "copy:truehd",
      "copy:mp2"
    ],
    "FallbackEncoder": "ac3"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      },
      {
        "Name": "Chapter 2"
      },
      {
        "Name": "Chapter 3"
      },
      {
        "Name": "Chapter 4"
      },
      {
        "Name": "Chapter 5"
      },
      {
        "Name": "Chapter 6"
      },
      {
        "Name": "Chapter 7"
      },
      {
        "Name": "Chapter 8"
      },
      {
        "Name": "Chapter 9"
      },
      {
        "Name": "Chapter 10"
      },
      {
        "Name": "Chapter 11"
      },
      {
        "Name": "Chapter 12"
      },
      {
        "Name": "Chapter 13"
      },
      {
        "Name": "Chapter 14"
      },
      {
        "Name": "Chapter 15"
      },
      {
        "Name": "Chapter 16"
      },
      {
        "Name": "Chapter 17"
      },
      {
        "Name": "Chapter 18"
      },
      {
        "Name": "Chapter 19"
      },
      {
        "Name": "Chapter 20"
      },
      {
        "Name": "Chapter 21"
      },
      {
        "Name": "Chapter 22"
      },
      {
        "Name": "Chapter 23"
      },
      {
        "Name": "Chapter 24"
      },
      {
        "Name": "Chapter 25"
      },
      {
        "Name": "Chapter 26"
      },
      {
        "Name": "Chapter 27"
      },
      {
        "Name": "Chapter 28"
      },
      {
        "Name": "Chapter 29"
      },
      {
        "Name": "Chapter 30"
      },
      {
        "Name": "Chapter 31"
      },
      {
        "Name": "Chapter 32"
      },
      {
        "Name": "Chapter 33"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "C:\\Users\\sjohnson\\Videos\\Terminator 3 - Chap 11 CFR L3.0.mkv",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": "av_mkv"
  },
  "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": 13,
        "Settings": {
          "crop-bottom": "64",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "62",
          "height": "354",
          "width": "720"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 32,
    "Den": 27
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 11,
      "End": 11
    },
    "Title": 1,
    "Path": "C:\\Users\\sjohnson\\Documents\\savetest\\MainMovie\\TERMINATOR_3"
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": false,
      "Forced": false
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "x264",
    "Level": "3.0",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "veryslow",
    "Profile": "high",
    "Quality": 16,
    "QSV": {
      "Decode": false
    }
  }
}
[22:41:40] CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
[22:41:40]  - Intel microarchitecture Skylake
[22:41:40]  - logical processor count: 4
[22:41:40] Intel Quick Sync Video support: yes, gpu list: 0
[22:41:40] Intel Quick Sync Video integrated adapter with index 0
[22:41:40]  - Intel Media SDK hardware: API 1.19 (minimum: 1.3)
[22:41:40]  - Decode support:  h264 hevc (8bit: yes, 10bit: no)
[22:41:40]  - H.264 encoder: yes
[22:41:40]     - preferred implementation: hardware (1) via D3D11
[22:41:40]     - capabilities (hardware):  breftype icq+la+i+downs vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[22:41:40]  - H.265 encoder: no
[22:41:40] hb_scan: path=C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3, title_index=1
src/libbluray/disc/disc.c:437: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:437: error opening file BDMV\BACKUP\index.bdmv
src/libbluray/bluray.c:2646: nav_get_title_list(C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3\) failed
[22:41:40] bd: not a bd - trying as a stream/file instead
libdvdread: Could not open C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 with libdvdcss.
libdvdread: Can't open C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 for reading
libdvdread: Device C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 inaccessible, CSS authentication not available.
libdvdnlibdvdnav: Unable to open device file C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3.
av: vm: dvd_read_name failed
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 01 02 03 04 05 06 07 08
libdvdread: Could not open C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 with libdvdcss.
libdvdread: Can't open C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 for reading
libdvdread: Device C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 inaccessible, CSS authentication not available.
[22:41:40] scan: DVD has 1 title(s)
[22:41:40] scan: scanning title 1
[22:41:40] scan: duration is 01:48:53 (6533767 ms)
[22:41:40] pgc_id: 1, pgn: 1: pgc: 000001d66acfd8f0
[22:41:40] scan: checking audio 1
[22:41:40] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[22:41:40] scan: checking audio 2
[22:41:40] scan: id=0x81bd, lang=Francais (AC3), 3cc=fra ext=0
[22:41:40] scan: checking subtitle 1
[22:41:40] scan: id=0x20bd, lang=English (Wide Screen) [VOBSUB], 3cc=eng ext=0
[22:41:40] scan: id=0x21bd, lang=English (Letterbox) [VOBSUB], 3cc=eng ext=0
[22:41:40] scan: checking subtitle 2
[22:41:40] scan: id=0x22bd, lang=Francais (Wide Screen) [VOBSUB], 3cc=fra ext=0
[22:41:40] scan: id=0x23bd, lang=Francais (Letterbox) [VOBSUB], 3cc=fra ext=0
[22:41:40] scan: checking subtitle 3
[22:41:40] scan: id=0x24bd, lang=espaÏol (Wide Screen) [VOBSUB], 3cc=spa ext=0
[22:41:40] scan: id=0x25bd, lang=espaÏol (Letterbox) [VOBSUB], 3cc=spa ext=0
[22:41:40] scan: title 1 has 33 chapters
[22:41:40] scan: chap 1, 216833 ms
[22:41:40] scan: chap 2, 125700 ms
[22:41:40] scan: chap 3, 209567 ms
[22:41:40] scan: chap 4, 132133 ms
[22:41:40] scan: chap 5, 294266 ms
[22:41:40] scan: chap 6, 242667 ms
[22:41:40] scan: chap 7, 155400 ms
[22:41:40] scan: chap 8, 197767 ms
[22:41:40] scan: chap 9, 196767 ms
[22:41:40] scan: chap 10, 175367 ms
[22:41:40] scan: chap 11, 166934 ms
[22:41:40] scan: chap 12, 179767 ms
[22:41:40] scan: chap 13, 241500 ms
[22:41:40] scan: chap 14, 92667 ms
[22:41:40] scan: chap 15, 277967 ms
[22:41:40] scan: chap 16, 199967 ms
[22:41:40] scan: chap 17, 127233 ms
[22:41:40] scan: chap 18, 220000 ms
[22:41:40] scan: chap 19, 151567 ms
[22:41:40] scan: chap 20, 340367 ms
[22:41:40] scan: chap 21, 165033 ms
[22:41:40] scan: chap 22, 135667 ms
[22:41:40] scan: chap 23, 188600 ms
[22:41:40] scan: chap 24, 267700 ms
[22:41:40] scan: chap 25, 169333 ms
[22:41:40] scan: chap 26, 214533 ms
[22:41:40] scan: chap 27, 248333 ms
[22:41:40] scan: chap 28, 158600 ms
[22:41:40] scan: chap 29, 124900 ms
[22:41:40] scan: chap 30, 119033 ms
[22:41:40] scan: chap 31, 201767 ms
[22:41:40] scan: chap 32, 166300 ms
[22:41:40] scan: chap 33, 429533 ms
[22:41:40] scan: aspect = 16:9
[22:41:40] scan: decoding previews for title 1
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 01 02 03 04 05 06 07 08
[22:41:40] scan: title angle(s) 1
[22:41:40] scan: audio 0x81bd: ac3, rate=48000Hz, bitrate=448000 Francais (AC3) (5.1 ch) (448 kbps)
[22:41:40] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch) (448 kbps)
[22:41:40] scan: 10 previews, 720x480, 23.976 fps, autocrop = 60/64/0/0, aspect 16:9, PAR 32:27, color profile: 6-1-6, chroma location: left
[22:41:40] libhb: scan thread found 1 valid title(s)
[22:41:40] Starting Task: Encoding Pass
[22:41:40] work: only 1 chapter, disabling chapter markers
[22:41:40] job configuration:
[22:41:40]  * source
[22:41:40]    + C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3
[22:41:40]    + title 1, chapter(s) 11 to 11
[22:41:40]  * destination
[22:41:40]    + C:\Users\sjohnson\Videos\Terminator 3 - Chap 11 CFR L3.0.mkv
[22:41:40]    + container: Matroska (libavformat)
[22:41:40]  * video track
[22:41:40]    + decoder: mpeg2video 8-bit (yuv420p)
[22:41:40]      + bitrate 200 kbps
[22:41:40]    + filters
[22:41:40]      + 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)
[22:41:40]      + Decomb (mode=39)
[22:41:40]      + Framerate Shaper (mode=1)
[22:41:40]        + frame rate: 23.976 fps -> constant 23.976 fps
[22:41:40]      + Crop and Scale (width=720:height=354:crop-top=62:crop-bottom=64:crop-left=0:crop-right=0)
[22:41:40]        + source: 720 * 480, crop (62/64/0/0): 720 * 354, scale: 720 * 354
[22:41:40]    + Output geometry
[22:41:40]      + storage dimensions: 720 x 354
[22:41:40]      + pixel aspect ratio: 32 : 27
[22:41:40]      + display dimensions: 853 x 354
[22:41:40]    + encoder: H.264 (libx264)
[22:41:40]      + preset:  veryslow
[22:41:40]      + profile: high
[22:41:40]      + level:   3.0
[22:41:40]      + quality: 16.00 (RF)
[22:41:40]      + color profile: 6-1-6
[22:41:40]      + chroma location: left
[22:41:40]  * audio track 1
[22:41:40]    + decoder: English (AC3) (5.1 ch) (448 kbps) (track 1, id 0x80bd)
[22:41:40]      + bitrate: 448 kbps, samplerate: 48000 Hz
[22:41:40]    + AC3 Passthru
libdvdread: Could not open C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 with libdvdcss.
libdvdread: Can't open C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 for reading
libdvdread: Device C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 inaccessible, CSS authentication not available.
libdvdnlibdvdnav: Unable to open device file C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3.
av: vm: dvd_read_name failed
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 01 02 03 04 05 06 07 08
libdvdread: Could not open C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 with libdvdcss.
libdvdread: Can't open C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 for reading
libdvdread: Device C:\Users\sjohnson\Documents\savetest\MainMovie\TERMINATOR_3 inaccessible, CSS authentication not available.
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 01 02 03 04 05 06 07 08
[22:41:40] sync: expecting 4002 video frames
[22:41:40] encx264: min-keyint: 24, keyint: 240
[22:41:40] encx264: encoding at constant RF 16.000000
[22:41:40] encx264: unparsed options: level=3.0:ref=7:bframes=8:b-adapt=2:direct=auto:analyse=all:me=umh:merange=24:subme=10:trellis=2:vbv-bufsize=12500:vbv-maxrate=12500:rc-lookahead=60
x264 [info]: using SAR=32/27
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile High, level 3.0, 4:2:0, 8-bit
[22:41:40] sync: first pts audio 0x80bd is 0
[22:41:40] sync: first pts video is 8382
[22:41:40] sync: "Chapter 11" (11) at frame 1 time 8382
[22:48:06] reader: end of chapter 11 (media 11) reached at media chapter 12
[22:48:06] reader: done. 1 scr changes
[22:48:06] 167.160019s: Film -> Video
[22:48:19] work: average encoding speed for job is 10.287105 fps
[22:48:19] comb detect: heavy 28 | light 103 | uncombed 3876 | total 4007
[22:48:19] decomb: deinterlaced 28 | blended 103 | unfiltered 3876 | total 4007
[22:48:19] vfr: 4007 frames output, 0 dropped and 0 duped for CFR/PFR
[22:48:19] vfr: lost time: 0 (0 frames)
[22:48:19] vfr: gained time: 0 (0 frames) (0 not accounted for)
[22:48:19] ac3-decoder done: 5222 frames, 0 decoder errors
[22:48:19] mpeg2video-decoder done: 4007 frames, 0 decoder errors
[22:48:19] sync: got 4007 frames, 4002 expected
[22:48:19] sync: framerate min 23.976 fps, max 29.970 fps, avg 23.978 fps
x264 [info]: frame I:38    Avg QP:15.19  size: 40564
x264 [info]: frame P:1229  Avg QP:18.92  size: 17579
x264 [info]: frame B:2740  Avg QP:20.19  size: 11551
x264 [info]: consecutive B-frames:  6.0%  9.2% 21.9% 34.4% 11.1% 16.2%  0.7%  0.2%  0.2%
x264 [info]: mb I  I16..4:  2.6% 82.0% 15.5%
x264 [info]: mb P  I16..4:  3.6% 43.3%  5.6%  P16..4: 24.1% 15.0%  6.8%  0.3%  0.1%    skip: 1.3%
x264 [info]: mb B  I16..4:  0.5%  9.3%  1.4%  B16..8: 38.5% 22.4%  5.4%  direct:11.6%  skip:10.9%  L0:44.7% L1:37.0% BI:18.4%
x264 [info]: 8x8 transform intra:82.6% inter:76.2%
x264 [info]: direct mvs  spatial:99.9% temporal:0.1%
x264 [info]: coded y,uvDC,uvAC intra: 87.7% 82.0% 46.8% inter: 57.0% 46.4% 6.5%
x264 [info]: i16 v,h,dc,p: 16% 24%  5% 56%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 16%  6%  8% 10% 11% 12% 10% 13%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 13%  3%  8% 12% 12% 12%  9% 11%
x264 [info]: i8c dc,h,v,p: 30% 32% 22% 16%
x264 [info]: Weighted P-Frames: Y:4.2% UV:3.3%
x264 [info]: ref P L0: 53.0% 13.7% 14.7%  6.8%  4.6%  3.6%  3.1%  0.4%  0.0%
x264 [info]: ref B L0: 81.9%  9.8%  4.4%  2.2%  1.2%  0.5%
x264 [info]: ref B L1: 97.0%  3.0%
x264 [info]: kb/s:2622.90
[22:48:19] mux: track 0, 4007 frames, 54792748 bytes, 2620.87 kbps, fifo 1024
[22:48:19] mux: track 1, 5222 frames, 9357603 bytes, 447.60 kbps, fifo 2048
[22:48:19] Finished work at: Sun May 01 22:48:19 2022
[22:48:19] libhb: work result = 0

 # Job Completed!
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Can Handbrake be made to show min&max bitrate in the log?

Post by mduell »

No.

Also, what's the point? So what if there's a momentary spike to some ridiculous bitrate to preserve the image? As long as it's with your playback environments decoding capabilities it's fine.
smu johnson
Posts: 5
Joined: Mon May 02, 2022 5:03 am

Re: Can Handbrake be made to show min&max bitrate in the log?

Post by smu johnson »

That's what I want to know about, if there is some spike. I think having this ability would be handy and not hard at all to program info either x264 or Handbrake, whichever can do it. I suspect it will be x264 though.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Can Handbrake be made to show min&max bitrate in the log?

Post by JohnAStebbins »

If you are worried about spikes causing playback problems, then you should be using encoder "level" or VBV settings to limit such spikes. For example the level used in the activity log you provided (3.0) limits peak bitrate to 10Mbps.

As far as I know, this information is not available from any of the video encoders used by HandBrake.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Can Handbrake be made to show min&max bitrate in the log?

Post by mduell »

smu johnson wrote: Wed May 04, 2022 1:46 am That's what I want to know about, if there is some spike. I think having this ability would be handy and not hard at all to program info either x264 or Handbrake, whichever can do it. I suspect it will be x264 though.
Just pick what level your playback device supports.

If you pull request a patch on github there's a good chance it will be accepted.
Post Reply