Selur's Little Message Board

Full Version: x264 colormatrix option changes when "Overwrite input type scan" is enabled
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
They are all related.
If the scan order is wrong at the input it will keep wrong,...
It also would help if you would tell me if you did use the last version I send you (2020.09.25-162327) or not, because without that info looking at the debug output simply makes no sense,...
-> if you did not use the latest link I send you please try with that version
I just checked some code and fir DVDs BT709 is hardcoded,... I wonder why I did that and fi this is right.
Okay that is because of:
Quote: Rec.709 should be used when your source is DVD or HDTV:

ConvertToRGB(clip, matrix="Rec709")
source: http://avisynth.nl/index.php/Convert

and with the latest version I send you I get:
Code:
#  color sampling YV12@8, matrix: bt709, scantyp: top field first, luminance scale: limited
DGSource(dgi="E:\Temp\33a4134ec610d7c97632e7af70d7ca2a_853323747.dgi",fieldop=2)
# current resolution: 720x576
# deinterlacing
AssumeTFF()
QTGMC(Preset="Fast", ediThreads=2)
SelectEven()
# filtering
# color modifications
ConvertToRGB(interlaced=false, matrix="Rec709")
RGBAdjust(1.00,1.00,1.00,1.00,0.00,0.00,0.00,0.00,analyze=false,dither=false)
# adjust color to YV12
ConvertToYV12(matrix="Rec709")
PreFetch(8)
return last
-> Rec.709 is used consistently

Since you stated:
Quote: it incorrectly uses a Rec709 ConvertToRGB matrix:
-> where do you get that Rec.709 is wrong?
Looking at the debug output,...
Your are not using DVD input, you are opening mpg files,...
You wrote you were opening a DVD,.. wtf!?


=> Okay, let's start anew.

Please use the latest(2020.09.25-162327) dev version I send you a link to, describe properly what you are doing, what you think is going wrong and share a debug output that matches your description.
-> I'll make a new dev version and send you a link.
send you a link, took me a while to see the main problem: MediaInfo seems to sometimes use different strings to indicate the color matrix. ;(
Sorry, I had to leave for an hour.

Sorry if I confused you. I said,

Quote:I open a mpg muxed DVD (no re-encoding),

DVD was ripped, VOB's were muxed to mpg file using ffmpeg, with video only and no re-encoding:

Code:
ffmpeg -fflags +genpts -i "concat:VTS_01_1.VOB|VTS_01_2.VOB|VTS_01_3.VOB|VTS_01_4.VOB" -vcodec copy -an video.mpg

Ffmpeg copies tags from the VOB's into the mpg.

It was my understanding that DVD's were supposed to be 601, HD is 709. I guess I have that wrong? I have quite a few DVD's that show 601 with MediaInfo. The particular one I made the log files with doesn't have anything regarding color matrix. (I thought that meant it should be assumed to be 601.) I have no idea where I got that info now.. it's just something I thought I had correct which I apparently do not. I'm very sorry for my lack of understanding this.

Regardless, here is how the current dev version behaves. (I am now using the latest dev version you sent: 2020.09.25-162327.)

When I load the muxed DVD mpg file, it shows on the x264 tab as bt709 for -colormatrix from the start. It also has the issue when turning on RGBAdjust, the input conversion matrix to RGB is set as Rec709, and the output conversion matrix to YV12 is set as Rec601.

When I reload the same mpg file, now the x264 tab has bt470bg for -colormatrix, and RGBAdjust has the input conversion matrix to RGB as Rec601, and the output conversion matrix to YV12 as Rec601.

Here's the log for all of the above, including the initial file load, then the reload.

[attachment=1044]

I can see you now *just* sent another dev version, so I'll try that one now! Blush
okay, try the last one and I'll look at the output of that test. Smile
I guess it was this Wikipedia article that lead me to believe 601 is for DVD or Standard definition:

https://en.wikipedia.org/wiki/Rec._601

While it doesn't specifically say anything about DVD's, it says it is the standard for ISO/IEC MPEG (which is what DVD uses), and the bottom of the article for "See Also" says Rec709 is for HDTV and Rec2020 is for UHDTV.

So I guess my question is, if a DVD doesn't have any color space tags, should it be assumed to be 601 (470), or 709?

-----

The dev version you sent (2020.09.25-195552) shows Rec601 on RGBAdjust for both input and output now on first load and on reload.

On the x264 tab, it shows bt709 for -colormatrix on first load, then changes to bt470bg on reload.

Comment in AviSynth script says on both first load and reload:

Code:
#  color sampling YV12@8, matrix: bt470, scantyp: top field first, luminance scale: limited

Still not sure if DVD should be 709 or 601! Undecided

Log: [attachment=1045]
Quote:is the standard for ISO/IEC MPEG (which is what DVD uses)
not so sure about that,..
DVD often has special rules that differ from normal MPEG containers, which is why repacking into mpeg often isn't the brightest idea. Wink
see also: http://avisynth.nl/index.php/Colorimetry#DVD.2FMPEG-2

Quote:So I guess my question is, if a DVD doesn't have any color space tags, should it be assumed to be 601, or 709?
Nope, DVDs have no color space tags at least none MediaInfo/MPlayer/FFmpeg know of and report.

-> looking into checking out what changes on the reload,..
Okay, think I found it.
-> will send you a new link for testing in ~ 1/2 hr

Cu Selur
Pages: 1 2 3