Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
3rd October 2021, 17:55 | #1 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Why is FrameEval Crashing
Why is this method crashing when I add FrameEval? Memory out of bound exception.
Code:
# BM3D denoising method def BM3D(clip, sigma, radius, gpuid, chroma, ref, outbits): clean = clip.resize.Bicubic(format=vs.RGBS, matrix_in_s="709") if chroma else clip.fmtc.bitdepth(bits=32, dmode=1) ref = ref.resize.Bicubic(format=vs.RGBS, matrix_in_s="709") if chroma else ref.fmtc.bitdepth(bits=32, dmode=1) clean = clean.bm3dcuda.BM3D(sigma=[sigma,sigma,sigma], radius=radius, ref=ref, device_id=gpuid, fast=False) if radius > 0: clean = clean.bm3d.VAggregate(radius=radius) if clip.format.subsampling_w == 1 and clip.format.subsampling_h == 1: fmt = vs.YUV420P16 elif clip.format.subsampling_w == 1 and clip.format.subsampling_h == 0: fmt = vs.YUV422P16 else: fmt = vs.YUV444PS if outbits == 32 else vs.YUV444P16 #return clean.resize.Bicubic(format=fmt, matrix_s="709", range = 1) # Convert back while respecting _ColorRange of each frame. Note that setting range=1 sets _ColorRange=0 (reverse) def ConvertBack(n, f, clean, format): fullRange = '_ColorRange' in f.props and f.props['_ColorRange'] == 0 return clean.resize.Bicubic(format=format, matrix_s="709", range = 1 if fullRange else 0) return clean.std.FrameEval(functools.partial(ConvertBack, clean=clean, format=fmt), prop_src=clip) |
4th October 2021, 09:04 | #2 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
It shouldn't crash. Which VS version did you use? And can you paste the full error message.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
11th October 2021, 16:59 | #3 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I found out that it can crash due to 3 reasons
1) If the sub-function has same clip parameter name as the function -- it doesn't like that 2) If the first parameter doesn't have the same format as the output of FrameEval, it crashes with memory exception like that. Doing it like this works. Code:
return core.std.BlankClip(src, format=fmt).std.FrameEval(functools.partial(ConvertBack, clip=c, format=fmt), prop_src=src)
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 11th October 2021 at 17:17. |
11th October 2021, 17:28 | #4 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
I know I cannot use this for example, I was scratching my head for a while to figure out, why FrameEval was not working:
clip = clip.std.FrameEval(.......) it has to be: other_name_clip = clip.std.FrameEval(.......) output format difference, I'd expect that is not going work |
Thread Tools | Search this Thread |
Display Modes | |
|
|