Log in

View Full Version : Visual quality compare plugin


Livesms
6th June 2016, 20:56
Is there any avisynth plugin to provide comparing of two video for visual quality (how similiar it looks to original in fact, not in ephemeral PSNR)

colours
6th June 2016, 21:11
Compare how?

If you want to quickly flip between two videos (or two different versions of the same video), you can use the builtin Interleave(), or load the videos in separate tabs in AvsPmod and switch between the tabs.

If you want to make minor differences obvious, apply Histogram("luma") to both videos and then do the above.

If you want to look at where two videos differ, use:
mt_makediff(source, another_source, chroma="process")
mt_lut("x 128 - 10 * 128 +", chroma="process")

(What the heck does ephemerality have to do with PSNR?)

Groucho2004
6th June 2016, 21:21
In addition to colours' suggestions above - Stack the two streams with stackhorizontal()/stackvertical(). This can be combined with crop() in order to display a certain part of the frame.

Reel.Deel
6th June 2016, 21:47
If you want to look at where two videos differ, use:
mt_makediff(source, another_source, chroma="process")
mt_lut("x 128 - 10 *", chroma="process")


I still use this from time to time:

If what you want to know is where the filter has a nonzero effect, mt_lutxy(original,filtered,"x y - abs 255 *",u=-128,v=-128) will tell you that for luma.

Livesms
6th June 2016, 22:21
No. I want to compare different results produced with different settings for QTGMC for the same video.
From original interlaced video I made progressive (with QTGMC - Placebo) as "reference" and want to compare the results (after being encoded with x264) with another settings (Fast / Medium / Slow) with "reference" result.

With Compare i got PSNR results
QTGMC_Placebo 40,8847
QTGMC_Very_Slow 40,3439
QTGMC_Slower 39,6692
QTGMC_Slow 39,0918
QTGMC_Medium 38,3434
QTGMC_Fast 38,2832
QTGMC_Faster 38,3055
QTGMC_Very_Fast 38,0487
QTGMC_Super_Fast 37,5636
QTGMC_Draft 36,1356


But in fact on PSNR values video seems to be not very different. But watching it gives sometimes another results.
Seems like "Fast" mode preserves more detail (but gives more ringing which is not so seen with eye), and "Medium" gives more smooth picture (and without ringings get the better PSNR)...

Groucho2004
6th June 2016, 22:33
But in fact on PSNR values video seems to be not very different. But watching it gives sometimes another results.
You do know that the unit of measure for PSNR is decibels and that it has a logarithmic scale, right?

colours
6th June 2016, 23:06
Reel.Deel: lol, thanks for reminding me of this one sentence I wrote two years ago:

If you're asking for help with something and you think you've got parts of it figured out by yourself, don't just ask for the parts you haven't gotten figured out, because it can turn out that you were doing it wrong all along when other people try to help you with it.

Anyway.

But in fact on PSNR values video seems to be not very different. But watching it gives sometimes another results.
Seems like "Fast" mode preserves more detail (but gives more ringing which is not so seen with eye), and "Medium" gives more smooth picture (and without ringings get the better PSNR)...

Congratulations, it looks like you've found out that QTGMC's speed/quality tradeoff isn't perfect! Many parameters are changed between presets, and it's not necessarily the case that placebo looks better than medium so you shouldn't be using it as a reference in the first place. Stick to the defaults unless you're willing to invest a lot of time into messing with settings, and use your eyes. Never trust the objective metrics, and especially so if there isn't even a usable reference to test against.

raffriff42
6th June 2016, 23:17
There's SSIM, preferred by some over PSNR:
https://en.wikipedia.org/wiki/Structural_similarity
Plugin here:
http://forum.doom9.org/showpost.php?p=370060

I have tried both PSNR (http://avisynth.nl/index.php/Compare) and SSIM, but don't find that either number is very helpful when comparing clips; I prefer to use Interleave, difference and/or Stack, as suggested above. But you should try SSIM and see if it works for you.

GMJCZP
7th June 2016, 02:19
Try MSU VQMT.

MysteryX
7th June 2016, 04:44
What I do to compare small video differences with different settings is to open the various script variants in various MPC-HC players and set all instances to the same frame (Go To Frame n)

Then I open the first instance and using the Windows task bar hover in and out the other instances so that the image flips between the variants.

hydra3333
7th June 2016, 04:53
for a purely subjective visual comparison, something a bit like this ?
compareBox8(clipBEFORE,"before",clipAFTER,"after") ++ compareBox8(clipAFTER,"after",clipBEFORE,"before")
#
Function compareBox2(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/2,0*hClip/2,-1*wClip/2,-1*hClip/2).subtitle(aSub,size=10), \
b.crop(1*wClip/2,0*hClip/2,-0*wClip/2,-1*hClip/2).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/2,1*hClip/2,-1*wClip/2,-0*hClip/2).subtitle(bSub,size=10), \
a.crop(1*wClip/2,1*hClip/2,-0*wClip/2,-0*hClip/2).subtitle(aSub,size=10)))
}
Function compareBox4(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/4,0*hClip/4,-3*wClip/4,-3*hClip/4).subtitle(aSub,size=10), \
b.crop(1*wClip/4,0*hClip/4,-2*wClip/4,-3*hClip/4).subtitle(bSub,size=10), \
a.crop(2*wClip/4,0*hClip/4,-1*wClip/4,-3*hClip/4).subtitle(aSub,size=10), \
b.crop(3*wClip/4,0*hClip/4,-0*wClip/4,-3*hClip/4).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/4,1*hClip/4,-3*wClip/4,-2*hClip/4).subtitle(bSub,size=10), \
a.crop(1*wClip/4,1*hClip/4,-2*wClip/4,-2*hClip/4).subtitle(aSub,size=10), \
b.crop(2*wClip/4,1*hClip/4,-1*wClip/4,-2*hClip/4).subtitle(bSub,size=10), \
a.crop(3*wClip/4,1*hClip/4,-0*wClip/4,-2*hClip/4).subtitle(aSub,size=10)), \
stackhorizontal(a.crop(0*wClip/4,2*hClip/4,-3*wClip/4,-1*hClip/4).subtitle(aSub,size=10), \
b.crop(1*wClip/4,2*hClip/4,-2*wClip/4,-1*hClip/4).subtitle(bSub,size=10), \
a.crop(2*wClip/4,2*hClip/4,-1*wClip/4,-1*hClip/4).subtitle(aSub,size=10), \
b.crop(3*wClip/4,2*hClip/4,-0*wClip/4,-1*hClip/4).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/4,3*hClip/4,-3*wClip/4,-0*hClip/4).subtitle(bSub,size=10), \
a.crop(1*wClip/4,3*hClip/4,-2*wClip/4,-0*hClip/4).subtitle(aSub,size=10), \
b.crop(2*wClip/4,3*hClip/4,-1*wClip/4,-0*hClip/4).subtitle(bSub,size=10), \
a.crop(3*wClip/4,3*hClip/4,-0*wClip/4,-0*hClip/4).subtitle(aSub,size=10)))
}
Function compareBox8(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/8,0*hClip/8,-7*wClip/8,-7*hClip/8).subtitle(aSub,size=10), \
b.crop(1*wClip/8,0*hClip/8,-6*wClip/8,-7*hClip/8).subtitle(bSub,size=10), \
a.crop(2*wClip/8,0*hClip/8,-5*wClip/8,-7*hClip/8).subtitle(aSub,size=10), \
b.crop(3*wClip/8,0*hClip/8,-4*wClip/8,-7*hClip/8).subtitle(bSub,size=10), \
a.crop(4*wClip/8,0*hClip/8,-3*wClip/8,-7*hClip/8).subtitle(aSub,size=10), \
b.crop(5*wClip/8,0*hClip/8,-2*wClip/8,-7*hClip/8).subtitle(bSub,size=10), \
a.crop(6*wClip/8,0*hClip/8,-1*wClip/8,-7*hClip/8).subtitle(aSub,size=10), \
b.crop(7*wClip/8,0*hClip/8,-0*wClip/8,-7*hClip/8).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/8,1*hClip/8,-7*wClip/8,-6*hClip/8).subtitle(bSub,size=10), \
a.crop(1*wClip/8,1*hClip/8,-6*wClip/8,-6*hClip/8).subtitle(aSub,size=10), \
b.crop(2*wClip/8,1*hClip/8,-5*wClip/8,-6*hClip/8).subtitle(bSub,size=10), \
a.crop(3*wClip/8,1*hClip/8,-4*wClip/8,-6*hClip/8).subtitle(aSub,size=10), \
b.crop(4*wClip/8,1*hClip/8,-3*wClip/8,-6*hClip/8).subtitle(bSub,size=10), \
a.crop(5*wClip/8,1*hClip/8,-2*wClip/8,-6*hClip/8).subtitle(aSub,size=10), \
b.crop(6*wClip/8,1*hClip/8,-1*wClip/8,-6*hClip/8).subtitle(bSub,size=10), \
a.crop(7*wClip/8,1*hClip/8,-0*wClip/8,-6*hClip/8).subtitle(aSub,size=10)), \
stackhorizontal(a.crop(0*wClip/8,2*hClip/8,-7*wClip/8,-5*hClip/8).subtitle(aSub,size=10), \
b.crop(1*wClip/8,2*hClip/8,-6*wClip/8,-5*hClip/8).subtitle(bSub,size=10), \
a.crop(2*wClip/8,2*hClip/8,-5*wClip/8,-5*hClip/8).subtitle(aSub,size=10), \
b.crop(3*wClip/8,2*hClip/8,-4*wClip/8,-5*hClip/8).subtitle(bSub,size=10), \
a.crop(4*wClip/8,2*hClip/8,-3*wClip/8,-5*hClip/8).subtitle(aSub,size=10), \
b.crop(5*wClip/8,2*hClip/8,-2*wClip/8,-5*hClip/8).subtitle(bSub,size=10), \
a.crop(6*wClip/8,2*hClip/8,-1*wClip/8,-5*hClip/8).subtitle(aSub,size=10), \
b.crop(7*wClip/8,2*hClip/8,-0*wClip/8,-5*hClip/8).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/8,3*hClip/8,-7*wClip/8,-4*hClip/8).subtitle(bSub,size=10), \
a.crop(1*wClip/8,3*hClip/8,-6*wClip/8,-4*hClip/8).subtitle(aSub,size=10), \
b.crop(2*wClip/8,3*hClip/8,-5*wClip/8,-4*hClip/8).subtitle(bSub,size=10), \
a.crop(3*wClip/8,3*hClip/8,-4*wClip/8,-4*hClip/8).subtitle(aSub,size=10), \
b.crop(4*wClip/8,3*hClip/8,-3*wClip/8,-4*hClip/8).subtitle(bSub,size=10), \
a.crop(5*wClip/8,3*hClip/8,-2*wClip/8,-4*hClip/8).subtitle(aSub,size=10), \
b.crop(6*wClip/8,3*hClip/8,-1*wClip/8,-4*hClip/8).subtitle(bSub,size=10), \
a.crop(7*wClip/8,3*hClip/8,-0*wClip/8,-4*hClip/8).subtitle(aSub,size=10)), \
stackhorizontal(a.crop(0*wClip/8,4*hClip/8,-7*wClip/8,-3*hClip/8).subtitle(aSub,size=10), \
b.crop(1*wClip/8,4*hClip/8,-6*wClip/8,-3*hClip/8).subtitle(bSub,size=10), \
a.crop(2*wClip/8,4*hClip/8,-5*wClip/8,-3*hClip/8).subtitle(aSub,size=10), \
b.crop(3*wClip/8,4*hClip/8,-4*wClip/8,-3*hClip/8).subtitle(bSub,size=10), \
a.crop(4*wClip/8,4*hClip/8,-3*wClip/8,-3*hClip/8).subtitle(aSub,size=10), \
b.crop(5*wClip/8,4*hClip/8,-2*wClip/8,-3*hClip/8).subtitle(bSub,size=10), \
a.crop(6*wClip/8,4*hClip/8,-1*wClip/8,-3*hClip/8).subtitle(aSub,size=10), \
b.crop(7*wClip/8,4*hClip/8,-0*wClip/8,-3*hClip/8).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/8,5*hClip/8,-7*wClip/8,-2*hClip/8).subtitle(bSub,size=10), \
a.crop(1*wClip/8,5*hClip/8,-6*wClip/8,-2*hClip/8).subtitle(aSub,size=10), \
b.crop(2*wClip/8,5*hClip/8,-5*wClip/8,-2*hClip/8).subtitle(bSub,size=10), \
a.crop(3*wClip/8,5*hClip/8,-4*wClip/8,-2*hClip/8).subtitle(aSub,size=10), \
b.crop(4*wClip/8,5*hClip/8,-3*wClip/8,-2*hClip/8).subtitle(bSub,size=10), \
a.crop(5*wClip/8,5*hClip/8,-2*wClip/8,-2*hClip/8).subtitle(aSub,size=10), \
b.crop(6*wClip/8,5*hClip/8,-1*wClip/8,-2*hClip/8).subtitle(bSub,size=10), \
a.crop(7*wClip/8,5*hClip/8,-0*wClip/8,-2*hClip/8).subtitle(aSub,size=10)), \
stackhorizontal(a.crop(0*wClip/8,6*hClip/8,-7*wClip/8,-1*hClip/8).subtitle(aSub,size=10), \
b.crop(1*wClip/8,6*hClip/8,-6*wClip/8,-1*hClip/8).subtitle(bSub,size=10), \
a.crop(2*wClip/8,6*hClip/8,-5*wClip/8,-1*hClip/8).subtitle(aSub,size=10), \
b.crop(3*wClip/8,6*hClip/8,-4*wClip/8,-1*hClip/8).subtitle(bSub,size=10), \
a.crop(4*wClip/8,6*hClip/8,-3*wClip/8,-1*hClip/8).subtitle(aSub,size=10), \
b.crop(5*wClip/8,6*hClip/8,-2*wClip/8,-1*hClip/8).subtitle(bSub,size=10), \
a.crop(6*wClip/8,6*hClip/8,-1*wClip/8,-1*hClip/8).subtitle(aSub,size=10), \
b.crop(7*wClip/8,6*hClip/8,-0*wClip/8,-1*hClip/8).subtitle(bSub,size=10)), \
stackhorizontal(b.crop(0*wClip/8,7*hClip/8,-7*wClip/8,-0*hClip/8).subtitle(bSub,size=10), \
a.crop(1*wClip/8,7*hClip/8,-6*wClip/8,-0*hClip/8).subtitle(aSub,size=10), \
b.crop(2*wClip/8,7*hClip/8,-5*wClip/8,-0*hClip/8).subtitle(bSub,size=10), \
a.crop(3*wClip/8,7*hClip/8,-4*wClip/8,-0*hClip/8).subtitle(aSub,size=10), \
b.crop(4*wClip/8,7*hClip/8,-3*wClip/8,-0*hClip/8).subtitle(bSub,size=10), \
a.crop(5*wClip/8,7*hClip/8,-2*wClip/8,-0*hClip/8).subtitle(aSub,size=10), \
b.crop(6*wClip/8,7*hClip/8,-1*wClip/8,-0*hClip/8).subtitle(bSub,size=10), \
a.crop(7*wClip/8,7*hClip/8,-0*wClip/8,-0*hClip/8).subtitle(aSub,size=10)))
}

StainlessS
7th June 2016, 15:13
Thread on similar (before/after):- http://forum.doom9.org/showthread.php?t=172198

Livesms
8th June 2016, 23:33
Congratulations, it looks like you've found out that QTGMC's speed/quality tradeoff isn't perfect!
I'm new to QTGMC :)

Trying to find happy medium between speed and quality.
Compared different preset each with other (simple dos cmd with two "for in do").
Looks like rather adequate scale for preset/quality. Except "Ultra Fast" - even Draft gives better SSIM...

Now have to compare counting for speed or SSIM percent per fps...