Square-like polygon artifacts

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
skalley
New User
Posts: 1
Joined: Mon May 13, 2019 12:54 am

Square-like polygon artifacts

Post by skalley »

Description of problem or question:

Square-like polygon artifacts.

Example: https://i.imgur.com/S1DIehl.jpg


Steps to reproduce the problem (If Applicable):

Using x265 to encode. Pulled the slider down to 18, but still getting them.


HandBrake version (e.g., 1.0.0):

1.1.0


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

Ubuntu 18.10


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

Code: Select all

Handbrake Version: 1.1.0 (2018071900)
[01:32:03] gtkgui: Modified Preset: /Matroska/H.265 MKV 1080p30
[01:32:03] 1 job(s) to process
[01:32:03] json job:
{
    "Audio": {
        "AudioList": [
            {
                "Bitrate": 160,
                "CompressionLevel": -1.0,
                "DRC": 0.0,
                "DitherMethod": "auto",
                "Encoder": "av_aac",
                "Gain": 0.0,
                "Mixdown": "dpl2",
                "NormalizeMixLevel": false,
                "PresetEncoder": "av_aac",
                "Quality": -3.0,
                "Samplerate": 0,
                "Track": 0
            }
        ],
        "CopyMask": [
            "copy:aac"
        ],
        "FallbackEncoder": "av_aac"
    },
    "Destination": {
        "AlignAVStart": false,
        "ChapterList": [
            {
                "Name": "Chapter 1"
            }
        ],
        "ChapterMarkers": false,
        "File": "/data/backup/Glass (2019).mkv",
        "InlineParameterSets": false,
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": false
        },
        "Mux": "mkv"
    },
    "Filters": {
        "FilterList": [
            {
                "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": 4,
                "Settings": {
                    "mode": "7"
                }
            },
            {
                "ID": 6,
                "Settings": {
                    "mode": 2,
                    "rate": "27000000/900000"
                }
            },
            {
                "ID": 11,
                "Settings": {
                    "crop-bottom": 138,
                    "crop-left": 0,
                    "crop-right": 0,
                    "crop-top": 138,
                    "height": 804,
                    "width": 1920
                }
            }
        ]
    },
    "Metadata": {
        "Name": "Glass (2019)"
    },
    "PAR": {
        "Den": 1,
        "Num": 1
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "/data/backup/GLASS/Glass (2019).ts",
        "Range": {
            "End": 1,
            "Start": 1,
            "Type": "chapter"
        },
        "Title": 1
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": true
        },
        "SubtitleList": [
            {
                "Burn": false,
                "Default": false,
                "Forced": false,
                "Offset": 0,
                "Track": 0
            },
            {
                "Burn": false,
                "Default": false,
                "Forced": false,
                "Offset": 0,
                "Track": 1
            }
        ]
    },
    "Video": {
        "ColorMatrixCode": 0,
        "Encoder": "x265",
        "Level": "",
        "Options": "strong-intra-smoothing=0:rect=0",
        "Preset": "slow",
        "Profile": "main",
        "QSV": {
            "AsyncDepth": 4,
            "Decode": false
        },
        "Quality": 18.0,
        "Tune": "",
        "Turbo": false,
        "TwoPass": false
    }
}
[01:32:03] CPU: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
[01:32:03]  - Intel microarchitecture Haswell
[01:32:03]  - logical processor count: 8
[01:32:03] hb_scan: path=/data/backup/GLASS/Glass (2019).ts, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image /data/backup/GLASS/Glass (2019).ts
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[01:32:03] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0
libdvdread: Encrypted DVD support unavailable.
************************************************
**                                            **
**  No css library available. See             **
**  /usr/share/doc/libdvdread4/README.css     **
**  for more information.                     **
**                                            **
************************************************
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
[01:32:03] dvd: not a dvd - trying as a stream/file instead
[01:32:03] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[01:32:03] Found the following PIDS
[01:32:03]     Video PIDS :
[01:32:03]       0x1011 type H.264 (0x1b)
[01:32:03]     Audio PIDS :
[01:32:03]       0x1100 type TrueHD (0x83)
[01:32:03]     Subtitle PIDS :
[01:32:03]       0x1200 type PGS Subtitle (0x90)
[01:32:03]       0x1201 type PGS Subtitle (0x90)
[01:32:03]     Other PIDS :
[01:32:03]       0x1001 type Unknown (0xff) (PCR)
[01:32:03] stream id 0x1100 (type 0x83 substream 0x76) audio 0x761100
[01:32:03] stream id 0x1100 (type 0x83 substream 0x72) audio 0x721100
[01:32:03] stream id 0x1200 (type 0x90 substream 0x0) subtitle 0x1200
[01:32:03] stream id 0x1201 (type 0x90 substream 0x0) subtitle 0x1201
[01:32:03] stream doesn't seem to have video IDR frames
[01:32:03] scan: decoding previews for title 1
[01:32:03] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[01:32:03] scan: audio 0x721100: truehd, rate=48000Hz, bitrate=128000 English (TrueHD) (7.1 ch)
[01:32:03] scan: audio 0x761100: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
[01:32:04] stream: 12 good frames, 0 errors (0%)
[01:32:04] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 138/138/0/0, aspect 16:9, PAR 1:1
[01:32:05] libhb: scan thread found 1 valid title(s)
[01:32:05] starting job
[01:32:05] decomb filter thread started for segment 0
[01:32:05] decomb filter thread started for segment 1
[01:32:05] decomb filter thread started for segment 2
[01:32:05] decomb filter thread started for segment 3
[01:32:05] decomb filter thread started for segment 4
[01:32:05] decomb filter thread started for segment 6
[01:32:05] decomb check thread started for segment 0
[01:32:05] decomb check thread started for segment 1
[01:32:05] decomb check thread started for segment 2
[01:32:05] decomb check thread started for segment 3
[01:32:05] decomb filter thread started for segment 7
[01:32:05] decomb check thread started for segment 4
[01:32:05] decomb check thread started for segment 5
[01:32:05] decomb check thread started for segment 6
[01:32:05] decomb check thread started for segment 7
[01:32:05] mask filter thread started for segment 0
[01:32:05] mask filter thread started for segment 6
[01:32:05] mask filter thread started for segment 2
[01:32:05] mask erode thread started for segment 0
[01:32:05] mask erode thread started for segment 1
[01:32:05] mask filter thread started for segment 5
[01:32:05] mask filter thread started for segment 4
[01:32:05] mask erode thread started for segment 2
[01:32:05] mask filter thread started for segment 1
[01:32:05] mask erode thread started for segment 4
[01:32:05] mask erode thread started for segment 3
[01:32:05] mask filter thread started for segment 3
[01:32:05] mask erode thread started for segment 5
[01:32:05] mask erode thread started for segment 6
[01:32:05] mask filter thread started for segment 7
[01:32:05] mask dilate thread started for segment 0
[01:32:05] mask erode thread started for segment 7
[01:32:05] mask dilate thread started for segment 1
[01:32:05] mask dilate thread started for segment 2
[01:32:05] mask dilate thread started for segment 4
[01:32:05] mask dilate thread started for segment 5
[01:32:05] mask dilate thread started for segment 3
[01:32:05] mask dilate thread started for segment 6
[01:32:05] mask dilate thread started for segment 7
[01:32:05] yadif thread started for segment 1
[01:32:05] yadif thread started for segment 2
[01:32:05] yadif thread started for segment 0
[01:32:05] yadif thread started for segment 4
[01:32:05] yadif thread started for segment 5
[01:32:05] yadif thread started for segment 3
[01:32:05] job configuration:
[01:32:05]  * source
[01:32:05]    + /data/backup/GLASS/Glass (2019).ts
[01:32:05]    + title 1, chapter(s) 1 to 1
[01:32:05]  * destination
[01:32:05]    + /data/backup/Glass (2019).mkv
[01:32:05]    + container: Matroska (libavformat)
[01:32:05]  * video track
[01:32:05]    + decoder: h264
[01:32:05]      + bitrate 200 kbps
[01:32:05]    + filters
[01:32:05]      + 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) [01:32:05]      + Decomb (mode=39)
[01:32:05]      + Framerate Shaper (mode=2:rate=27000000/900000)
[01:32:05]        + frame rate: 23.976 fps -> peak rate limited to 30.000 fps
[01:32:05]      + Crop and Scale (width=1920:height=804:crop-top=138:crop-bottom=138:crop-left=0:crop-right=0)
[01:32:05]        + source: 1920 * 1080, crop (138/138/0/0): 1920 * 804, scale: 1920 * 804
[01:32:05]    + Output geometry
[01:32:05]      + storage dimensions: 1920 x 804
[01:32:05]      + pixel aspect ratio: 1 : 1
[01:32:05]      + display dimensions: 1920 x 804
[01:32:05]    + encoder: H.265 (libx265)
[01:32:05]      + preset:  slow
[01:32:05]      + options: strong-intra-smoothing=0:rect=0
[01:32:05]      + profile: main
[01:32:05]      + quality: 18.00 (RF)
[01:32:05]  * subtitle track 1, English [PGS] (track 0, id 0x1200, Picture) -> Passthrough
[01:32:05]  * subtitle track 2, español [PGS] (track 1, id 0x1201, Picture) -> Passthrough
[01:32:05]  * audio track 1
[01:32:05]    + decoder: English (AC3) (5.1 ch) (track 1, id 0x761100)
[01:32:05]      + bitrate: 448 kbps, samplerate: 48000 Hz
[01:32:05]    + mixdown: Dolby Pro Logic II
[01:32:05]    + encoder: AAC (libavcodec)
[01:32:05]      + bitrate: 160 kbps, samplerate: 48000 Hz
[01:32:05] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[01:32:05] sync: expecting 185029 video frames
[01:32:05] yadif thread started for segment 6
[01:32:05] yadif thread started for segment 7
[01:32:05] decomb filter thread started for segment 5
[01:32:05] encavcodecaInit: Unknown avcodec option stereo_mode
x265 [info]: HEVC encoder version 2.8
x265 [info]: build info [Linux][GCC 7.3.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(13 rows)
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         : star / 57 / 3 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 24 / 240 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 25 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 4 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-18.0 / 0.60
x265 [info]: tools: limit-modes rd=4 psy-rd=2.00 rdoq=2 psy-rdoq=1.00 rskip
x265 [info]: tools: signhide tmvp lslices=4 deblock sao
[01:32:05] sync: first pts video is 0
[01:32:05] sync: first pts audio 0x761100 is 0
[01:33:10] sync: first pts subtitle 0x1200 is 2385386
[01:33:13] sync: first pts subtitle 0x1201 is 2524578
[05:39:11] hb_ts_stream_decode - eof
[05:39:12] reader: done. 1 scr changes
[05:39:19] work: average encoding speed for job is 12.513291 fps
[05:39:20] comb detect: heavy 634 | light 3292 | uncombed 181685 | total 185611
[05:39:20] decomb: deinterlaced 634 | blended 3292 | unfiltered 181685 | total 185611
[05:39:20] vfr: 185611 frames output, 0 dropped and 0 duped for CFR/PFR
[05:39:20] vfr: lost time: 0 (0 frames)
[05:39:20] vfr: gained time: 0 (0 frames) (0 not accounted for)
[05:39:20] stream: 185612 good frames, 0 errors (0%)
[05:39:20] ac3-decoder done: 241923 frames, 0 decoder errors
[05:39:20] h264-decoder done: 185611 frames, 0 decoder errors
[05:39:20] sync: got 185611 frames, 185029 expected
[05:39:20] sync: framerate min 11.987 fps, max 47.974 fps, avg 23.976 fps
[aac @ 0x7f9ddfcb5ac0] Qavg: 279.466
x265 [info]: frame I:   1476, Avg QP:16.19  kb/s: 14727.85
x265 [info]: frame P:  41328, Avg QP:17.24  kb/s: 5217.65
x265 [info]: frame B: 142807, Avg QP:22.24  kb/s: 830.66
x265 [info]: Weighted P-Frames: Y:1.5% UV:1.0%
x265 [info]: consecutive B-frames: 4.5% 2.4% 11.4% 18.5% 63.2%

encoded 185611 frames in 14835.15s (12.51 fps), 1917.98 kb/s, Avg QP:21.08
[05:39:20] mux: track 0, 185611 frames, 1856750095 bytes, 1918.73 kbps, fifo 4096
[05:39:20] mux: track 1, 362885 frames, 155280363 bytes, 160.46 kbps, fifo 8192
[05:39:20] mux: track 2, 3130 frames, 33144774 bytes, 34.25 kbps, fifo 128
[05:39:20] mux: track 3, 2450 frames, 25883503 bytes, 26.75 kbps, fifo 128
[05:39:20] libhb: work result = 0
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Square-like polygon artifacts

Post by Woodstock »

You must have your brightness and contrast set very high to see the artifacts in your sample.

But, there is a tune you can use to allocate more bits to "blackness". I can't remember what it is, but I'm sure someone will pop up with it shortly.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5713
Joined: Sat Feb 09, 2008 7:21 pm

Re: Square-like polygon artifacts

Post by JohnAStebbins »

Woodstock wrote: Mon May 13, 2019 12:53 pm You must have your brightness and contrast set very high to see the artifacts in your sample.

But, there is a tune you can use to allocate more bits to "blackness". I can't remember what it is, but I'm sure someone will pop up with it shortly.
Add 'aq-mode=3' in the 'more settings' box on the video encoder pane. It's the same for both x264 and x265.
https://x265.readthedocs.io/en/default/ ... on-aq-mode
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: Square-like polygon artifacts

Post by rollin_eng »

Also update to the latest version from the approved source.
Post Reply