Reclusive Eagle
18th January 2022, 21:23
I'm trying to make an edge mask however when using algorithms where it applies to the whole clip and not a specific plane the result is a green white mess.
How do I convert YUV to Y only. I am only interested in the Luma layer for my mask and the edge mask I am using can not specify planes.
Do I use Fmtconv, resize? etc
Or is there a way to tell a plugin to target only a specific plane without needing the plugin to have it built in
poisondeathray
18th January 2022, 21:36
http://www.vapoursynth.com/doc/functions/video/shuffleplanes.html
clip = core.std.ShufflePlanes(clip, planes=[0], colorfamily=vs.GRAY)
Reclusive Eagle
18th January 2022, 21:41
http://www.vapoursynth.com/doc/functions/video/shuffleplanes.html
clip = core.std.ShufflePlanes(clip, planes=[0], colorfamily=vs.GRAY)
Thank god for people like you Poison. Was getting spammed with "vapoursynth.Error: resample: specified output colorspace is not compatible with input"
Thanks for your help!
_Al_
19th January 2022, 00:23
There was a convenient function SplitPlanes() added for API4:
Y,U,V = clip.std.SplitPlanes()
or
Y = clip.std.SplitPlanes()[0]
VoodooFX
20th January 2022, 19:15
@Selur
You mixed up the threads, "that" discussion is going over there: https://forum.doom9.org/showthread.php?t=183717 ;)
Selur
20th January 2022, 20:22
You are so right. :) -> deleted post.
Here's a small sample where I take a source, split it and stack
original | Y
U | U
# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# source: 'G:\TestClips&Co\files\test.avi'
# current color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading source using FFMS2
clip = core.ffms2.Source(source="G:/TestClips&Co/files/test.avi",cachefile="E:/Temp/avi_6c441f37d9750b62d59f16ecdbd59393_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Bicubic(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
original = clip
clipY,clipU,clipV = core.std.SplitPlanes(clip)
clipY = core.text.Text(clip=clipY,text="Y",alignment=7,scale=1)
clipY = core.resize.Bicubic(clip=clipY, width=clip.width, height=clip.height, format=vs.YUV420P8, range_s="limited")
clipU = core.text.Text(clip=clipU,text="U",alignment=7,scale=1)
clipU = core.resize.Bicubic(clip=clipU, width=clip.width, height=clip.height, format=vs.YUV420P8, range_s="limited")
clipV = core.text.Text(clip=clipV,text="V",alignment=7,scale=1)
clipV = core.resize.Bicubic(clip=clipV, width=clip.width, height=clip.height, format=vs.YUV420P8, range_s="limited")
stacked = core.std.StackVertical([core.std.StackHorizontal([clip,clipY]), core.std.StackHorizontal([clipU,clipV])])
# set output frame rate to 25.000fps
stacked = core.std.AssumeFPS(clip=stacked, fpsnum=25, fpsden=1)
# Output
stacked.set_output()
https://i.ibb.co/XXScfCw/oyuv.png (https://ibb.co/gyzkbRn)
Cu Selur
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.