Log in

View Full Version : Show values to correct video based on single frames?


bcn_246
30th January 2017, 09:49
Hey,

I am working on a project were I have a longer version of a source with poor colour/brightness/RGB and a higher quality shorter version with much better colours/brightness/RGB etc...

Is there some way to analyse a single frame from both and then see what needs to be adjusted in order for the extended source to match? They are pretty much identical in terms of the frame size (a bit of cropping and resizing is all that is needed).

Ideally I would be looking for a way for Avisynth to output some kind of log, showing the differences, i.e. Levels = -11, +1.3, +16, Saturation = -1.2, Red = +5, Green = - 2, Blue =-7... basically logging all the variables than can be adjusted using Tweak. I could then adjust the lower quality source accordingly.

Obviously it would be a good idea to sample multiple frames (say, 5 or 10) and then take the average in order to calculate Tweak() adjustments in order to get as close a match as possible. I can then splice the matched and cleaned extended content in with the shorter version.

I tried to see if Photoshop could colour matching two frames (which it did very well), but could not figure out how to have it tell me what changes had been made for me to replicate in an Avisynth script.

Any ideas?

Thanks in advance,

Ben

videoFred
30th January 2017, 12:13
Hello Ben,

Perhaps GamMatch? (post #66)

http://forum.doom9.org/showthread.php?t=173695&page=4

Fred.

jmac698
30th January 2017, 13:46
Yes,
try my findtweak but for each of r,g,b
http://forum.doom9.org/archive/index.php/t-161960.html

http://forum.doom9.org/archive/index.php/t-162460.html
could try colorlike also

StainlessS
2nd February 2017, 02:42
JMac698,

Moved post from here to your thread on FindTweak:- http://forum.doom9.org/archive/index.php/t-161960.html

EDIT: Dont know why but the link keeps coming up as https.
EDIT: Arh, its coming up as an archive page, new version Firefox seems to be making everything https.

StainlessS
2nd February 2017, 17:05
Answering this post by V.C. Mohan linked in prev post above.

My HistograAdjust plugin for avisynth 2.6 or Histogram function of modPlus plugin for newer avisynth+ has a facility to match with a specified frame of any (other ) clip.

I'm posting here as I thought best place as bcn_246 may not visit developer forum very often.

Tried your filter VC, pretty good that it works at all, but not brilliant. A few frames were very bad (where low contrast almost single color intro and exit clip seq).


Used clip converted to AVI and then passed through GamMac() with Scale=2, to remove red cast,
here original source (with red cast):- http://forum.doom9.org/showthread.php?p=1737852#post1737852


# VcMFix.avs

Function Sub(clip c,string tit) {
StackVertical(c.BlankClip(height=20).ScriptClip("""Subtitle(RT_String("%d] %s",current_frame,tit))""",Args="tit",Local=true),c)
}

FN = "../ParadeFixed.Avi" # Some clip I had to hand [ Cheers John :) ].
dc = AviSource(FN)
c = dc

# Make synthesized bad Luma
c = c.Levels(0,1.5,255,32,255-32,coring=false)
mf=274 # EDIT: Guy on horsey
mffrm=dc.trim(mf,-1).loop(dc.FrameCount,0,0)

HistogramAdjust(c,type=3,mclip=dc,mf=mf)

TOP = StackHorizontal(Sub(c,"SynthSrc (synthesized bad luma)"),Sub(dc,"RealSrc"))
BOT = StackHorizontal(Sub(mffrm,"Histogram Src"),Sub(Last,"Result (SynthSrc Matchto HorseyGuy)"))
return StackVertical(TOP,BOT)



Pretty average frame result (I did not go hunting for too long to find best possible, which would be the dc frame, guy on a horse as prev posted)

https://s20.postimg.cc/w6ewbxvul/3208_zpshgmrvfb3.png (https://postimg.cc/image/wj6ai4e49/)

And pretty bad frame but probably not the worst either
https://s20.postimg.cc/orpkjk9z1/496_zpssfpoy6lu.png (https://postimg.cc/image/dfcz1s1a1/)

EDIT: To be fair, the synthetic gamma twist, probably made it difficult to do anything well for single frame sample to fix entire clip.

EDIT: NOTE, Limit default is 20 not as documented 100.
EDIT: Scrub above, tests for Limit below 1 and above 100 using default of 20, but later uses default of 100 when calling constructor,
so will not actually prove a problem, although is a little bit indecisive :)

EDIT: Re-upped with horsey guy histogram source.

EDIT: Setting limit to say 25 on 2nd pic does remove most of the the garbage, however stays too much like SynthSrc.