-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add --chromaloc 2 to x265 parameters automatically if source is 4.2:0 (Type 2) #190
Comments
Never heard of that before actually. Know of any example sources that have type 2 chroma? Would need to find out how that is displayed via If you happen to have one, would appreciate output of:
|
Most UHD BR's (if not all) with HDR should have it, but I have some sample clips myself as well. Type 2 does not have anything chromaloc related present in JSON. But, when you don't specify it as x265-param and use Defaults, this row appears on HEVC stream. In mediainfo, it shows like this: |
Some documentation https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.Sup19-201910-I!!PDF-E&type=items To follow BT.2020 specifications, it seems to be, kind of required, if Color Space is YUV (YCbCr) a.k.a TV color. 😄 |
My current assumption is, that it should be always used, when dealing with WCG/HDR content and YUV. At least all of my 10-bit HDR sample files (except one) have Type 2 specified. |
Thanks for the details! Luckily it does display in ffprobe: And you are correct that it seems a movies encoded with FastFlix without that does switch it from https://x265.readthedocs.io/en/3.1/cli.html says to refer to the HEVC specification to find what the 5 possible options mean, did a quick search through https://www.itu.int/rec/T-REC-H.265-201911-I/en without much luck, would like to get them all defined for future proofing. |
For me Type 2, does not seem to reflect anything in ffprobe output, at least BR's which I checked have nothing in that output. You are probably right, that nothing uses it at the moment, as my AndroidTV does not seem to care. I think best way to understand, how it is actually reflected in ffprobe, would be to encode 6 sample files, with chromaloc flag 0...5 and one without that flag and then compare outputs. |
@cdgriffith BTW all HEVC possible chroma locations are described here: On page 384, Figure E.1 TL;DR: They are basically: left, center, top_left, top, bottom_left, bottom |
You know, I felt so smart going and brute forcing it just like that, and was coming back to report the results and you already posted the idea 😭
|
And now, checkbox would be nice "Preserve Chroma location", checked by default for HDR and inserting chromaloc=X as last element into x265-params 😄 Too bad, I suck on python...maybe I could rewrite it in C# (kidding) 😋 |
I think it's safe to just always insert it if the incoming source provides a chroma_location. My only wonder now is if doing the remove_hdr process changes the chroma_location..hmm.. |
That is an interesting question indeed. AFAIK, you cannot remove HDR and keep BT.2020 😉 EDIT: Mkay, you actually (technically) can...wondering, what is the point of having BT.2020 on SDR. |
Currently it does take it down to bt709, so hopefully just always setting / leaving it at 0 is proper for that. Filter used:
|
As 0 seems to be default as well, I don't think it would cause an issue. |
I hope not, and just did some test encodes with Handbrake to see how they handled it, they seem to ignore it entirely as well (everything comes out 0). I'm still planning on adding the passthrough, just glad I'm not the only one who missed the memo 😉 |
As I stated at the beginning, I'm quite unsure how much it actually matters in real life, but it seemed to violate the spec, Even checked couple of encodes (of UHD BR's I own) on torrent sites, to see how famous scene groups handle it. AFAIK, Handbrake cannot handle HDR properly, their internal pipeline is 8-bit only, so I would not pick them as reference. |
Anyway, I think we can close this now. |
I just like to keep these open until actually released to keep track of progress, thanks again for all the info! |
* Adding #109 NVENC HEVC support based on FFmpeg * Adding NVEenC encoder for HEVC and AVC * Adding #166 More robust queue that is recoverable * Adding ability to extract HDR10+ metadata if hdr10plus_parser is detected on path * Adding #178 selector for number of autocrop positions throughout video (thanks to bmcassagne) * Adding Windows 10 notification for queue complete success * Adding #194 fast two pass encoding (thanks to Ugurtan) * Fixing German translations (thanks to SMESH) * Fixing #171 Be able to select encoder before selecting video * Fixing #176 Unable to change queue order or delete task from queue since 4.1.0 (thanks to Etz) * Fixing #185 need to specify channel layout when downmixing (thanks to Ugurtan) * Fixing #187 cleaning up partial download of FFmpeg (thanks to Todd Wilkinson) * Fixing #190 add missing chromaloc parameter for x265 (thanks to Etz) * Fixing that returning item back from queue of a different encoder type would crash Fastflix * Fixing HDR10 details to be track specific (thanks to Harybo)
* Adding #109 NVENC HEVC support based on FFmpeg (thanks to Zeid164) * Adding NVEenC encoder for HEVC and AVC * Adding #166 More robust queue that is recoverable * Adding ability to extract HDR10+ metadata if hdr10plus_parser is detected on path * Adding #178 selector for number of autocrop positions throughout video (thanks to bmcassagne) * Adding Windows 10 notification for queue complete success * Adding #194 fast two pass encoding (thanks to Ugurtan) * Adding Confirm dialogue for cancel encode and replace currently working on video * Changing AVC defaults and recommendations for CRF to higher values * Changing VP9 to default to mkv instead of webm format to support more audio codecs * Fixing German translations (thanks to SMESH) * Fixing #171 Be able to select encoder before selecting video * Fixing #176 Unable to change queue order or delete task from queue since 4.1.0 (thanks to Etz) * Fixing #185 need to specify channel layout when downmixing (thanks to Ugurtan) * Fixing #187 cleaning up partial download of FFmpeg (thanks to Todd Wilkinson) * Fixing #190 add missing chromaloc parameter for x265 (thanks to Etz) * Fixing #209 Double spaces were removed in incoming filenames, causing no file found (thanks to stilicrafter) * Fixing that deinterlace detection could crash program due to CPython bug issue #43423 (thanks to macx) * Fixing that returning item back from queue of a different encoder type would crash Fastflix * Fixing HDR10 details to be track specific (thanks to Harybo) * Fixing returning from queue works with duplicated audio tracks Co-authored-by: SMESH <4199206+smesh109@users.noreply.github.com> Co-authored-by: TGMais <2453844+tgmais@users.noreply.github.com>
Fixed in 4.2.0 https://github.com/cdgriffith/FastFlix/releases/tag/4.2.0 |
I don't fully follow, do you have an example? |
A bit unsure on this, if it is even required, some sources say it is definitely required if you want to retain HDR, others say it is optional.
Maybe @cdgriffith can comment on this (you wrote terrific article on HDR encoding after all) and if needed, could implement it?
The text was updated successfully, but these errors were encountered: