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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th May 2018, 15:40   #1  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 961
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.
Stereodude is offline   Reply With Quote
Old 14th May 2018, 22:37   #2  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,376
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)
Edit - remember the variables are global, so give them names that are unique within the script (and any Imported scripts too)

Last edited by raffriff42; 14th May 2018 at 22:56. Reason: global
raffriff42 is offline   Reply With Quote
Old 14th May 2018, 23:53   #3  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 961
Quote:
Originally Posted by raffriff42 View Post
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)
Edit - remember the variables are global, so give them names that are unique within the script (and any Imported scripts too)
Thanks. The idea works. I think you have too many "" though. This is what I got to work.
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)
Stereodude is offline   Reply With Quote
Old 15th May 2018, 00:09   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,582
Quote:
The idea works. I think you have too many "" though.
As provided by RaffRiff42, triple quotes allows for use of single quoted strings within Scriptclip, otherwise not allowed.
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 ???
StainlessS is online now   Reply With Quote
Old 15th May 2018, 00:13   #5  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 961
Quote:
Originally Posted by StainlessS View Post
As provided by RaffRiff42, triple quotes allows for use of single quoted strings within Scriptclip, otherwise not allowed.
Raff was just making it a bit more bullet proof for you.
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.
Stereodude is offline   Reply With Quote
Old 15th May 2018, 00:13   #6  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,376
Cool, glad it worked. The triple quotes (""") are legit actually. They are for nested quotations. Example:
Code:
ScriptClip("""
Subtitle("Current frame = " + String(current_frame), 
\ align=5)
""")
raffriff42 is offline   Reply With Quote
Old 15th May 2018, 00:18   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,582
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)
So can use as above, for use with your MP_Pipeline thing.

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: I sometimes use the Multi-Instance template model developed by Gavino and Martin53, to get around the missing 5 pairs of double quotes thing.

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.
StainlessS is online now   Reply With Quote
Old 15th May 2018, 20:39   #8  |  Link
davidhorman
I'm the Doctor
 
Join Date: Jan 2004
Posts: 1,410
Does Avisynth need an <<<EOF type delimiter (heredoc)?
__________________
My AviSynth filters / I'm the Doctor
davidhorman is offline   Reply With Quote
Old 16th May 2018, 01:53   #9  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,376
I dunno, it might be nicer to work with (triple quotes mess with my editor's syntax highlighting) but unless the strings can be nested, you will have the same problem.
raffriff42 is offline   Reply With Quote
Old 16th May 2018, 10:44   #10  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,012
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.
TheFluff is online now   Reply With Quote
Reply

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 23:32.


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