Okay, here's what you can do.
Cu Selur
- Start Hybrid
- load clip
- set 'Filtering->(De-)Interlace/Telecine->Overwrite input scan type to' to 'top field first'
- optional: enable 'Filtering->(De-)Interlace/Telecine->QTGMC Vapoursynth->Bob'.
- go to 'Filtering->Vapoursynth->Custom->Insert Before' set it to 'FillDrops', enable the text box below it.
- in this custom section you now enter:
If you now look at the Vapoursynth Preview all black frames should be replaced with the last non-black frame.# replace a black frames with last frame that was not black
def ReplaceBlackFrames(clip, thresh=0.1, debug=False):
core = vs.core
if not isinstance(clip, vs.VideoNode):
raise ValueError('This is not a clip')
def selectFunc(n, f):
if f.props['PlaneStatsAverage'] > thresh or n == 0:
if debug:
return core.text.Text(clip=clip,text="Org, avg: "+str(f.props['PlaneStatsAverage']),alignment=8)
return clip
toReplace = n
for i in range(n)[::-1]:
if clip.get_frame(i).props['PlaneStatsAverage'] <= thresh:
continue
# remove current replace with frame before
start = core.std.Trim(clip, first=0, last=n-1)
r = core.std.Trim(clip, first=i, last=i)
end = core.std.Trim(clip, first=n+1)
replaced = start + r + end
break
if debug:
return core.text.Text(clip=replaced,text="Replaced, avg: "+str(f.props['PlaneStatsAverage']),alignment=8)
return replaced
clip = core.std.PlaneStats(clip)
fixed = core.std.FrameEval(clip, selectFunc, prop_src=clip)
return fixed
clip = ReplaceBlackFrames(clip, thresh=0.1, debug=False)
- optional: if there were no multiple black frames in a row, enable 'Filtering->Vapoursynth->Misc->FillDrops', this will then replace the duplicate with an interpolated version.
Cu Selur