View Full Version : ApplyRange with boolean arguments
florinandrei
15th August 2017, 05:34
I have these filters:
ColorYUV(off_u=-35, off_v=18)
Levels(18, 1.0, 180, 0, 255, coring=false)
I want to apply them to the frame range 0 - 2120, and then again to the range 2179 - 4133. I've tried:
ApplyRange(0, 2120, "ColorYUV", "off_u", -35, "off_v", 18)
ApplyRange(0, 2120, "Levels", 18, 1.0, 180, 0, 255, "coring", "false")
ApplyRange(2179, 4133, "ColorYUV", "off_u", -35, "off_v", 18)
ApplyRange(2179, 4133, "Levels", 18, 1.0, 180, 0, 255, "coring", "false")
But I get errors. I've tried variations, without double quotes, etc, nothing works. What is the right syntax?
Using AviSynth 2.6 from MeGUI.
blaze077
15th August 2017, 05:50
Afaik, ApplyRange requires all the filter arguments upto the one you want to change. Your corrected ApplyRange calls would look like this:
ApplyRange(0, 2120, "ColorYUV", 0, 0, 0, 0, 0, -35, 0, 0, 0, 18)
ApplyRange(0, 2120, "Levels", 18, 1.0, 180, 0, 255, "coring", "false")
ApplyRange(0, 2120, "ColorYUV", 0, 0, 0, 0, 0, -35, 0, 0, 0, 18)
ApplyRange(2179, 4133, "Levels", 18, 1.0, 180, 0, 255, "coring", "false")
For something like this, I suggest using ReplaceFramesSimple (http://avisynth.nl/index.php?title=RemapFrames&redirect=no) since it is much easier and simpler to use.
poisondeathray
15th August 2017, 05:50
I have these filters:
ColorYUV(off_u=-35, off_v=18)
Levels(18, 1.0, 180, 0, 255, coring=false)
I want to apply them to the frame range 0 - 2120, and then again to the range 2179 - 4133. I've tried:
ApplyRange(0, 2120, "ColorYUV", "off_u", -35, "off_v", 18)
ApplyRange(0, 2120, "Levels", 18, 1.0, 180, 0, 255, "coring", "false")
ApplyRange(2179, 4133, "ColorYUV", "off_u", -35, "off_v", 18)
ApplyRange(2179, 4133, "Levels", 18, 1.0, 180, 0, 255, "coring", "false")
But I get errors. I've tried variations, without double quotes, etc, nothing works. What is the right syntax?
Using AviSynth 2.6 from MeGUI.
Did you mean to use static values? If so, it's probably easier to use trim()
I assume you have a clip after 4134 unfiltered. If not, just erase that last part
orig=last
orig.trim(0,2120).ColorYUV(off_u=-35, off_v=18).Levels(18, 1.0, 180, 0, 255, coring=false) ++ \
orig.trim(2121,2178) ++ \
orig.trim(2179,4133).ColorYUV(off_u=-35, off_v=18).Levels(18, 1.0, 180, 0, 255, coring=false) ++ \
orig.trim(4134,0)
or remapframes like blaze077 suggested is a better idea if you're going to be applying many parts
florinandrei
17th August 2017, 10:14
Afaik, ApplyRange requires all the filter arguments upto the one you want to change. Your corrected ApplyRange calls would look like this:
ApplyRange(0, 2120, "ColorYUV", 0, 0, 0, 0, 0, -35, 0, 0, 0, 18)
ApplyRange(0, 2120, "Levels", 18, 1.0, 180, 0, 255, "coring", "false")
ApplyRange(0, 2120, "ColorYUV", 0, 0, 0, 0, 0, -35, 0, 0, 0, 18)
ApplyRange(2179, 4133, "Levels", 18, 1.0, 180, 0, 255, "coring", "false")
It's possible that was the reason. I've switched to RGB to fix an unrelated issue, and this sequence works just fine - but the non-default parameters are at the beginning (r, g, and b):
ApplyRange(0, 2120, "RGBAdjust", 2.03, 1.53, 0.94)
ApplyRange(2179, 4134, "RGBAdjust", 2.03, 1.53, 0.94)
4134 is actually the last frame in the clip, but if I say ApplyRange(2179,0,"RGBAdjust",...) then I get an error. I have to specify the actual value for the last frame.
StainlessS
17th August 2017, 11:52
This is a whole lot simpler. (esp if lots of ranges)
Avisource("F:\v\cabaret.avi").ConvertToRGB24
src=Last
FIXED = RGBAdjust( 2.03, 1.53, 0.94)
SCMD="""
1 0,2120 # Replace frames 0 to 2120 with same frames from clip 1 (FIXED)
1 2179,4134 # Or instead of 4134, 0 is till end of clip.
"""
SHOW=True
Return ClipClop(src,FIXED,scmd=SCMD,show=SHOW)
ClipClop:- https://forum.doom9.org/showthread.php?t=162266&highlight=clipclop
Or ReplaceFramesSimple would do just as well, but I know my own plug and dont offhand know args for the other one.
EDIT:ClipClop supports up to 255 replacement clips, just give a different clip index.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.