Replies: 1 comment 11 replies
-
Here is the code that handles scene change, which is always enabled. |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, im trying to understand why vsmlrt does not have sc = True parameter?
How do i add proper scene detection then ? I tried:
script_content([
"# Calculate padding to ensure 32-pixel alignment",
"ph = (clip.height + 31) // 32 * 32 - clip.height",
"pw = (clip.width + 31) // 32 * 32 - clip.width",
"",
"# Add padding (clip already in RGB format)",
"clip = clip.std.AddBorders(right=pw, bottom=ph)",
"",
"# Setting color transfer info, when it is not set using my dynamic matrix_s",
"clip = clip if not core.text.FrameProps(clip, '_Transfer') else core.std.SetFrameProps(clip, _Transfer=5)",
"",
"# Setting color primaries info, when it is not set",
"clip = clip if not core.text.FrameProps(clip, '_Primaries') else core.std.SetFrameProps(clip, _Primaries=5)",
"",
"# Setting color range to TV (limited) range",
"clip = core.std.SetFrameProp(clip=clip, prop='_ColorRange', intval=1)",
"",
"# Setting frame to progressive",
"clip = core.std.SetFrameProp(clip=clip, prop='_FieldBased', intval=0)",
"",
"# Adjusting color format to RGBS for custom section",
"clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, range_in_s='full')",
"",
"# Apply SCDetect for scene detection",
f"clip = core.misc.SCDetect(clip, threshold={scene_change_threshold})",
"",
f"# Apply RIFE interpolation with calculated multiplier {multi.numerator}/{multi.denominator}",
f"clip = vsmlrt.RIFE(clip,",
f" multi=Fraction({multi.numerator}, {multi.denominator}),", # Using the calculated multi Fraction
f" model=RIFEModel.{model_version},",
f" backend=Backend.TRT(",
f" fp16={rife_params['fp16']},",
f" num_streams={rife_params['num_streams']},",
f" use_cuda_graph={rife_params['use_cuda_graph']},",
f" output_format={rife_params['output_format']},",
f" tf32=True,",
f" heuristic=True",
" ),",
f" ensemble={str(rife_params['ensemble'])},",
f" video_player={str(rife_params['video_player_mode'])}",
")",
"",
"# Set the correct output FPS using AssumeFPS",
f"clip = clip.std.AssumeFPS(fpsnum={target_fps.numerator}, fpsden={target_fps.denominator})",
"",
"# Remove padding",
"clip = clip.std.Crop(right=pw, bottom=ph)",
]) , where "rife_params" is just my module to apply custom parameters, the scene detection is added here by SCDetect but without the sc = True , i get stutters and incorrect scene changes, as there is literally no code to use the SCDetect analysis with vsmlrt. How to do this? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions