This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Color change on encoding
#13
Quote: Here is the debug log of one of the problematic videos :
That is not the debug output.

Looking at the vapoursynth script and the encoding call:
"C:\Program Files\Hybrid\64bit\Vapoursynth\vspipe.exe" "C:\Users\Admin\AppData\Local\Temp\encodingTempSynthSkript_2024-11-11@02_58_55_091413_0.vpy" - -c y4m | "C:\Program Files\Hybrid\64bit\ffmpeg.exe" -y -noautorotate -nostdin -threads 8 -f yuv4mpegpipe -i - -an -sn -color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range tv -pix_fmt yuv420p -fps_mode passthrough -vcodec ffv1 -coder 0 -context 0 -g 1 -level 1 -metadata encoding_tool="Hybrid 2024.11.05.1" "C:\Users\Admin\AppData\Local\Temp\116_14_2024-11-11@02_58_55_091413_02.mkv"
and the used script:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import ctypes
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("C:/Program Files/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
# loading plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/TTempSmooth/TTempSmooth.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/DCTFilter.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/BestSource/BestSource.dll")
# Import scripts
import psharpen
import havsfunc
import validate
# Source: 'G:\DB KAI part A et B\005-PartA\Davinci Resolve - CC\116.mkv'
# Current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, frame rate: 23.976fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, transfer: bt.709, primaries: bt.709, format: FFV1
# Loading G:\DB KAI part A et B\005-PartA\Davinci Resolve - CC\116.mkv using BestSource)
clip = core.bs.VideoSource(source="G:/DB KAI part A et B/005-PartA/Davinci Resolve - CC/116.mkv", cachepath="C:/Users/Admin/AppData/Local/Temp/116_bestSource_2024-11-11@02_58_55_091413", track=0)
frame = clip.get_frame(0)
# setting color matrix to 709.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
# setting color transfer (vs.TRANSFER_BT709), if it is not set.
if validate.transferIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709)
# setting color primaries info (to vs.PRIMARIES_BT709), if it is not set.
if validate.primariesIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT709)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 23.976fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
# denoising using MCTemporalDenoise
clip = havsfunc.MCTemporalDenoise(i=clip, settings="low", thSAD=400, thSAD2=400, thSCD1=400, thSCD2=100, truemotion=False, MVglobal=True, pel=4, pelsearch=5, search=5, searchparam=5, MVsharp=2, DCT=0, ncpu=1)
# sharpening using PSharpen
clip = psharpen.psharpen(clip=clip, strength=16.00)
# applying FineDeHalo to remove halos
clip = havsfunc.FineDehalo(clip, rx=2.50, ry=2.50, darkstr=0.00, brightstr=1.10)
# set output frame rate to 23.976fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# output
clip.set_output()
the whole encoding chain does not contain any rgb<>yuv conversion, so during the filtering color matrix is not used.
So any changes in color are either due to one of the filters you used, this you should be able to see if you use the compare view to compare input and filtered input or it's caused by some tagging.

Quote:I just saw that the Hybrid video lacks "Color primaries" and "transfer characteristics" in mediainfo, idk why
Strange thing is that when I reencoded the clip (with the call I posted) I get:
Video
ID                                       : 1
Format                                   : FFV1
Format version                           : Version 1
Codec ID                                 : V_MS/VFW/FOURCC / FFV1
Duration                                 : 6 min 28 s
Bit rate mode                            : Variable
Bit rate                                 : 119 Mb/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                                : 8 bits
Compression mode                         : Lossless
Bits/(Pixel*Frame)                       : 2.394
Stream size                              : 5.38 GiB (98%)
Writing library                          : Lavc61.24.100 ffv1
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
coder_type                               : Golomb Rice

Quote: I'm still going to uninstall everything and install the last dev to see if there are any changes.
Please do, make sure to remove your settings on uninstall.
Also, try not using BestSource.


Cu Selur
Reply


Messages In This Thread
Color change on encoding - by Lipomo - 10.11.2024, 19:39
RE: Color change on encoding - by Selur - 10.11.2024, 19:51
RE: Color change on encoding - by Lipomo - 10.11.2024, 20:30
RE: Color change on encoding - by Selur - 10.11.2024, 20:46
RE: Color change on encoding - by Lipomo - 10.11.2024, 20:57
RE: Color change on encoding - by Lipomo - 11.11.2024, 00:09
RE: Color change on encoding - by Selur - 11.11.2024, 06:16
RE: Color change on encoding - by Lipomo - 11.11.2024, 06:24
RE: Color change on encoding - by Selur - 11.11.2024, 06:31
RE: Color change on encoding - by Selur - 11.11.2024, 06:32
RE: Color change on encoding - by Selur - 11.11.2024, 15:43
RE: Color change on encoding - by Lipomo - 11.11.2024, 16:27
RE: Color change on encoding - by Selur - 11.11.2024, 17:28
RE: Color change on encoding - by Selur - 11.11.2024, 17:30
RE: Color change on encoding - by Lipomo - 11.11.2024, 17:40
RE: Color change on encoding - by Selur - 11.11.2024, 17:46
RE: Color change on encoding - by Lipomo - 11.11.2024, 17:54
RE: Color change on encoding - by Selur - 11.11.2024, 18:23
RE: Color change on encoding - by Lipomo - 11.11.2024, 18:35
RE: Color change on encoding - by Selur - 11.11.2024, 18:50
RE: Color change on encoding - by Lipomo - 11.11.2024, 19:23
RE: Color change on encoding - by Selur - 11.11.2024, 19:32
RE: Color change on encoding - by Lipomo - 11.11.2024, 19:58
RE: Color change on encoding - by Lipomo - 12.11.2024, 22:37
RE: Color change on encoding - by Selur - 13.11.2024, 05:17
RE: Color change on encoding - by Selur - 13.11.2024, 15:46
RE: Color change on encoding - by Lipomo - 13.11.2024, 15:56
RE: Color change on encoding - by Selur - 13.11.2024, 16:14
RE: Color change on encoding - by Selur - 13.11.2024, 18:18
RE: Color change on encoding - by Lipomo - 14.11.2024, 22:09

Forum Jump:


Users browsing this thread: 1 Guest(s)