Odd scaling result from 'very fast 720p30'

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
StringTheory
Posts: 9
Joined: Mon Feb 01, 2016 1:17 pm

Odd scaling result from 'very fast 720p30'

Post by StringTheory »

Description of problem or question:

I've been trying out the 'very fast 720p30' preset on Handbrake (1.3.3) for
scaling down some tutorial videos. Even if original files are in 1280 x 720
format, re-rendering often reduces file sizes substantially. For the most
part, everything seems to be working as expected. But...

One set of source videos is already 1280 x 720, but Handbrake's Very Fast
720p30 generates files with odd horizontal dimensions. They are still 720
high but widths vary considerably.

I suspect this may be some misinterpretation of the aspect ratio of the
original file, but I don't see any change in aspect between the source
files and rendered files.

VLC shows the source files as H264 - MPEG-4 AVC (part 10) (avc1)
Video res: 1280x720, 29.998058 frame rate.

Any ideas?


Steps to reproduce the problem (If Applicable):

n.a.


HandBrake version (e.g., 1.0.0):

1.3.3


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

Win 7/10


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

n.a.
Don't have relevant log file on hand, but this may be a known problem.

Code: Select all

Please replace this text with the contents of your log file between the two code tags - OR -  provide a pastebin URL in place of these 3 lines.
If you are unable to do so, please state why so we can help you.
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: Odd scaling result from 'very fast 720p30'

Post by rollin_eng »

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

https://handbrake.fr/docs/en/latest/hel ... y-log.html
StringTheory
Posts: 9
Joined: Mon Feb 01, 2016 1:17 pm

Re: Odd scaling result from 'very fast 720p30'

Post by StringTheory »

Log file is below. The source file was 1280x720, but rendering with "very fast 720p30" present
resulted in an output file with dims: 1266x716. One of the other files in the same set was
rendered correctly from 1280x720 to 1280x720. I see no difference between the two source
files.

I originally thought that this could be a result of some internal aspect ratio setting, but I'm
doubting this now. Perhaps someone can shed some light.

Maybe I need to create a preset that either hard-codes 1280x720, or preserves the original
dimensions. But I'm not sure that would render as fast or as well as the 'very fast' preset.
That would also be worthwhile to know, if anyone has opinions.

Code: Select all

HandBrake 1.3.3 (2020061300)
OS: Microsoft Windows NT 6.1.7601 Service Pack 1
CPU: Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz
Ram: 32613 MB, 
GPU Information:
  Intel(R) HD Graphics 4600 - 10.18.14.4264
Screen: 1920x1200
Temp Dir: C:\Users\M\AppData\Local\Temp\
Install Dir: C:\Program Files\Handbrake
Data Dir: C:\Users\M\AppData\Roaming\HandBrake

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


# Starting Encode ...

[09:55:06] base preset: Very Fast 720p30
[21:55:06] hb_init: starting libhb thread
[21:55:06] Starting work at: Wed Oct 21 21:55:06 2020
[21:55:06] 1 job(s) to process
[21:55:06] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 160,
        "DRC": 0.0,
        "Encoder": "av_aac",
        "Gain": 0.0,
        "Mixdown": 4,
        "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"
    ],
    "FallbackEncoder": "ac3"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": true,
    "File": "Y:\\Handbrake_Output\\_mu 02-01 What is Perseval's Identity of Fourier Series where and why we use it.mp4",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": "av_mp4"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 4,
        "Settings": {
          "mode": "7"
        }
      },
      {
        "ID": 3,
        "Settings": {
          "block-height": "16",
          "block-thresh": "80",
          "block-width": "16",
          "filter-mode": "1",
          "mode": "0",
          "motion-thresh": "2",
          "spatial-metric": "2",
          "spatial-thresh": "3"
        }
      },
      {
        "ID": 12,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "8",
          "crop-right": "6",
          "crop-top": "4",
          "height": "716",
          "width": "1266"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "2",
          "rate": "27000000/900000"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 2,
    "Path": "X:\\_Tutorials_Math\\Udemy - Advanced Calculus of Higher Math [Fourier, Z-Xfms] [Moein Ud Din] [IN PROCESS]\\_mu 02-01 What is Perseval's Identity of Fourier Series where and why we use it.mp4"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "x264",
    "Level": "3.1",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "veryfast",
    "Profile": "main",
    "Quality": 23.0,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[21:55:06] CPU: Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz
[21:55:06]  - Intel microarchitecture Haswell
[21:55:06]  - logical processor count: 4
[21:55:06] Intel Quick Sync Video support: yes
[21:55:06]  - Intel Media SDK hardware: API 1.16 (minimum: 1.3)
[21:55:06]  - H.264 encoder: yes
[21:55:06]     - preferred implementation: hardware (any) via D3D11
[21:55:06]     - capabilities (hardware):  breftype vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[21:55:06]  - H.265 encoder: no
[21:55:06] hb_scan: path=X:\_Tutorials_Math\Udemy - Advanced Calculus of Higher Math [Fourier, Z-Xfms] [Moein Ud Din] [IN PROCESS]\_mu 02-01 What is Perseval's Identity of Fourier Series where and why we use it.mp4, title_index=2
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image X:\_Tutorials_Math\Udemy - Advanced Calculus of Higher Math [Fourier, Z-Xfms] [Moein Ud Din] [IN PROCESS]\_mu 02-01 What is Perseval's Identity of Fourier Series where and why we use it.mp4
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
src/libbluray/bluray.c:2585: nav_get_title_list(X:\_Tutorials_Math\Udemy - Advanced Calculus of Higher Math [Fourier, Z-Xfms] [Moein Ud Din] [IN PROCESS]\_mu 02-01 What is Perseval's Identity of Fourier Series where and why we use it.mp4\) failed
[21:55:06] 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
[21:55:06] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'X:\_Tutorials_Math\Udemy - Advanced Calculus of Higher Math [Fourier, Z-Xfms] [Moein Ud Din] [IN PROCESS]\_mu 02-01 What is Perseval's Identity of Fourier Series where and why we use it.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.12.100
  Duration: 00:01:50.27, start: 0.000000, bitrate: 1288 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1151 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
[21:55:06] scan: decoding previews for title 2
[21:55:06] scan: audio 0x1: aac, rate=48000Hz, bitrate=128005 Unknown (AAC LC) (2.0 ch) (128 kbps)
[21:55:07] scan: 10 previews, 1280x720, 30.000 fps, autocrop = 4/0/8/6, aspect 16:9, PAR 1:1
[21:55:07] scan: supported video decoders: avcodec qsv
[21:55:07] libhb: scan thread found 1 valid title(s)
[21:55:07] Skipping subtitle scan.  No suitable subtitle tracks.
[21:55:07] Starting Task: Encoding Pass
[21:55:07] work: only 1 chapter, disabling chapter markers
[21:55:07] job configuration:
[21:55:07]  * source
[21:55:07]    + X:\_Tutorials_Math\Udemy - Advanced Calculus of Higher Math [Fourier, Z-Xfms] [Moein Ud Din] [IN PROCESS]\_mu 02-01 What is Perseval's Identity of Fourier Series where and why we use it.mp4
[21:55:07]    + title 2, chapter(s) 1 to 1
[21:55:07]    + container: mov,mp4,m4a,3gp,3g2,mj2
[21:55:07]    + data rate: 1288 kbps
[21:55:07]  * destination
[21:55:07]    + Y:\Handbrake_Output\_mu 02-01 What is Perseval's Identity of Fourier Series where and why we use it.mp4
[21:55:07]    + container: MPEG-4 (libavformat)
[21:55:07]      + align initial A/V stream timestamps
[21:55:07]  * video track
[21:55:07]    + decoder: h264
[21:55:07]      + bitrate 1151 kbps
[21:55:07]    + filters
[21:55:07]      + Comb Detect (mode=0:spatial-metric=2:motion-thresh=2:spatial-thresh=3:filter-mode=1:block-thresh=80:block-width=16:block-height=16)
[21:55:07]      + Decomb (mode=39)
[21:55:07]      + Framerate Shaper (mode=2:rate=27000000/900000)
[21:55:07]        + frame rate: 30.000 fps -> peak rate limited to 30.000 fps
[21:55:07]      + Crop and Scale (width=1266:height=716:crop-top=4:crop-bottom=0:crop-left=8:crop-right=6)
[21:55:07]        + source: 1280 * 720, crop (4/0/8/6): 1266 * 716, scale: 1266 * 716
[21:55:07]    + Output geometry
[21:55:07]      + storage dimensions: 1266 x 716
[21:55:07]      + pixel aspect ratio: 1 : 1
[21:55:07]      + display dimensions: 1266 x 716
[21:55:07]    + encoder: H.264 (libx264)
[21:55:07]      + preset:  veryfast
[21:55:07]      + profile: main
[21:55:07]      + level:   3.1
[21:55:07]      + quality: 23.00 (RF)
[21:55:07]      + color profile: 1-1-1
[21:55:07]  * audio track 1
[21:55:07]    + decoder: Unknown (AAC LC) (2.0 ch) (128 kbps) (track 1, id 0x1)
[21:55:07]      + bitrate: 128 kbps, samplerate: 48000 Hz
[21:55:07]    + mixdown: Stereo
[21:55:07]    + dither: none
[21:55:07]    + encoder: AAC (libavcodec)
[21:55:07]      + bitrate: 160 kbps, samplerate: 48000 Hz
[21:55:07] sync: expecting 3308 video frames
[21:55:07] encx264: min-keyint: 30, keyint: 300
[21:55:07] encx264: encoding at constant RF 23.000000
[21:55:07] encx264: unparsed options: level=3.1:ref=1:8x8dct=0:weightp=1:subme=2:mixed-refs=0:trellis=0:vbv-bufsize=14000:vbv-maxrate=14000: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 Main, level 3.1, 4:2:0, 8-bit
[21:55:07] sync: first pts video is 0
[21:55:07] sync: "Chapter 1" (1) at frame 1 time 0
[21:55:07] sync: first pts audio 0x1 is 0
[21:55:23] reader: done. 1 scr changes
[21:55:23] work: average encoding speed for job is 201.984863 fps
[21:55:23] comb detect: heavy 0 | light 0 | uncombed 3308 | total 3308
[21:55:23] decomb: deinterlaced 0 | blended 0 | unfiltered 3308 | total 3308
[21:55:23] vfr: 3308 frames output, 0 dropped and 0 duped for CFR/PFR
[21:55:23] vfr: lost time: 0 (0 frames)
[21:55:23] vfr: gained time: 0 (0 frames) (0 not accounted for)
[21:55:23] aac-decoder done: 5166 frames, 0 decoder errors
[21:55:23] h264-decoder done: 3308 frames, 0 decoder errors
[21:55:23] sync: got 3308 frames, 3308 expected
[21:55:23] sync: framerate min 30.000 fps, max 30.000 fps, avg 30.000 fps
x264 [info]: frame I:12    Avg QP:13.33  size: 35893
x264 [info]: frame P:978   Avg QP:15.86  size:   345
x264 [info]: frame B:2318  Avg QP:15.83  size:    87
x264 [info]: consecutive B-frames:  1.8% 13.4%  3.1% 81.7%
x264 [info]: mb I  I16..4: 73.0%  0.0% 27.0%
x264 [info]: mb P  I16..4:  2.6%  0.0%  0.2%  P16..4:  0.3%  0.1%  0.0%  0.0%  0.0%    skip:96.8%
x264 [info]: mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.2%  0.0%  0.0%  direct: 0.2%  skip:99.5%  L0:39.4% L1:59.7% BI: 0.9%
x264 [info]: coded y,uvDC,uvAC intra: 11.5% 16.1% 13.1% inter: 0.0% 0.2% 0.0%
x264 [info]: i16 v,h,dc,p: 71% 28%  1%  0%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 18% 19%  5%  4%  5%  4%  6%  4%
x264 [info]: i8c dc,h,v,p: 61% 29%  8%  1%
x264 [info]: Weighted P-Frames: Y:0.1% UV:0.0%
x264 [info]: kb/s:70.42
[21:55:23] mux: track 0, 3308 frames, 970189 bytes, 70.37 kbps, fifo 4096
[21:55:23] mux: track 1, 5167 frames, 2274486 bytes, 164.97 kbps, fifo 8192
[21:55:23] Finished work at: Wed Oct 21 21:55:23 2020
[21:55:23] libhb: work result = 0

# Encode Completed ...


Deleted User 13735

Re: Odd scaling result from 'very fast 720p30'

Post by Deleted User 13735 »

Turn Auto Cropping to "Manual" and set four values to "0"
We think this is pretty obvious.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Odd scaling result from 'very fast 720p30'

Post by mduell »

Code: Select all

[21:55:07] scan: 10 previews, 1280x720, 30.000 fps, autocrop = 4/0/8/6, aspect 16:9, PAR 1:1

[21:55:07]        + source: 1280 * 720, crop (4/0/8/6): 1266 * 716, scale: 1266 * 716
Your video had black bars on the sides detected by HB, you configured HB to crop those off, and so it did.
StringTheory
Posts: 9
Joined: Mon Feb 01, 2016 1:17 pm

Re: Odd scaling result from 'very fast 720p30'

Post by StringTheory »

That makes sense, but I did nothing to configure that option, so it must be a default. I don't edit video files or use Handbrake very often, so the logic in setting that as a default was not at all obvious or intuitive to me. In fact, creating a new preset with 'use source res' also seems to set cropping, perhaps due to pulling settings from the current default.

I suppose that in some ways, my original guess about aspect ratio was correct.

As far as 'We think this is pretty obvious.': Everything is obvious to someone. A question about electronics, DSP, or molecular biology may be obvious to me, but maybe not everyone else...? In this case, I can understand the reasoning for the option, but not the finer points of the end result or why it would be a default setting. I would have thought it would be better to stay with a standard 1280x720 resolution for a 720p preset.

I do appreciate the replies.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Odd scaling result from 'very fast 720p30'

Post by mduell »

It's been the default for more than a decade.

Black edges are useless (players can easily add black padding if you want it) and expensive (in terms of bits needed to cleanly encode) to maintain, so HB defaults to cropping them off.
Deleted User 13735

Re: Odd scaling result from 'very fast 720p30'

Post by Deleted User 13735 »

Yes, Auto Crop is on by default. Your missive about such :shock: unobvious things gave me a chuckle. I don't know how much more "in your face" it could ever be.
Post Reply