Problem: same settings, different color output

ProjectEli

New Member

Description of problem​

I have problems with shifted colors in local recording.
Despite of many hours of digging this problem, I couldn't get correct color. My recent result is as below.

Tested image: Rtings chroma test pattern ( https://www.rtings.com/tv/learn/chroma-subsampling )

Recording environment: Windows 10 Edu + AMD Ryzen 5600X + NVIDIA RTX 3050
Detailed info(dxdiag data): see attached DxDiag.txt

Recording setup: open test image using windows built-in image viewer (Microsoft.Photos.exe) with 100% scale on 1920x1080 display, without DPI scaling.

Recording result
Original: use capture tool (Win+Shift+S) on the display, and save to png file
OBS captured: use display capture (win10 capture method) on the display, open in Kakao potplayer(https://tv.kakao.com/guide/potplayer), then save capture into png with 100% scale.
01_Problem_Statement.png


It seems to be a restrict color space problem, but my friend produced correct color result with the same setting in OBS.

My log file:
Code:
17:09:14.787: ---------------------------------
17:09:14.787: [x264 encoder: 'advanced_video_recording'] preset: veryfast
17:09:14.787: [x264 encoder: 'advanced_video_recording'] profile: baseline
17:09:14.787: [x264 encoder: 'advanced_video_recording'] settings:
17:09:14.787:     rate_control: CBR
17:09:14.787:     bitrate:      40000
17:09:14.787:     buffer size:  40000
17:09:14.787:     crf:          23
17:09:14.787:     fps_num:      60
17:09:14.787:     fps_den:      1
17:09:14.787:     width:        1920
17:09:14.787:     height:       1080
17:09:14.787:     keyint:       250
17:09:14.787:
17:09:14.790: ---------------------------------
17:09:14.791: [FFmpeg aac encoder: 'Track1'] bitrate: 160, channels: 2, channel_layout: stereo
17:09:14.791:
17:09:14.797: ==== Recording Start ===============================================
17:09:14.797: [ffmpeg muxer: 'adv_file_output'] Writing file 'C:/Users/Masterofthis/Videos/2023-01-29 17-09-14.mkv'...
17:09:16.502: [ffmpeg muxer: 'adv_file_output'] Output of file 'C:/Users/Masterofthis/Videos/2023-01-29 17-09-14.mkv' stopped
17:09:16.502: Output 'adv_file_output': stopping
17:09:16.502: Output 'adv_file_output': Total frames output: 72
17:09:16.502: Output 'adv_file_output': Total drawn frames: 102
17:09:16.502: ==== Recording Stop ================================================

And my color space settings: NV12, Rec. 709, full range
02_ColorSpace_Settings.png


My recording settings: x264 (CPU encoding, CBR 40000kbps, veryfast preset)
03_Recording_Settings.png


Recorded files are uploaded on my Github repo.
- Correct color encodings from my friend's OBS: https://github.com/ProjectEli/OBS_ColorProblem/blob/main/04_1_Correct color encodings from my friend's OBS.mkv
- Washed color encodings from my OBS: https://github.com/ProjectEli/OBS_ColorProblem/blob/main/04_2_Washed color encodings from my OBS.mkv
My friend's environment: windows 11 + Ryzen 5900X + RTX 3080

My observations:
1. All of my monitor display the original image correctly, without any distortion.
2. OBS preview window displays the original image without any distortion.
3. But when captured, color is distorted, and chroma subsampling problem occurs on recorded file (as you can see from recorded file).

My understandings:
1. Rec.709 is basically YUV but it has identical color space to sRGB (https://www.richardlackey.com/choosing-video-color-space/).
2. What I see on my display is RGBA (8bit channel depth) bitmap signals from my graphics card.
3. Windows capture tool (ScreenSketch.exe) uses the same method as Graphics.CopyFromScreen function in .NET System.Drawing (https://learn.microsoft.com/en-us/d...phics.copyfromscreen?view=dotnet-plat-ext-7.0), which is direct copy of 32bppRGBA pixels from the output of graphics card.
4. x264 encoding uses CPU, so the recording result should be independent from the type of GPU

Other trials​

1. Put image into Adobe Premeire Pro 2022 and H.264 exported using Adaptive high bitrate or source match​

Settings:1080p setting, clicked source match and export
05_2_Premiere_SourceMatch_settings.png

Results: distorted color
- Adaptive high bitrate: https://github.com/ProjectEli/OBS_ColorProblem/blob/main/05_1_Premiere_AdaptiveHighBitrate.mp4
- Source match: https://github.com/ProjectEli/OBS_ColorProblem/blob/main/05_2_Premiere_SourceMatch.mp4

Observations:
- Fine up to preview window at export stage but rendered image ruined
- If I change preview resolution from full to 1/2 in editing tab, distortion occurs. But I guess it is just preview and I set full resolution preview and export, then get distorted result

2. Put image into Davinci Resolve 18 and exported using Youtube 1080p setup.​

Settings: Colormap DaVinci YRGB and Rec.709-A (ref: https://youtu.be/TrTWThB0bxA)
06_1_DavinciResolve_ColorSettings.png

06_1_DavinciResolve_YT1080pSettings.png

Results: distorted colors ( https://github.com/ProjectEli/OBS_ColorProblem/blob/main/06_1_DavinciResolve_YT1080p.mp4 )

Observations:
- Same as Premiere case, image looks good up to preview window at export tab but got distorted result

3. Test on other desktop (other CPU, GPU, OS)​

I have more than 3 windows desktop so I tested same thing on other computer.

Original environment: Windows 10 Edu + AMD Ryzen 5600X + NVIDIA RTX 3050
Desktop 2: Windows 11 + Intel i5-8600K + GTX 970
Desktop 3: Windows 10 + Intel i7-8700 + GTX 1060

Result: Same distorted colors after encoding, no hope...


I have no idea which settings to fix..
I tried another color space, hardware encoding (NVENC H.264) and other tweaks (max quality, max CPU usage, etc.) but nothing changed.
What am I supposed to do? Any suggestions?
 

Attachments

  • DxDiag.txt
    127 KB · Views: 6
Top