Log in

View Full Version : Setting the correct colormatrix in x265?


Forteen88
23rd January 2019, 02:11
Hi, I read this old thread about wheather to set or not set colormatrix-information in x264,
The x264 colormatrix flags don't do anything to the actual video, it's just metadata VUI information that some players might read (the majority don't). It tells the software or hardware player what matrix to use when converting to RGB for display

It's not mandatory, but it doesn't hurt to flag it, so you should always use it (there is no downside to flagging it): usually bt709 for HD, bt601 for SD.
https://forum.videohelp.com/threads/344144-setting-the-correct-colormatrix-in-x264

Nowadays, with more advanced TV:s and standard 10-bit setting on H.265-encoders (with GPU-decode support for that), is it more important now to set colormatrix?

And bt2020nc should be set for 10-bit UHD-reencodes, right?! I'd assume that it's most important to set colormatrix for UHD HDR-reencodes.

EDIT: Thanks excellentswordfight!

excellentswordfight
23rd January 2019, 16:13
Hi, I read this old thread about wheather to set or not set colormatrix-information in x264,

https://forum.videohelp.com/threads/344144-setting-the-correct-colormatrix-in-x264

Nowadays, with more advanced TV:s and standard 10-bit setting on H.265-encoders (with GPU-decode support for that), is it more important now to set colormatrix?

And bt2020nc should be set for 10-bit UHD-reencodes, right?! I'd assume that it's most important to set colormatrix for UHD HDR-reencodes.
Well that depends, there is nothing that says that UHD-video cant be sdr 709. so no, dont blindly set it. And yes, it is more important to pay attention to those flags now. And if the source is HDR you need to set all the relevent flags for it, not just the colormatrix. The safest way is to always set them based on the input you are using.

benwaggoner
23rd January 2019, 21:28
Well that depends, there is nothing that says that UHD-video cant be sdr 709. so no, dont blindly set it. And yes, it is more important to pay attention to those flags now. And if the source is HDR you need to set all the relevent flags for it, not just the colormatrix. The safest way is to always set them based on the input you are using.
There is a lot of UHD Rec.709 content out there. And lots of non-HDR UHD devices to play that content on.

In the modern era, I strongly encourage everyone to set those metadata flags for all content, and set them correctly. The hoops devices run through to try to guess can beggar the mind... 709<>601, so I recommend setting it for SDR content too.

Forteen88
25th January 2019, 16:40
So is there a way to find out the source-video's colormatrix except looking if there's VUI-info about that (viewable in a program like MediaInfo)?
For the Disney short "Presto" Blu-ray, MediaInfo says:
Color range: Limited
Color primaries: BT.709
Transfer characteristics: BT.709
Matrix coefficients: BT.709

On some video-sources MediaInfo got no such info.

EDIT: Thanks nevcairiel. And yeah, to be clear, the 'Presto' Blu-ray I tested was 1080p HD video-source.

nevcairiel
25th January 2019, 16:55
If there is no info in the video bitstream, all you can do is guess. An educated guess in most cases accounting for source, resolution, etc, but a guess nonetheless.

Most HD video is in 99.9% of all cases BT.709 all the way through just like your example. UHD can be either.