Selur's Little Message Board

Full Version: Picture Crop Side by Side
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hello,


When i want to see the results of my crop settings in the preview windows side by side (horizontal) , for some reason an black border is added to only the left side of the filtered image !
At the right side nothing is cut, only top and bottom seems to be cutted just right.

I don't have this problem when viewing the results with the original on top and filtered view bottom side.  
Or by previewing just the filtered content (no comparison)..


iam on hybrid 2023.11.02.1..


cheers,
TD
a. update
b. without a debug output I can only guess, atm. I would suspect that it's related to the input or output color space

Cu Selur
using hybrid every week and the cropping is working fine (PAL VHS conversion 720x576)
do you have a sample or a small clip to reproduce the issue?
I don't think it's a bug in the cropping itself, it might be some adjustments doing internal for preview to abide to a specific color space restiction or similar.
(need a debug output to see what is happening and why)
(07.12.2023, 06:18)Selur Wrote: [ -> ]a. update
b. without a debug output I can only guess, atm. I would suspect that it's related to the input or output color space

Cu Selur

Haven't checked the update page.. 
Since you provided me recently (11/2023) with quite a few updates regarding some "audio" issues among others, remember  Big Grin

But thanks for the reminder


i have created an debug + snapshot from the preview filter window (see attachement).

it's not urgent though, since i can remedie this "issue" by using a custom preview preset under vapoursynth.. 
But not side by side, wich would be easier to work with on an widescreen monitor you see.


ps: in the meanwhile i'll update to 2023.12 and get back to you with the result.

Cheers,
td
This is the preview script:
Code:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/MiniDeen/libminideen.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# Import scripts
import G41Fun
# source: 'E:\TV_SERIES-SHOWS\STAR WARS - ANDOR\Episode - 1.m2ts'
# current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, fps: 24, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
# Loading source using FFMS2
clip = core.ffms2.Source(source="E:/TV_SERIES-SHOWS/STAR WARS - ANDOR/Episode - 1.m2ts",cachefile="E:/TV_SERIES-SHOWS/STAR WARS - ANDOR/m2ts_211ff87ba58dc8b1d4ad0c161f51910b_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# Setting detected color matrix (709).
clip = core.std.SetFrameProps(clip, _Matrix=1)
# Setting color transfer info (709), when it is not set
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
# Setting color primaries info (BT.709), when it is not set
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# making sure frame rate is set to 24
clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0) # progressive
original = clip
# converting to mod1 compatible format
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, range_s="limited")
clip = core.std.CropRel(clip=clip, left=25, right=25, top=25, bottom=25)# cropping to 1870x1030
# converting to mod1 compatible format
original = core.resize.Bicubic(clip=original, format=vs.YUV444P8, range_s="limited")
original = core.std.CropRel(clip=original, left=25, right=25, top=25, bottom=25)# cropping to 1870x1030
# denoising using MiniDeen
clip = core.minideen.MiniDeen(clip=clip, radius=[4,4,4], threshold=[3,3,3])
# sharpening using DetailSharpen
clip = G41Fun.DetailSharpen(clip=clip, ldmp=0.500, med=True)
# Resizing using 9 - lanczos
clip = core.fmtc.resample(clip=clip, kernel="lanczos", w=1920, h=1080, interlaced=False, interlacedd=False) # resolution 1920x1080 before YUV444P8 after YUV444P16
# vsResizer - Potential resolution problem. (width (1870vs1920) - let Selur know!)
# vsResizer - Potential resolution problem. (height (1030vs1080) - let Selur know!)
# letterboxing 1870x1030 to 1920x1080
original = core.std.AddBorders(clip=original, left=25, right=25, top=25, bottom=25)
# adjusting output color from: YUV444P8 to YUV420P8 for x264Model
original = core.resize.Bicubic(clip=original, format=vs.YUV420P8, range_s="limited")
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited", dither_type="error_diffusion")
# DEBUG: clip: YUV420P8 vs original: YUV420P8
original = core.text.Text(clip=original,text="Original",scale=2,alignment=7)
clip = core.text.Text(clip=clip,text="Filtered",scale=2,alignment=7)
stacked = core.std.StackHorizontal([original,clip])
# set output frame rate to 24fps (progressive)
stacked = core.std.AssumeFPS(clip=stacked, fpsnum=24, fpsden=1)
# Output
stacked.set_output()
The issues seems to happen due to the fact that the 'original' is not resized like the filtered clip, it's probably due to some mixup somewhere.
=> I'll try to reproduce and fix it.

Cu Selur
(07.12.2023, 16:51)Selur Wrote: [ -> ]The issues seems to happen due to the fact that the 'original' is not resized like the filtered clip, it's probably due to some mixup somewhere.
=> I'll try to reproduce and fix it.

Cu Selur


Thanks for looking into it.

Fyi, just updated hybrid  = no dice  Shy = same result !

EDIT: Forgot to mention, that the output result is cutted fine though. Just preview is bit of a mess Big Grin .


cheers,
td
did a small test, didn't happen for me with the latest release
-> test with the release and create a debug output with that version if it still fails for you
This is what happens with current version for me when I try to reproduce your problem:
Code:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'F:/workspace/Hybrid/debug/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="F:/workspace/Hybrid/debug/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="F:/workspace/Hybrid/debug/64bit/vsfilters/DenoiseFilter/MiniDeen/libminideen.dll")
core.std.LoadPlugin(path="F:/workspace/Hybrid/debug/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import G41Fun
# source: 'G:\TestClips&Co\files\MPEG-4 H.264\8.Birds_1080p24fpsRef4-112Mbps.mkv'
# current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, fps: 23.976, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
# Loading G:\TestClips&Co\files\MPEG-4 H.264\8.Birds_1080p24fpsRef4-112Mbps.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="G:/TestClips&Co/files/MPEG-4 H.264/8.Birds_1080p24fpsRef4-112Mbps.mkv", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
# Setting detected color matrix (709).
clip = core.std.SetFrameProps(clip, _Matrix=1)
# Setting color transfer info (709), when it is not set
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
# Setting color primaries info (), when it is not set
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# making sure frame rate is set to 23.976
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0) # progressive
original = clip
# converting to mod1 compatible format
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, range_s="limited")
# clip, new color sampling: YUV444P8, new bit depth: 8
clip = core.std.CropRel(clip=clip, left=25, right=25, top=25, bottom=25)# cropping to 1870x1030
# converting to mod1 compatible format
original = core.resize.Bicubic(clip=original, format=vs.YUV444P8, range_s="limited")
# original, new color sampling: YUV444P8, new bit depth: 8
original = core.std.CropRel(clip=original, left=25, right=25, top=25, bottom=25)# cropping to 1870x1030
# denoising using MiniDeen
clip = core.minideen.MiniDeen(clip=clip, radius=[4,4,4], threshold=[3,3,3])
# sharpening using DetailSharpen
clip = G41Fun.DetailSharpen(clip=clip)
# Resizing using 9 - lanczos
clip = core.fmtc.resample(clip=clip, kernel="lanczos", w=1920, h=1058, interlaced=False, interlacedd=False) # resolution 1920x1058 before YUV444P8 after YUV444P16
original = core.resize.Bicubic(clip=original, width=1920, height=1058)
# adjusting output color from: YUV444P8 to YUV420P8 for x264Model
original = core.resize.Bicubic(clip=original, format=vs.YUV420P8, range_s="limited")
# original, new color sampling: YUV420P8, new bit depth: 8
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited", dither_type="error_diffusion")
# clip, new color sampling: YUV420P8, new bit depth: 8
original = core.text.Text(clip=original,text="Original",scale=2,alignment=7)
clip = core.text.Text(clip=clip,text="Filtered",scale=2,alignment=7)
stacked = core.std.StackHorizontal([original,clip])
# set output frame rate to 23.976fps (progressive)
stacked = core.std.AssumeFPS(clip=stacked, fpsnum=24000, fpsden=1001)
# Output
stacked.set_output()
-> no, you are doing something different than I

Quote:Fyi, just updated hybrid = no dice Shy = same result !
Okay, then I need a step-by-step of what you are doing, since it must be related to some step changing the outcome.

Cu Selur
This is clear to what you are doing:
Code:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'F:/workspace/Hybrid/debug/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="F:/workspace/Hybrid/debug/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="F:/workspace/Hybrid/debug/64bit/vsfilters/DenoiseFilter/MiniDeen/libminideen.dll")
core.std.LoadPlugin(path="F:/workspace/Hybrid/debug/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import G41Fun
# source: 'G:\TestClips&Co\files\MPEG-4 H.264\8.Birds_1080p24fpsRef4-112Mbps.mkv'
# current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, fps: 23.976, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
# Loading G:\TestClips&Co\files\MPEG-4 H.264\8.Birds_1080p24fpsRef4-112Mbps.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="G:/TestClips&Co/files/MPEG-4 H.264/8.Birds_1080p24fpsRef4-112Mbps.mkv", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
# Setting detected color matrix (709).
clip = core.std.SetFrameProps(clip, _Matrix=1)
# Setting color transfer info (709), when it is not set
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
# Setting color primaries info (), when it is not set
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# making sure frame rate is set to 23.976
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0) # progressive
original = clip
# converting to mod1 compatible format
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, range_s="limited")
# clip, new color sampling: YUV444P8, new bit depth: 8
clip = core.std.CropRel(clip=clip, left=25, right=25, top=25, bottom=25)# cropping to 1870x1030
# converting to mod1 compatible format
original = core.resize.Bicubic(clip=original, format=vs.YUV444P8, range_s="limited")
# original, new color sampling: YUV444P8, new bit depth: 8
original = core.std.CropRel(clip=original, left=25, right=25, top=25, bottom=25)# cropping to 1870x1030
# denoising using MiniDeen
clip = core.minideen.MiniDeen(clip=clip, radius=[4,4,4], threshold=[3,3,3])
# sharpening using DetailSharpen
clip = G41Fun.DetailSharpen(clip=clip)
# Resizing using 9 - lanczos
clip = core.fmtc.resample(clip=clip, kernel="lanczos", w=1920, h=1080, interlaced=False, interlacedd=False) # resolution 1920x1080 before YUV444P8 after YUV444P16
original = core.resize.Bicubic(clip=original, width=1920, height=1080)
# adjusting output color from: YUV444P8 to YUV420P8 for x264Model
original = core.resize.Bicubic(clip=original, format=vs.YUV420P8, range_s="limited")
# original, new color sampling: YUV420P8, new bit depth: 8
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited", dither_type="error_diffusion")
# clip, new color sampling: YUV420P8, new bit depth: 8
original = core.text.Text(clip=original,text="Original",scale=2,alignment=7)
clip = core.text.Text(clip=clip,text="Filtered",scale=2,alignment=7)
stacked = core.std.StackHorizontal([original,clip])
# set output frame rate to 23.976fps (progressive)
stacked = core.std.AssumeFPS(clip=stacked, fpsnum=24000, fpsden=1001)
# Output
stacked.set_output()
but there 'original = core.resize.Bicubic(clip=original, width=1920, height=1080)' is present.
=> need a step by step
(07.12.2023, 17:20)Selur Wrote: [ -> ]but there 'original = core.resize.Bicubic(clip=original, width=1920, height=1080)' is present.
=> need a step by step

Sir Selur,

I just have compared your debug with that of mine created with hybrid 2023.012.. 
And i have noticed you didn't have used the exact same settings regarding cropping !

Namely, → Letterbox settings , and some other minor differences !

this is what i'v found in the new debug from hybrid 2023.12 ↓
Code:
clip = core.fmtc.resample(clip=clip, kernel="lanczos", w=1920, h=1080, interlaced=False, interlacedd=False) # resolution 1920x1080 before YUV444P8 after YUV444P16
# vsResizer - Potential resolution problem. (width (1870vs1920) - let Selur know!)
# vsResizer - Potential resolution problem. (height (1030vs1080) - let Selur know!)
# letterboxing 1870x1030 to 1920x1080

that said, now you know  Big Grin  



Cheers,
Pages: 1 2 3