Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th August 2020, 01:29   #3941  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by Myrsloik View Post
Sounds right with those values. Why do you think it should be something else?
I think it should take RGB values and converted it to the destine format implicitly, because at the end of the day, we only need to produce a simple colored blankclip, people shouldn't need to look up the equation on their own in order to convert RGB value to YUV.
lansing is offline   Reply With Quote
Old 7th August 2020, 01:40   #3942  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 321
yeah, it is yuv because of format, is value 220 as 8 bit? For 16 bit it would be:
Code:
clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV444P16)
MaxSize16bit = 2**16-1
color_clip = core.std.BlankClip(clip_yuv16, color=[0, 0, 220/255*MaxSize16bit])
color_clip.set_output()
setting colors in yuv could get weird if not gray, better set it in RGB and then convert it
_Al_ is offline   Reply With Quote
Old 7th August 2020, 04:29   #3943  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by _Al_ View Post
yeah, it is yuv because of format, is value 220 as 8 bit? For 16 bit it would be:
Code:
clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV444P16)
MaxSize16bit = 2**16-1
color_clip = core.std.BlankClip(clip_yuv16, color=[0, 0, 220/255*MaxSize16bit])
color_clip.set_output()
setting colors in yuv could get weird if not gray, better set it in RGB and then convert it
Is the "color" argument ordered as R,G,B? Because RGB(0,0,220) should be blue but the function gave me red.
lansing is offline   Reply With Quote
Old 7th August 2020, 04:50   #3944  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 321
If format is YUV or attribute clip has that format then it is [Y,U,V].
To start as RGB you'd need one more conversion line, to set your 8bit 220 blue for final YUV 16bit for exampler:
Code:
color_clip = core.std.BlankClip(format=vs.RGB24, color=[0,0,220])
color_clip = color_clip.resize.Point(format=vs.YUV444P16, matrix_s='709')
color_clip.set_output()
_Al_ is offline   Reply With Quote
Old 7th August 2020, 08:34   #3945  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by lansing View Post
I think it should take RGB values and converted it to the destine format implicitly, because at the end of the day, we only need to produce a simple colored blankclip, people shouldn't need to look up the equation on their own in order to convert RGB value to YUV.
I give full control to the user. It makes no sense to not allow the user to set certain YUV values that can't be represented as RGB. If you say "automatic conversion" I simply say: which matrix and transfer function?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 7th August 2020, 08:34   #3946  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
ShufflePlanes should automatically strip the "_Matrix" property if the target color family is vs.GRAY. otherwise an error message pops up bitchin' about "no _Matrix stuff allowed for GRAY" or whatever and you have to manually remove the "_Matrix" thingy before ShufflePlanes which is very annoying.
feisty2 is offline   Reply With Quote
Old 7th August 2020, 08:47   #3947  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
you can reproduce the error using the following script

Code:
clp = core.std.BlankClip(format=vs.YUV444PS)
clp = core.fmtc.matrix(clp, "601")
clp = core.std.ShufflePlanes(clp, 0, vs.GRAY) # Resize error 1026: GRAY color family cannot have RGB matrix coefficients
feisty2 is offline   Reply With Quote
Old 7th August 2020, 09:48   #3948  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Can reproduce with R51 and also with R51-audio-test5.

Did you copy the text? Because my GRAY is spelled GREY here:
Code:
Resize error 1026: GREY color family cannot have RGB matrix coefficients
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 7th August 2020, 09:57   #3949  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
nah, I was replying on my phone so I typed the error message shown on my computer, I didn't pay that much attention to the spelling of each word while I was typing
feisty2 is offline   Reply With Quote
Old 7th August 2020, 10:05   #3950  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by feisty2 View Post
ShufflePlanes should automatically strip the "_Matrix" property if the target color family is vs.GRAY. otherwise an error message pops up bitchin' about "no _Matrix stuff allowed for GRAY" or whatever and you have to manually remove the "_Matrix" thingy before ShufflePlanes which is very annoying.
There's no right answer here. Often it's reassembled again and then you want the matrix to be carried over.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 10th August 2020, 16:46   #3951  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Found another memory leak when calling the evaluateScript function:
https://forum.doom9.org/showthread.p...41#post1920641

Way to reproduced it, with vseditor 2, load a script, open the PF window, and spam switching between the YUV channels (it is calling evaluateScript internally). memory would kept going up and wouldn't come down even when the script was closed.
lansing is offline   Reply With Quote
Old 11th August 2020, 08:42   #3952  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Quote:
Originally Posted by ChaosKing View Post
I tried using this construct. VsEditor checks it OK but when I run virtualdub hangs. My code is
Code:
base = core.vcmove.deBarrel(ret,a = 0.05, b= 0.05, c = 0.05,test = 1)
def animator(n,clip):
	if n > 20:
		return clip
	else:
		return core.vcmove.deBarrel(ret,a = n * 0.0025 + 0.0005, b= 0.05, c = 0.05, test = 1)
ret = core.std.FrameEval(base,functools.partial(animator,clip=base))
Whats wrong with my code?
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 11th August 2020, 09:03   #3953  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Shouldn't it be vcmove.DeBarrel ?

You have a type. it should be clip and not ret
Code:
return core.vcmove.deBarrel(ret,a = n * 0.0025 + 0.0005, b= 0.05, c = 0.05, test = 1)
Check only can not spot every error, use the preview function in vsedit, because it is triggert on frame request.

EDIT
ok check does spot this error too...

EDIT2
Oh and YUV444 (10-32bit) produces a green image, rgb & YUV444P8 looks both okay.



EDIT3
only RGB24 is ok higher precision is also broken for rgb.
Or is it just not supported?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 11th August 2020 at 09:20.
ChaosKing is offline   Reply With Quote
Old 11th August 2020, 12:14   #3954  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Thanks to @ChaosKing. Now I am changing the name to deBarrel. It is in my computer. Not yet uploaded. I will address issues pointed out by you.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 15th August 2020, 20:08   #3955  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
fun stuff: https://github.com/IFeelBloated/Vapo.../VaporMagik.py
tired of the verbosity of filter calling syntax? cannot patch cython types like vs.VideoNode and list?
with VaporMagik, no more
Code:
clip = core.std.StackHorizontal([clip, core.std.Expr([clip, Adjust(clip, -0.4)], "x y + 2 /")])
instead, you can use the member function calling syntax, like in avisynth!
feisty2 is offline   Reply With Quote
Old 15th August 2020, 21:40   #3956  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by feisty2 View Post
fun stuff: https://github.com/IFeelBloated/Vapo.../VaporMagik.py
tired of the verbosity of filter calling syntax? cannot patch cython types like vs.VideoNode and list?
with VaporMagik, no more
Code:
clip = core.std.StackHorizontal([clip, core.std.Expr([clip, Adjust(clip, -0.4)], "x y + 2 /")])
instead, you can use the member function calling syntax, like in avisynth!
Interesting alternative. Btw, what happens if there are duplicate function names in different plugins?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 16th August 2020, 07:52   #3957  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
https://github.com/Endilll/vapoursyn...dafeca718fbc4d - yet another way to do that (it's just enough to call core.augment(locals) after imports).
__________________
Me on GitHub
PC Specs: Ryzen 5950X, 64 GB RAM, RTX 2070
DJATOM is offline   Reply With Quote
Old 16th August 2020, 09:00   #3958  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by Myrsloik View Post
Interesting alternative. Btw, what happens if there are duplicate function names in different plugins?
C++ filters, user defined python functions and other attributes are currently manually registered thru the Injector object, I haven't decided a proper way to auto-register everything but for manual attribute registration, the user can specify unique names for attributes with conflicting symbols or define some customized logic to manually solve the conflicts
Code:
def Super(self, *args, **kw):
    if self.format.bits_per_sample == 32:
        return core.mvsf.Super(self, *args, **kw)
    else:
        return core.mv.Super(self, *args, **kw)

Injector.TargetType = VideoNode
Injector["Super"] = Super

clp1 = core.std.BlankClip(format = GRAYS)
clp2 = core.std.BlankClip(format = GRAY16)
clp1 = clp1.Super() # calls core.mvsf.Super
clp2 = clp2.Super() # calls core.mv.Super
the Injector object is also capable of dynamically attaching attributes to built-in types like list or str to enable magic syntax like these:
Code:
clp = [clp1, clp2].Expr("x y + 2 /")
clp = "x y + 2 /".Render([clp1, clp2])
ideas on how to solve name conflicts of different plugins or even conflicts between C++ filters and python functions for auto-registration are welcome!
feisty2 is offline   Reply With Quote
Old 17th August 2020, 12:44   #3959  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 87
How do I use std.AssumeFPS but still keep the original duration?
Jukus is offline   Reply With Quote
Old 17th August 2020, 13:30   #3960  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
If you change the duration of every frame, but keep the number of frames constant, the overall playtime must change as well. Rule of proportion.

Typical example: "PAL speedup" – changing the frame rate from 24 fps to 25 fps causes a 1/25 shorter playtime.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Reply

Tags
speed, vaporware, vapoursynth

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.