Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th October 2017, 08:59   #1  |  Link
katzenjoghurt
Registered User
 
Join Date: Feb 2007
Posts: 128
Washed out colors

Hi guys.

Can someone give me a hint why the colors seem to change a bit in my encodings?

Look at the old lady in my attachment... it's subtle but her skin color is a bit less warm in the recoded video.


Changing the colormatrix to 1 (bt709) didn't help.


(Would be happy to provide a link to some image comparison site... but I didn't find one. Let me know if you know of one.)


Original: https://abload.de/img/x_originalh3pww.png
Recode: https://abload.de/img/x_recode8dq57.png


Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L4@Main
Codec ID : V_MPEGH/ISO/HEVC
Duration : 2 min
Bit rate : 2 902 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.058
Stream size : 47.4 MiB (100%)
Writing library : x265 2.5+14-2718cb5dd67f:[Windows][GCC 7.1.0][64 bit] 10bit
Encoding settings : cpuid=1173503 / frame-threads=3 / numa-pools=8 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x1080 / interlace=0 / total-frames=3285 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / no-open-gop / min-keyint=23 / keyint=250 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=6 / scenecut=40 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / no-strong-intra-smoothing / max-merge=2 / limit-refs=3 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / weightp / no-weightb / no-analyze-src-pics / no-deblock / no-sao / no-sao-non-deblock / rd=3 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=4.00 / psy-rdoq=0.00 / no-rd-refine / analysis-reuse-mode=0 / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=24.0 / qcomp=0.80 / qpstep=1 / stats-write=0 / stats-read=0 / ipratio=1.10 / pbratio=1.00 / aq-mode=0 / aq-strength=0.00 / no-cutree / zone-count=0 / no-strict-cbr / qg-size=64 / rc-grain / qpmax=69 / qpmin=0 / const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / opt-qp-pps / opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0
Default : Yes
Forced : No


Another Example:


========================


Original: https://abload.de/img/original22knl.png
Recode: https://abload.de/img/recodeujk9j.png

ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L4@Main
Codec ID : V_MPEGH/ISO/HEVC
Duration : 2 h 14 min
Bit rate : 4 541 kb/s
Width : 1 920 pixels
Height : 824 pixels
Display aspect ratio : 2.35:1
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.120
Stream size : 4.27 GiB (79%)
Writing library : x265 2.5+14-2718cb5dd67f:[Windows][GCC 7.1.0][64 bit] 10bit
Encoding settings : cpuid=1173503 / frame-threads=3 / numa-pools=8 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x824 / interlace=0 / total-frames=193833 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / no-open-gop / min-keyint=23 / keyint=250 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=5 / scenecut=40 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / no-strong-intra-smoothing / max-merge=2 / limit-refs=3 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / weightp / no-weightb / no-analyze-src-pics / no-deblock / no-sao / no-sao-non-deblock / rd=3 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=4.00 / psy-rdoq=0.00 / no-rd-refine / analysis-reuse-mode=0 / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=22.0 / qcomp=0.80 / qpstep=1 / stats-write=0 / stats-read=0 / ipratio=1.10 / pbratio=1.00 / aq-mode=0 / aq-strength=0.00 / no-cutree / zone-count=0 / no-strict-cbr / qg-size=64 / rc-grain / qpmax=69 / qpmin=0 / const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / opt-qp-pps / opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0
Default : Yes
Forced : No

Last edited by katzenjoghurt; 8th October 2017 at 09:59.
katzenjoghurt is offline   Reply With Quote
Old 8th October 2017, 11:09   #2  |  Link
jd17
Registered User
 
Join Date: Jun 2017
Posts: 89
This is nothing to worry about.

Your sources are 8bit and you encode in 10bit.
What you are seeing here is most likely suboptimal 10bit to 8bit dithering of your PC software player.

If you either output the file directly as 10bit or use a player with good 10bit to 8bit dithering, the colors will look just like in the source video.
jd17 is offline   Reply With Quote
Old 8th October 2017, 12:28   #3  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,815
I see nothing wrong between original and reencoded. They are almost identical in terms of luma levels.
Atak_Snajpera is online now   Reply With Quote
Old 8th October 2017, 12:51   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quite possibly a "PC-Levels" vs. "TV-Levels" issue in the playback software (video renderer). What playback software and renderer are you using?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 8th October 2017, 13:15   #5  |  Link
katzenjoghurt
Registered User
 
Join Date: Feb 2007
Posts: 128
Hey. Thanks for your replies!

I used the video comparison tool in StaxRip.
katzenjoghurt is offline   Reply With Quote
Old 8th October 2017, 16:24   #6  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
It looks similar to issue #365 -- you can take a look
https://bitbucket.org/multicoreware/...ding-in-10-bit
Ma is offline   Reply With Quote
Old 8th October 2017, 16:39   #7  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Encode is softer, less noisy (noise in source gives subjectively brighter appearance) and dithered.
raffriff42 is offline   Reply With Quote
Old 8th October 2017, 19:03   #8  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Хай!
Provide samples of the source and encoded files.
Gravitator is offline   Reply With Quote
Old 13th October 2017, 03:14   #9  |  Link
Disturbance
Registered User
 
Join Date: Mar 2007
Posts: 26
Hi, thought I would contribute as I am having the same issue with this and have not found any kind of solution.

Source: https://i.imgur.com/SFKiYx4.png
Recode: https://i.imgur.com/pOOmQlx.png

Source clip: https://www.dropbox.com/s/fc7gydmjui...1080p.mkv?dl=0

Recode clip: https://www.dropbox.com/s/f83u8u459h...1080p.mkv?dl=0

Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5@Main
Codec ID : V_MPEGH/ISO/HEVC
Duration : 7s 132ms
Bit rate : 1 515 Kbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.030
Stream size : 1.29 MiB (98%)
Writing library : x265 2.5+14-2718cb5dd67f:[Windows][GCC 7.1.0][64 bit] 10bit
Encoding settings : cpuid=1050111 / frame-threads=3 / numa-pools=8 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x1080 / interlace=0 / total-frames=171 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=6 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / no-open-gop / min-keyint=23 / keyint=250 / bframes=8 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=40 / lookahead-slices=4 / scenecut=45 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=2 / tu-intra-depth=2 / limit-tu=4 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / no-strong-intra-smoothing / max-merge=3 / limit-refs=3 / limit-modes / me=3 / subme=5 / merange=57 / temporal-mvp / weightp / weightb / no-analyze-src-pics / deblock=-1:-1 / no-sao / no-sao-non-deblock / rd=5 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=0.60 / psy-rdoq=1.00 / no-rd-refine / analysis-reuse-mode=0 / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=16.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=3 / aq-strength=0.70 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=1 / transfer=1 / colormatrix=1 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / opt-qp-pps / opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

In the Recode it seems to make browns turn more green (see the door in the frames I linked). I have tried encoding in 8bit and 10bit, even using x264 has the same effect. Would anyone have any idea on how to prevent it?

Last edited by Disturbance; 13th October 2017 at 03:17.
Disturbance is offline   Reply With Quote
Old 13th October 2017, 08:24   #10  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
Quote:
Originally Posted by Disturbance View Post
Hi, thought I would contribute as I am having the same issue with this and have not found any kind of solution.
There are 2 reasons of greener, darker and with pattern movies:

1) If you encode from high bit depth source and in MeGUI there is a line
LWLibavVideoSource("F:\speed\los\ks10.mkv", format="YUV420P8")

2) If you want to watch encoded movie and you use MeGUI with line like above.

1) is danger -- the green is really encoded, 2) is not danger -- you only see green on preview window. If you have 1) and 2) -- the green effect is doubled.

SOLUTION (only to 1)
Remember your source movie bit depth (10 for example).
In 'AVS Script Creator' delete the part ', format="YUV420P8"' from LWLibavVideoSource line -- in preview you should see double width green ugliness with stripes (don't care).
In x265 option (Encoder settings -> Config -> Misc) add '--input-depth 10' option in Custom Command Line box.
Encode.
Ma is offline   Reply With Quote
Old 18th October 2017, 04:50   #11  |  Link
KanarazuKatsu
Registered User
 
Join Date: Oct 2017
Posts: 25
Quote:
Originally Posted by Ma View Post
In x265 option (Encoder settings -> Config -> Misc) add '--input-depth 10' option in Custom Command Line box.
Encode.
I've tried using the "--input-depth 10" argument with x265 CLI and the estimated time to encode goes to like 2 hours (from 20 minutes if I was encoding regularly), and also, the size output is the huge, like the episode's size itself.

I've tried "--output-depth 10" as well, but it's the same result as the people who have been encoding as well (slightly darker images/loss of colour). Note: Putting this line is useless if your x265 build is already running on 10-bits, but I tested this out regardless.

Anyone else have any clues as to what to do to get the colours pretty much close to the source without the colour having to be "washed out", "dimmed", "turning cold from warm colours of source"?

Thanks!
KanarazuKatsu is offline   Reply With Quote
Old 18th October 2017, 10:53   #12  |  Link
Arhu
Registered User
 
Join Date: Nov 2003
Posts: 12
Quote:
Originally Posted by Ma View Post
It looks similar to issue #365 -- you can take a look
https://bitbucket.org/multicoreware/...ding-in-10-bit
I'm fairly sure it's the same issue. Any news on the ffmpeg dither_macro fix, by the way?


The source file is named 8 bit but mediainfo says it's actually 10 bit. If you re-encode 10 bit to 10 bit, for some reason (inaccurate or false) dithering is applied (ffmpeg issue). Ma proposed a patch to the ffmpeg bug list but I'm not sure what the status is. He also provided a compiled patched ffmpeg version for x64 Windows that worked for me when re-encoding from 10 to 10 bit. It doesn't come with some audio libs like Opus, unfortunately.

When you actually encode from 8 bit to 10 bit I believe you don't have to worry. If you see washed out or greenish colors, e.g. in the StaxRip video comparison tool, I'm relatively sure it's just a display issue like others said in this thread, i.e. when the false or "suboptimal" dithering is applied to the 10 bit source to display on an 8 bit monitor. Colors look fine to me in MPC with MadVR.

In short, from what I gathered:
- re-encoding 10 bit sources to 10 bit is buggy -- use Ma's patched ffmpeg version
- encoding to 10 bit from an 8 bit source is actually fine but may look buggy in StaxRip or maybe others (decoding issue)

Last edited by Arhu; 18th October 2017 at 11:08.
Arhu is offline   Reply With Quote
Old 18th October 2017, 17:38   #13  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
Quote:
Originally Posted by Arhu View Post
I'm fairly sure it's the same issue. Any news on the ffmpeg dither_macro fix, by the way?
Now the patch is bigger -- different code for full range, updated fate tests.

Patch in ffmpeg-devel mailing list https://lists.ffmpeg.org/pipermail/f...er/217462.html
Patch in ffmpeg-patchwork https://patchwork.ffmpeg.org/patch/5440/

Unfortunately ffmpeg team is bored with this and no one is answering. I've compiled ffmpeg with this patch and https://patchwork.ffmpeg.org/patch/5452/ (and libx265) -- it passed fate tests, if someone wants to test compiled binary -- www.msystem.waw.pl/x265/patched.7z
Ma is offline   Reply With Quote
Old 18th October 2017, 18:30   #14  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
it apply dithering even using pix_fmt for input and output? even with -sws_dither none?
__________________
powered by Google Translator
Motenai Yoda is offline   Reply With Quote
Old 18th October 2017, 19:50   #15  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
Quote:
Originally Posted by Motenai Yoda View Post
it apply dithering even using pix_fmt for input and output? even with -sws_dither none?
Yes, for planar YUV or gray (16 >= source bit depth > destination bit depth >= 8). It is ffmpeg behavior, it is not changed by the patch.
Ma is offline   Reply With Quote
Old 18th October 2017, 20:22   #16  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
I can't reproduce it with ffms2 in vaporsynth => x265 . YUV420P10 in and out. fms2-2.23.1-msvc

Post exactly how you are encountering this bug, is it though avisynth ffms2 ? lsmash ?
poisondeathray is offline   Reply With Quote
Old 18th October 2017, 22:12   #17  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
I can't open 10 bit depth source in MeGUI with ffms2 indexer. The error is:
Your AviSynth clip has the following problem:
Error in AviSynth script:
ConvertToRGB24: conversion is allowed only from 8 bit colorspace
Continue anyway?

How in MeGUI encode a file from 10 bit depth source with ffms2 indexer?
Ma is offline   Reply With Quote
Old 18th October 2017, 22:27   #18  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
Quote:
Originally Posted by Ma View Post
I can't open 10 bit depth source in MeGUI with ffms2 indexer. The error is:
Your AviSynth clip has the following problem:
Error in AviSynth script:
ConvertToRGB24: conversion is allowed only from 8 bit colorspace
Continue anyway?

How in MeGUI encode a file from 10 bit depth source with ffms2 indexer?
Maybe the problem is that version of ffms2 or you're not using avisynth+ which supports additional pixel formats. Or problem with script. Or problem with megui

ffms2 works in avisynth+ too (piped to x265, --lossless), identical output to input, verified with several methods
poisondeathray is offline   Reply With Quote
Old 18th October 2017, 22:41   #19  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
even ffmpeg direct decode, pipe to x265 (again YUV420P10 in , YUV420P10 out, full 10bit) , works, lossless confirmed

So 10bit to 10bit works fine . I think people having problems were introducing a 8bit step in between or improperly converting it

8bit to 10bit depends on how you do the conversion. If you dither, or not, or what kind of dithering. For example, "grid" would suggest ordered dither or pattern dither.
poisondeathray is offline   Reply With Quote
Old 18th October 2017, 22:42   #20  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Quote:
Originally Posted by Ma View Post
Error in AviSynth script:
ConvertToRGB24: conversion is allowed only from 8 bit colorspace
Try this.
Code:
ConvertToPlanarRGB(matrix="Rec709") ## etc
ConvertBits(8) # , dither=0) ## dither optional
ConvertToRGB24
raffriff42 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.