Hi,
I have a few sources where the PAR adjustment changes quite differently often, and not always per-scene either.
I am fiddling with a way to detect pillar boxing, how much, and automatically crop in.
I thought this up, where it just crops in until most pixels are similar in value and a near-0 (black) value.Code:def crop_left_black(clip, maximum=55, threshold=0.10, verbose=True): def _(n, f, c): for _edge in f: amount = _edge.width avg = _edge.props["PlaneStatsAverage"] is_black = avg < threshold if is_black: c = core.resize.Spline16(c, c.width, c.height, src_width=c.width-amount, src_left=amount) if verbose: c = core.text.Text(c, f"Frame #{n} amount {amount}", alignment=9) return c return c edges = [ core.std.CropAbs(clip, width=i + 1, height=clip.height, left=0).\ std.PlaneStats() for i in reversed(range(maximum)) ] return core.std.FrameEval(clip, functools.partial(_, c=clip), prop_src=edges)
But this is fairly slow and ineffective sometimes. In frames where the scene is dark, it often just ends up
resizing at wacky values, therefore quite noticeable wobble on the horizontal resolution.
Showcase of Wobble: https://mega.nz/file/IlwQyaiJ#2eMp8gV0DERbkbRChNx3fwxeSDO5PHygfRYcbBZlpjo
Does anyone have any way to improve this? Some ideas I had were to see if the current "edge" column has similar values to the previous ones.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 2 of 2
Thread
-
Last edited by PRAGMA; 11th Apr 2023 at 00:52.
Similar Threads
-
vapoursynth errors
By IAAMM in forum Newbie / General discussionsReplies: 7Last Post: 29th Mar 2021, 10:14 -
Vapoursynth Deinterlacing Variable Framerate
By Parhelion in forum Video ConversionReplies: 5Last Post: 19th Sep 2020, 16:37 -
encoding with vapoursynth.
By zanzar in forum Newbie / General discussionsReplies: 31Last Post: 7th Mar 2019, 14:57 -
How to use 64bit avisynth plugins in vapoursynth with the Eval function?
By danfgtn in forum Newbie / General discussionsReplies: 3Last Post: 18th Feb 2019, 14:08 -
4:3 HD video forced pillarboxing necessary?
By Vchat20 in forum Video ConversionReplies: 2Last Post: 6th Nov 2018, 10:13