Posts: 38
Threads: 17
Joined: Jul 2021
As you know there are bound to be thousands of questions on every Hybrid subject within the site, and so many wonderful suggestions. However, it can be hard trying to locate specific answers.
So, I have a question. I have recently obtained an official Blu-ray with rare concert footage on it. Unfortunately, the footage suffers from poor interlacing. I had a go at fixing it with Hybrid and it did get somewhere with it but not quite. So I am wondering if there are any settings I can have a go at tweaking to see if I can get a bit more out of the deinterlacing (I don't mind if it slows my machine down)?
Posts: 10.982
Threads: 57
Joined: May 2017
Most, of the more complex deinterlace filters have tons of options, and they all have their usage.
Without:
a. a sample of the source
b. some info what you are trying to tweak
I have no clue what to say aside from suggesting reading up on the deinterlacer of your choice.
For example here are the possible parameters for QTGMC:
'''
QTGMC 3.33
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise
processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on
TempGaussMC_beta2 by Didée.
Parameters:
Input: Clip to process.
Preset: Sets a range of defaults for different encoding speeds.
Select from "Placebo", "Very Slow", "Slower", "Slow", "Medium", "Fast", "Faster", "Very Fast", "Super Fast", "Ultra Fast" & "Draft".
TR0: Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed, 0=don't use.
TR1: Temporal binomial smoothing radius used on interpolated clip for initial output. In general 2=quality, 1=speed, 0=don't use.
TR2: Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output.
Rep0: Repair motion search clip (0=off): repair unwanted blur after temporal smooth TR0 (see QTGMC_KeepOnlyBobShimmerFixes function for details).
Rep1: Repair initial output clip (0=off): repair unwanted blur after temporal smooth TR1.
Rep2: Repair final output clip (0=off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used).
EdiMode: Interpolation method, from "NNEDI3", "EEDI3+NNEDI3" (EEDI3 with sclip from NNEDI3), "EEDI3" or "Bwdif", anything else uses "Bob".
RepChroma: Whether the repair modes affect chroma.
NNSize: Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices.
Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality).
NNeurons: Controls number of neurons in NNEDI3, larger = slower and better quality but improvements are small.
EdiQual: Quality setting for NNEDI3. Higher values for better quality - but improvements are marginal.
EdiMaxD: Spatial search distance for finding connecting edges in EEDI3.
ChromaEdi: Interpolation method used for chroma. Set to "" to use EdiMode above (default). Otherwise choose from "NNEDI3", "Bwdif" or "Bob" - all high
speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes).
EdiExt: Provide externally created interpolated clip rather than use one of the above modes.
Sharpness: How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC).
SMode: Resharpening mode.
0 = none
1 = difference from 3x3 blur kernel
2 = vertical max/min average + 3x3 kernel
SLMode: Sharpness limiting.
0 = off
[1 = spatial, 2 = temporal]: before final temporal smooth
[3 = spatial, 4 = temporal]: after final temporal smooth
SLRad: Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0, 1 or 3.
SOvs: Amount of overshoot allowed with temporal sharpness limiting (SLMode=2,4), i.e. allow some oversharpening.
SVThin: How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines.
Sbb: Back blend (blurred) difference between pre & post sharpened clip (minor fidelity improvement).
0 = off
1 = before (1st) sharpness limiting
2 = after (1st) sharpness limiting
3 = both
SrchClipPP: Pre-filtering for motion search clip.
0 = none
1 = simple blur
2 = Gauss blur
3 = Gauss blur + edge soften
SubPel: Sub-pixel accuracy for motion analysis.
1 = 1 pixel
2 = 1/2 pixel
4 = 1/4 pixel
SubPelInterp: Interpolation used for sub-pixel motion analysis.
0 = bilinear (soft)
1 = bicubic (sharper)
2 = Weiner (sharpest)
BlockSize: Size of blocks that are matched during motion analysis.
Overlap: How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion).
Search: Search method used for matching motion blocks - see MVTools2 documentation for available algorithms.
SearchParam: Parameter for search method chosen. For default search method (hexagon search) it is the search range.
PelSearch: Search parameter (as above) for the finest sub-pixel level (see SubPel).
ChromaMotion: Whether to consider chroma when analyzing motion. Setting to false gives good speed-up,
but may very occasionally make incorrect motion decision.
TrueMotion: Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation).
Lambda: Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks.
Should be scaled by BlockSize*BlockSize/64.
LSAD: How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor,
typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda).
PNew: Penalty for choosing a new motion vector for a block over an existing one - avoids choosing new vectors for minor gain.
PLevel: Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices.
GlobalMotion: Whether to estimate camera motion to assist in selecting block motion vectors.
DCT: Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.
ThSAD1: SAD threshold for block match on shimmer-removing temporal smooth (TR1). Increase to reduce bob-shimmer more (may smear/blur).
ThSAD2: SAD threshold for block match on final denoising temporal smooth (TR2). Increase to strengthen final smooth (may smear/blur).
ThSCD1: Scene change detection parameter 1 - see MVTools documentation.
ThSCD2: Scene change detection parameter 2 - see MVTools documentation.
SourceMatch:
0 = source-matching off (standard algorithm)
1 = basic source-match
2 = refined match
3 = twice refined match
MatchPreset: Speed/quality for basic source-match processing, select from "Placebo", "Very Slow", "Slower", "Slow", "Medium", "Fast", "Faster",
"Very Fast", "Super Fast", "Ultra Fast" ("Draft" is not supported). Ideal choice is the same as main preset,
but can choose a faster setting (but not a slower setting). Default is 3 steps faster than main Preset.
MatchEdi: Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3).
Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match.
MatchPreset2: Speed/quality for refined source-match processing, select from "Placebo", "Very Slow", "Slower", "Slow", "Medium", "Fast", "Faster",
"Very Fast", "Super Fast", "Ultra Fast" ("Draft" is not supported). Default is 2 steps faster than MatchPreset.
Faster settings are usually sufficient but can use slower settings if you get extra aliasing in this mode.
MatchEdi2: Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2="Bob" for speed.
MatchTR2: Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal.
Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1).
MatchEnhance: Enhance the detail found by source-match modes 2 & 3. A slight cheat - will enhance noise if set too strong. Best set < 1.0.
Lossless: Puts exact source fields into result & cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening.
Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless.
NoiseProcess: Bypass mode.
0 = disable
1 = denoise source & optionally restore some noise back at end of script [use for stronger denoising]
2 = identify noise only & optionally restore some after QTGMC smoothing [for grain retention / light denoising]
EZDenoise: Automatic setting to denoise source. Set > 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value.
EZKeepGrain: Automatic setting to retain source grain/detail. Set > 0.0 to enable. Higher values retain more grain. A good starting point = 1.0.
NoisePreset: Automatic setting for quality of noise processing. Choices: "Slower", "Slow", "Medium", "Fast", and "Faster".
Denoiser: Select denoiser to use for noise bypass / denoising. Select from "bm3d", "dfttest", "fft3dfilter" or "knlmeanscl".
Unknown value selects "fft3dfilter".
FftThreads: Number of threads to use if using "fft3dfilter" for Denoiser.
DenoiseMC: Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower).
NoiseTR: Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower.
Sigma: Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help.
ChromaNoise: When processing noise (NoiseProcess > 0), whether to process chroma noise or not (luma noise is always processed).
ShowNoise: Display extracted and "deinterlaced" noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify
contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail,
but not too much clean structure or edges - fairly subjective.
GrainRestore: How much removed noise/grain to restore before final temporal smooth. Retain "stable" grain and some detail (effect depends on TR2).
NoiseRestore: How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise.
NoiseDeint: When noise is taken from interlaced source, how to 'deinterlace' it before restoring.
"Bob" & "DoubleWeave" are fast but with minor issues: "Bob" is coarse and "Doubleweave" lags by one frame.
"Generate" is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects "DoubleWeave".
StabilizeNoise: Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for "Generate" mode.
InputType: Default = 0 for interlaced input. Settings 1, 2 & 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not
doubled. Mode 1 is for general progressive material. Modes 2 & 3 are designed for badly deinterlaced material.
ProgSADMask: Only applies to InputType=2,3. If ProgSADMask > 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD.
Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending.
FPSDivisor: 1=Double-rate output, 2=Single-rate output. Higher values can be used too (e.g. 60fps & FPSDivisor=3 gives 20fps output).
ShutterBlur: 0=Off, 1=Enable, 2,3=Higher precisions (slower). Higher precisions reduce blur "bleeding" into static areas a little.
ShutterAngleSrc: Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame.
0=pin-sharp, 360=fully blurred from frame to frame.
ShutterAngleOut: Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings).
Cannot reduce motion blur already in the source.
SBlurLimit: Limit motion blur where motion lower than given value. Increase to reduce blur "bleeding". 0=Off. Sensible range around 2-12.
Border: Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the
output. If you have wider edge effects than that, you should crop afterwards instead.
Precise: Set to false to use faster algorithms with *very* slight imprecision in places.
Tuning: Tweaks the defaults for different source types. Choose from "None", "DV-SD", "DV-HD".
ShowSettings: Display all the current parameter values - useful to find preset defaults.
GlobalNames: The name used to expose intermediate clips to calling script. QTGMC now exposes its motion vectors and other intermediate clips to the
calling script through global variables. These globals are uniquely named. By default they begin with the prefix "QTGMC_". The available clips are:
Backward motion vectors bVec1, bVec2, bVec3 (temporal radius 1 to 3)
Forward motion vectors fVec1, fVec2, fVec3
Filtered clip used for motion analysis srchClip
MVTools "super" clip for filtered clip srchSuper
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X
Clips can be accessed from other scripts with havsfunc.QTGMC_globals['Prefix_Name']
PrevGlobals: What to do with global variables from earlier QTGMC call that match above name. Either "Replace", or "Reuse" (for a speed-up).
Set PrevGlobals="Reuse" to reuse existing similar named globals for this run & not recalculate motion vectors etc. This will improve performance.
Set PrevGlobals="Replace" to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.
ForceTR: Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC.
Str: With this parameter you control the strength of the brightening of the prefilter clip for motion analysis.
This is good when problems with dark areas arise.
Amp: Use this together with Str (active when Str is different from 1.0). This defines the amplitude of the brightening in the luma range,
for example by using 1.0 all the luma range will be used and the brightening will find its peak at luma value 128 in the original.
FastMA: Use 8-bit for faster motion analysis when using high bit depth input.
ESearchP: Use wider search range for hex and umh search method.
RefineMotion: Refines and recalculates motion data of previously estimated motion vectors with new parameters set (e.g. lesser block size).
The two-stage method may be also useful for more stable (robust) motion estimation.
TFF: Since VapourSynth only has a weak notion of field order internally, TFF may have to be set. Setting TFF to true means top field first and false
means bottom field first. Note that the _FieldBased frame property, if present, takes precedence over TFF.
nnedi3_args: Additional arguments to pass to NNEDI3.
eedi3_args: Additional arguments to pass to EEDI3.
opencl: Whether to use the OpenCL version of NNEDI3 and EEDI3.
device: Sets target OpenCL device.
'''
Also, make sure your source is really interlaced and not telecined, soft telecined or progressive.
Cu Selur
Posts: 38
Threads: 17
Joined: Jul 2021
Thanks so much for that info, and I've also been thinking that it may even be in some way not interlaced, so shall look into those first just in case. EDIT Just checked and it is progressive.
Posts: 10.982
Threads: 57
Joined: May 2017
17.04.2023, 20:00
(This post was last modified: 17.04.2023, 20:01 by Selur.)
Quote:EDIT Just checked and it is progressive.
Happy, that solved itself.
Cu Selur
Ps.: @all: [INFO] Interlacing patterns is a good place to start to figure out what the source really is.
|