How can I Encode for Target File Size?

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
LanDao
New User
Posts: 1
Joined: Wed Aug 18, 2021 2:52 pm

How can I Encode for Target File Size?

Post by LanDao »

Description of problem or question:
The problem is I am an idiot.


MY QUESTION:
I want to encode video with a specific file size target, however, I cannot seem to get the app to predict the final size. This is my issue. Is there a way to do this?



Steps to reproduce the problem:
Travel back in time and screw up your childhood by not trying to learn anything.


HandBrake version:
Version 1.4.1 (2021081500)


Operating system and version:
macOS High Sierra 10.13.6 (17G14042)


HandBrake Activity Log ***required*** (see How-to get an activity log)
Imma say this is actually not required because HB is not the problem.

Code: Select all

HandBrake Activity Log for Session: 2021-08-18T06:21:16Z
Handbrake Version: 1.4.1 (2021081500)
The Suicide Squad 2021.mp4
Preset: Fast 1080p30 (Modified)
[02:21:16] Compile-time hardening features are enabled
[02:21:16] hb_init: starting libhb thread
[02:21:16] macgui: fr.handbrake.HandBrakeXPCService scanning specifically for title: 1
[02:21:16] CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
[02:21:16]  - Intel microarchitecture Haswell
[02:21:16]  - logical processor count: 8
[02:21:16] hb_scan: path=/Volumes/6TB/z-COMPLETE/The Suicide Squad 2021.mp4, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:333: failed opening UDF image /Volumes/6TB/z-COMPLETE/The Suicide Squad 2021.mp4
disc.c:437: error opening file BDMV/index.bdmv
disc.c:437: error opening file BDMV/BACKUP/index.bdmv
bluray.c:2646: nav_get_title_list(/Volumes/6TB/z-COMPLETE/The Suicide Squad 2021.mp4/) failed
[02:21:16] bd: not a bd - trying as a stream/file instead
libdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav: vm: vm: failed to read VIDEO_TS.IFO
[02:21:16] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/6TB/z-COMPLETE/The Suicide Squad 2021.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.67.100
  Duration: 02:12:06.66, start: 0.000000, bitrate: 2639 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1008 [SAR 1:1 DAR 40:21], 2250 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 384 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[02:21:16] scan: decoding previews for title 1
[02:21:16] scan: audio 0x1: aac, rate=48000Hz, bitrate=384002 Unknown (AAC LC) (5.1 ch) (384 kbps)
[02:21:17] scan: 10 previews, 1920x1008, 23.976 fps, autocrop = 0/0/0/0, aspect 1.90:1, PAR 1:1, color profile: 1-1-1
[02:21:17] libhb: scan thread found 1 valid title(s)
[02:21:17] macgui: fr.handbrake.HandBrakeXPCService scan done
[02:21:17] macgui: fr.handbrake.HandBrakeXPCService started encoding The Suicide Squad 2021.mp4
[02:21:17] Starting work at: Wed Aug 18 02:21:17 2021

[02:21:17] macgui: fr.handbrake.HandBrakeXPCService with preset Fast 1080p30 (Modified)
[02:21:17] 1 job(s) to process
[02:21:17] Starting Task: Encoding Pass
[02:21:17] Skipping crop/scale filter
[02:21:17] work: only 1 chapter, disabling chapter markers
[02:21:17] job configuration:
[02:21:17]  * source
[02:21:17]    + /Volumes/6TB/z-COMPLETE/The Suicide Squad 2021.mp4
[02:21:17]    + title 1, chapter(s) 1 to 1
[02:21:17]    + container: mov,mp4,m4a,3gp,3g2,mj2
[02:21:17]    + data rate: 2639 kbps
[02:21:17]  * destination
[02:21:17]    + /Volumes/6TB/z-COMPLETE/TELEGRAM/CONVERTED---/The Suicide Squad 2021.mp4
[02:21:17]    + container: MPEG-4 (libavformat)
[02:21:17]      + optimized for HTTP streaming (fast start)
[02:21:17]      + align initial A/V stream timestamps
[02:21:17]  * video track
[02:21:17]    + decoder: h264 8-bit
[02:21:17]      + bitrate 2250 kbps
[02:21:17]    + filters
[02:21:17]      + 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)
[02:21:17]      + Decomb (mode=39)
[02:21:17]      + Framerate Shaper (mode=2:rate=27000000/900000)
[02:21:17]        + frame rate: 23.976 fps -> peak rate limited to 30.000 fps
[02:21:17]    + Output geometry
[02:21:17]      + storage dimensions: 1920 x 1008
[02:21:17]      + pixel aspect ratio: 1 : 1
[02:21:17]      + display dimensions: 1920 x 1008
[02:21:17]    + encoder: H.264 (libx264)
[02:21:17]      + preset:  fast
[02:21:17]      + profile: main
[02:21:17]      + level:   4.0
[02:21:17]      + quality: 22.00 (RF)
[02:21:17]      + color profile: 1-1-1
[02:21:17]  * audio track 1
[02:21:17]    + decoder: Unknown (AAC LC) (5.1 ch) (384 kbps) (track 1, id 0x1)
[02:21:17]      + bitrate: 384 kbps, samplerate: 48000 Hz
[02:21:17]    + mixdown: Stereo
[02:21:17]    + encoder: AAC (Apple AudioToolbox)
[02:21:17]      + bitrate: 160 kbps, samplerate: 48000 Hz
[02:21:17] sync: expecting 190049 video frames
[02:21:17] encx264: min-keyint: 24, keyint: 240
[02:21:17] encx264: encoding at constant RF 22.000000
[02:21:17] encx264: unparsed options: level=4.0:ref=2:8x8dct=0:weightp=1:subme=6:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=30
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile Main, level 4.0, 4:2:0, 8-bit
[02:21:17] sync: first pts video is 0
[02:21:17] sync: "Chapter 1" (1) at frame 1 time 0
[02:21:17] sync: first pts audio 0x1 is 0
[04:03:29] reader: done. 1 scr changes
[04:03:32] work: average encoding speed for job is 30.980671 fps
[04:03:32] comb detect: heavy 4152 | light 7873 | uncombed 178024 | total 190049
[04:03:32] decomb: deinterlaced 4152 | blended 7873 | unfiltered 178024 | total 190049
[04:03:32] vfr: 190049 frames output, 0 dropped and 0 duped for CFR/PFR
[04:03:32] vfr: lost time: 0 (0 frames)
[04:03:32] vfr: gained time: 0 (0 frames) (0 not accounted for)
[04:03:32] aac-decoder done: 371562 frames, 0 decoder errors
[04:03:32] h264-decoder done: 190049 frames, 0 decoder errors
[04:03:32] sync: got 190049 frames, 190049 expected
[04:03:32] sync: framerate min 23.976 fps, max 23.976 fps, avg 23.976 fps
x264 [info]: frame I:3354  Avg QP:16.55  size:108712
x264 [info]: frame P:64484 Avg QP:19.81  size: 32465
x264 [info]: frame B:122211 Avg QP:21.89  size:  9996
x264 [info]: consecutive B-frames:  7.7% 15.9% 11.3% 65.0%
x264 [info]: mb I  I16..4: 44.0%  0.0% 56.0%
x264 [info]: mb P  I16..4: 15.9%  0.0%  7.5%  P16..4: 41.1% 10.0%  4.8%  0.0%  0.0%    skip:20.7%
x264 [info]: mb B  I16..4:  4.2%  0.0%  1.0%  B16..8: 28.5%  4.1%  0.3%  direct: 6.8%  skip:55.3%  L0:44.4% L1:51.0% BI: 4.6%
x264 [info]: coded y,uvDC,uvAC intra: 27.9% 55.8% 10.5% inter: 8.0% 19.4% 0.5%
x264 [info]: i16 v,h,dc,p: 42% 24% 14% 20%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 19% 20%  6%  8%  7%  7%  5%  4%
x264 [info]: i8c dc,h,v,p: 52% 21% 21%  6%
x264 [info]: Weighted P-Frames: Y:2.6% UV:1.7%
x264 [info]: ref P L0: 76.7% 23.3%
x264 [info]: ref B L0: 85.7% 14.3%
x264 [info]: ref B L1: 97.1%  2.9%
x264 [info]: kb/s:3713.71
[04:06:08] mux: track 0, 190049 frames, 3679539637 bytes, 3713.56 kbps, fifo 2048
[04:06:08] mux: track 1, 371565 frames, 162780096 bytes, 164.29 kbps, fifo 4096
[04:06:08] Finished work at: Wed Aug 18 04:06:08 2021

[04:06:08] libhb: work result = 0
rollin_eng
Veteran User
Posts: 4859
Joined: Wed May 04, 2011 11:06 pm

Re: How can I Encode for Target File Size?

Post by rollin_eng »

You will need to calculate the bitrate needed to get the size you want. HB cannot do these calculations for you.

Google for video bitrate calculator and you should get some options.
Post Reply