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.

Fields-shifted Video - richtiges "Decombing"
#1
Hi,

ich würde gerne eine fields-shifted PAL HDTV Aufnahme richtig enkodieren.
Hier wurde mir bereits empfohlen TFM zu nutzen und nicht einen deinterlacing Algorythmus wie QTGMC. 
Leider musste ich feststellen, dass das dazu führt dass die Geschwindigkeit des Videos verdoppelt wird, wohingegen die Interpolierung der Felder mit QTGMC für unschönes Artefakte sorgt (s.u.).

Hier habe ich mal das Orginal, einen Encoding-Versuch mit QTGMC und einen mit TFM hochgeladen.

Hier ein paar Screenshots um die Probleme mit QTGMC zu illustrieren (mit einem Screenshot von der ürsprünglichen .ts Aufnahme zum Verständnis):

[Image: mpv-shot0022.jpg]
[Image: mpv-shot0021.jpg]
[Image: mpv-shot0020.jpg]
[Image: mpv-shot0019.jpg]

Script (TFM):
# Imports import vapoursynth as vs # getting Vapoursynth core 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 plugins core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/ZSmooth/zsmooth.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DeblockFilter/DeblockPP7/DeblockPP7.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/akarin.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DeinterlaceFilter/TIVTC/libtivtc.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/d2vSource/DGDecode.dll") # defining beforeGrainFactory-function - START def beforeGrainFactory(clip):   from rekt import rektlvls   fix = rektlvls(clip, rownum=[803, 802, 801, 800], rowval=[-100, -100, -100, -100])   return [clip] # defining beforeGrainFactory-function - END # Import scripts import addGrain import dehalo import sharpen import edge import validate # Source: 'C:\Users\jopro\Downloads\sample.ts' # Current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, frame rate: 25fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, format: mpeg-2 # Loading C:\Users\jopro\Downloads\sample.ts using DGDecode clip = core.dgdecode.MPEG2Source("C:/Users/jopro/AppData/Local/Temp/2025-11-10@14_03_29_1110.d2v",info=3)# 25 fps, scanorder: progressive 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 25fps clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1) # making sure the detected scan type is set (detected: progressive) clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive clip = core.std.Crop(clip=clip, left=2, right=2, top=2, bottom=0)# cropping to 1916x1078 # converting full-height progressive to interlaced before deinterlacing clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8) clip = core.std.SeparateFields(clip=clip, tff=False) clip = core.std.SelectEvery(clip=clip, cycle=4, offsets=[0, 3]) clip = core.std.DoubleWeave(clip=clip, tff=False) # resolution 1916x1078 clip = core.std.SelectEvery(clip=clip, cycle=2, offsets=0) # new fps: 12.5 clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_TOP) # tff clip = core.tivtc.TFM(clip=clip, mode=5, slow=2) # Making sure content is preceived as frame based clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive # Fix bright and dark line artifacts near the border of an image using BalanceBorders clip = edge.bbmod(c=clip,cLeft=8,cTop=8,cRight=4,cBottom=0,thresh=100,blur=1400) # applying delocking using Deblock clip = core.deblock.Deblock(clip=clip, quant=10) # applying deblocking using DeblockPP7 clip = core.pp7.DeblockPP7(clip=clip, mode=2) # applying debanding using vs-placebo.Deband clip = core.placebo.Deband(clip=clip, radius=8.00, iterations=2, grain=2.00, planes=1) # sharpening using FineSharp clip = sharpen.FineSharp(clip=clip, sstr=3.50) clip = dehalo.EdgeCleaner(c=clip, strength=13, rmode=1) [clip] = beforeGrainFactory(clip) # clip current meta; color space: YUV444P8, bit depth: 8, resolution: 1916x1078, fps: 12.5, color matrix: 709, yuv luminance scale: limited, scanorder: progressive, full height: true # adding grain using GrainFactory3 clip = addGrain.GrainFactory3(clp=clip, g1str=4.50, g1shrp=35, g1size=2.20, g2str=2.70, g2shrp=43, g2size=1.70, g3str=2.10, g3shrp=55, g3size=1.30, temp_avg=65, ontop_grain=1.70) # adjusting output color from: YUV444P8 to YUV420P8 for x264Model clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_in_s="limited") # set output frame rate to 23.976fps (progressive) due to 'Change speed clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001) # output clip.set_output()

Script (QTGMC):
# 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/SharpenFilter/AWarpSharp2/libawarpsharp2.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DeblockFilter/DeblockPP7/DeblockPP7.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/DenoiseFilter/ZSmooth/zsmooth.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.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/DenoiseFilter/DFTTest/DFTTest.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/EEDI3m.dll")# vsQTGMC core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/libmvtools.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/fmtconv.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DeinterlaceFilter/Bwdif/Bwdif.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/akarin.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/d2vSource/DGDecode.dll") # defining beforeGrainFactory-function - START def beforeGrainFactory(clip):   from rekt import rektlvls   fix = rektlvls(clip, rownum=[803, 802, 801, 800], rowval=[-100, -100, -100, -100])   return [clip] # defining beforeGrainFactory-function - END # Import scripts import addGrain import dehalo import sharpen import edge import qtgmc import validate # Source: 'C:\Users\jopro\Downloads\sample.ts' # Current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, frame rate: 25fps, scanorder: bottom field first, yuv luminance scale: limited, matrix: 709, format: mpeg-2 # Loading C:\Users\jopro\Downloads\sample.ts using DGDecode clip = core.dgdecode.MPEG2Source("C:/Users/jopro/AppData/Local/Temp/2025-11-10@14_07_27_4210.d2v",info=3)# 25 fps, scanorder: bottom field first 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 25fps clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1) # making sure the detected scan type is set (detected: bottom field first) clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_BOTTOM) # bff clip = core.std.Crop(clip=clip, left=2, right=2, top=2, bottom=0)# cropping to 1916x1078 clip = core.std.AddBorders(clip=clip, left=0, right=0, top=0, bottom=2) # add borders to archive mod 4 (vsQTGMC) - 1916x1080 # Deinterlacing using QTGMC clip = qtgmc.QTGMC(Input=clip, Preset="Placebo", InputType=0, TFF=False, TR2=3, SourceMatch=2, Lossless=2, EZKeepGrain=1.50, NoisePreset="Slow") # new fps: 25 clip = core.std.Crop(clip=clip, left=0, right=0, top=0, bottom=2) # removing added borders from mod requirement (vsQTGMC) -  1916x1078 # Making sure content is preceived as frame based clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive clip = clip[::2] # selecting previously even frames # Fix bright and dark line artifacts near the border of an image using BalanceBorders clip = edge.bbmod(c=clip,cLeft=8,cTop=8,cRight=4,cBottom=0,thresh=100,blur=1400) # applying delocking using Deblock clip = core.deblock.Deblock(clip=clip, quant=10) # applying deblocking using DeblockPP7 clip = core.pp7.DeblockPP7(clip=clip, mode=2) # applying debanding using vs-placebo.Deband clip = core.placebo.Deband(clip=clip, radius=8.00, iterations=2, grain=2.00, planes=1) # sharpening using FineSharp clip = sharpen.FineSharp(clip=clip, sstr=3.50) clip = dehalo.EdgeCleaner(c=clip, strength=13, rmode=1) [clip] = beforeGrainFactory(clip) # clip current meta; color space: YUV420P8, bit depth: 8, resolution: 1916x1078, fps: 25, color matrix: 709, yuv luminance scale: limited, scanorder: progressive, full height: true # adding grain using GrainFactory3 clip = addGrain.GrainFactory3(clp=clip, g1str=4.50, g1shrp=35, g1size=2.20, g2str=2.70, g2shrp=43, g2size=1.70, g3str=2.10, g3shrp=55, g3size=1.30, temp_avg=65, ontop_grain=1.70) # set output frame rate to 23.976fps (progressive) due to 'Change speed clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001) # output clip.set_output()


Ich bin für jeden Tipp dankbar!
Reply
#2
Wenn der Input nicht progressive ist, solltest Du Hybrid das wissen lassen, in dem Du die 'overwrite input scan type to', in deinem Fall auf "field-blendend".
Dann sollte da auch nicht:
clip = core.std.Crop(clip=clip, left=2, right=2, top=2, bottom=0)# cropping to 1916x1078 # converting full-height progressive to interlaced before deinterlacing clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8) clip = core.std.SeparateFields(clip=clip, tff=False) clip = core.std.SelectEvery(clip=clip, cycle=4, offsets=[0, 3]) clip = core.std.DoubleWeave(clip=clip, tff=False) # resolution 1916x1078 clip = core.std.SelectEvery(clip=clip, cycle=2, offsets=0) # new fps: 12.5 clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_TOP) # tff clip = core.tivtc.TFM(clip=clip, mode=5, slow=2)
verwendet werden, was auch irgendwie komisch aussieht.
Vor allem ist mir unklar, wo das crop herkommt, das sollte da nicht sein.
(Stell sicher das Du die aktuelle Hybrid version 2025.11.09.1 verwendest.)
Hast Du die Filterreihenfolge geändert? Kann das hier nicht nachstellen.


Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Offline between (including) 29th of June and 5th of July => RochHarz Festival
Reply
#3
Das von Dir gepostete Skript zeigt:
# Current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, frame rate: 25fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, format: mpeg-2
Aber wenn ich die sample.ts hier lade sehe ich:
# Current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, frame rate: 25fps, scanorder: bottom field first, yuv luminance scale: limited, matrix: 709, format: mpeg-2
Bei mir wird wenn ich TFM aktiviere:
# Imports import vapoursynth as vs # getting Vapoursynth core import sys import os core = vs.core # Limit frame cache to 48449MB core.max_cache_size = 48449 # Import scripts folder scriptPath = 'F:/Hybrid/64bit/vsscripts' sys.path.insert(0, os.path.abspath(scriptPath)) # loading plugins core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DeinterlaceFilter/TIVTC/libtivtc.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV_AVX2.dll") # Import scripts import validate # Source: 'C:\Users\Selur\Desktop\sample.ts' # Current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, frame rate: 25fps, scanorder: bottom field first, yuv luminance scale: limited, matrix: 709, format: mpeg-2 # Loading C:\Users\Selur\Desktop\sample.ts using DGSource clip = core.dgdecodenv.DGSource("J:/tmp/ts_3591dab47f54c59fc132a441faa50717_853323747.dgi",fieldop=0)# 25 fps, scanorder: bottom field first 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 25fps clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1) # making sure the detected scan type is set (detected: bottom field first) clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_BOTTOM) # bff clip = core.tivtc.TFM(clip) # Making sure content is preceived as frame based clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive # no resizing since resolution is already archived # adjusting output color from: YUV420P8 to YUV420P10 for NVEncModel clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10) # set output frame rate to 25fps (progressive) clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1) # output clip.set_output()
erzeugt. Da sieht alles okay aus.
=> wie gesagt, schau mal ob das Problem mit der aktuellen Version nicht gefixed ist.

------------
Nebenbei:
'Decombing' ist ein anderes Wort für Deinterlacing. Was Du willst "field-matching". Da sind TFM oder VFM die richtigen Filter.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Offline between (including) 29th of June and 5th of July => RochHarz Festival
Reply
#4
Okay! Ich glaube der größte Fehler meinerseits war es den Input Scan Typ auf "progressive" zu überschreiben statt auf field-blended. Ich war irgendwie unter dem Eindruck dass man das bei field-shifted Content so macht. Vielen dank!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)