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. |
|
|
Thread Tools | Search this Thread | Display Modes |
14th May 2018, 15:40 | #1 | Link |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Color adjustments in RGB colorspace supporting ConditionalReader?
Is there any color adjusting plugin that works in RGB colorspace that supports ConditionalReader (or a similar way to vary parameters on a frame by frame basis) and high bit depth (>8-bit)?
Basically I'm looking for a RGB equivalent to the built in AVIsynth filter ColorYUV. RGBAdjust is similar and built in, but doesn't have a conditional argument. My quick search for such a filter didn't find anything even ignoring my desire to work in >8-bit RGB color. |
14th May 2018, 22:37 | #2 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
You can use RGBAdjust inside ScriptClip, something like this (not tested)
Code:
ScriptClip(""" RGBAdjust(r=xyx_r, rg=xyx_rg) """) ConditionalReader("r.txt", "xyx_r", false) ConditionalReader("rg.txt", "xyx_rg", false) Last edited by raffriff42; 14th May 2018 at 22:56. Reason: global |
14th May 2018, 23:53 | #3 | Link | |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Quote:
Code:
ScriptClip(clip, " RGBAdjust(rb=(xyx_rb), gb=(xyx_gb), bb=(xyx_bb)) ") ConditionalReader("r_levels_t2.txt", "xyx_rb", false) ConditionalReader("b_levels_t2.txt", "xyx_gb", false) ConditionalReader("g_levels_t2.txt", "xyx_bb", false) |
|
15th May 2018, 00:09 | #4 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Raff was just making it a bit more bullet proof for you.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
15th May 2018, 00:13 | #5 | Link |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
I couldn't get it to work as he wrote it with the triple quotes. However, after being prompted by your post to take another look at it I see the triple quotes are messing with MP_Pipeline, which nests the entire script inside of triple quotes.
|
15th May 2018, 00:18 | #7 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Avisynth does not support eg 5 pairs of quotes (so as to be able to enclose both triple and single quotes), which can make things awkward.
(Other languages eg BASIC allow for 5 pairs [EDIT: and maybe 7 pairs of double] quotes [methinks]). Code:
SSS=""" Subtitle("Current frame = " + String(current_frame), align=5) """ Scriptclip(SSS) EDIT: Not sure how you use the mp_pipeline thing, maybe something like so Code:
SSS=""" Subtitle("Current frame = " + String(current_frame), align=5) """ mp_pipeline("Scriptclip(SSS)") EDIT: And the SSS= """ ... """ thing is nothing to do with the 'ssS' on the end of my username, I usually use to signify a triple quoted string, although some times as 'main source string' where S used for a substring of it.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 16th May 2018 at 13:35. |
16th May 2018, 10:44 | #10 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Most modern languages provide facilities for both line breaks and various quote characters inside string literals, and usually some form of variable interpolation as well. Heredocs provide the first in languages such as Perl (and in Perl also the third), but what Avisynth script really lacks is an escape character (e.g. backslash) to provide the second. In languages that don’t have heredocs, multi-line string literals are sometimes provided via some special quote character (c.f. JavaScript, which uses `backticks` for this). The triple quote serves the same purpose in Avisynth script, but you can’t escape it.
Last edited by TheFluff; 16th May 2018 at 10:47. |
4th June 2018, 10:23 | #11 | Link |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Does using Scriptclip + RGBAdjust leak memory for anyone else? Both 32-bit and 64-bit Avisynth+ leak memory for me when used on 16-bit RGB. With DVD res (720x480) by about 10,000 frames in it has grown to about 4GB. In 32-bit it either crashes or simply stops adjusting the levels passing the video through unaffected. In 64-bit it just keeps growing.
I'm out of town and only discovered this as I was packing so I didn't have a lot of time to troubleshoot it or try to make a simple script showing the issue. I'm pretty sure it is the Scriptclip + RGB adjust portion that's the problem as the same script with ColorYUV (using conditional processing) doesn't have the issue. |
4th June 2018, 10:54 | #12 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Good catch, I could reproduce the leak. It's there even at 8 bits but the internal lookup table for 16 bit is 128k, so it eats your memory faster.
EDIT: leak stopped EDIT: conditional=true supported, like in colorYUV EDIT: works now with 32 bit float (but no 'dither', and no 'analyze') EDIT: check Avs+ r2700 test build Last edited by pinterf; 4th June 2018 at 15:05. Reason: problem fixed |
5th June 2018, 06:55 | #13 | Link | |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Quote:
I'll check it out when I'm back in town, but that won't be a few days. |
|
9th June 2018, 21:26 | #14 | Link | |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Quote:
IMHO, RGBAdjust is still missing at least one argument. Some sort of bit depth or scaling argument that can be used to scale the values in the file for the bias values. The ability to apply a formula would be useful too. When using ScriptClip I can do this: Code:
ScriptClip(source, " RGBAdjust(rb=(xyx_b*256), gb=(xyx_b*256), bb=(xyx_b*256), r=(1-xyx_b/256), g=(1-xyx_b/256), b=(1-xyx_b/256)) ") ConditionalReader("levels_t.txt", "xyx_b", false) Code:
RGBAdjust(source, conditional=true ConditionalReader(("levels_t.txt"*256), "rgbadjust_rb", false) ConditionalReader(("levels_t.txt"*256), "rgbadjust_gb", false) ConditionalReader(("levels_t.txt"*256), "rgbadjust_bb", false) ConditionalReader((1-"levels_t.txt"/256), "rgbadjust_r", false) ConditionalReader((1-"levels_t.txt"/256), "rgbadjust_g", false) ConditionalReader((1-"levels_t.txt"/256), "rgbadjust_b", false) |
|
|
|