View Full Version : Saving YUV as three separate b&w videos.
Cary Knoop
18th July 2020, 00:55
I know I can use ShufflePlanes to extract the Y, U, and V planes, but is there a way to save those individual planes as three separate B&W videos for individual processing in a single script to be merged at a later stage in another script?
_Al_
18th July 2020, 01:21
You are thinking having three scripts for each plane and then forth script to load results? Try this.
Y = [core.std.ShufflePlanes(clip, planes=0, colorfamily=vs.GRAY)] #load Y
#process Y
#other scripts that proce U or V
#in forth script you load those scripts (it is just python object, so same rules should apply, things to watch for is vs though)
import script_Y
import script_U
import script_V
yuv = core.std.ShufflePlanes(clips = [script_Y.Y, script_U.U, script_V.V], planes= [0,0,0], colorfamily=vs.YUV)
yuv.set_output() #use this always below lines that load clips so vs would not override those script imports
feisty2
18th July 2020, 03:43
you don't need separate files if it's YCbCr 4:4:4, you can store it as an interleaved grayscale video
# 4:4:4 clip
Y = core.std.ShufflePlanes(clip, 0, vs.GRAY)
Cb = core.std.ShufflePlanes(clip, 1, vs.GRAY)
Cr = core.std.ShufflePlanes(clip, 2, vs.GRAY)
clip = core.std.Interleave([Y, Cb, Cr])
Cary Knoop
18th July 2020, 04:03
Thanks folks!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.