Log in

View Full Version : Avisynth and SSIM


mysticado
19th February 2009, 01:29
Hey guys,
I just have a quick question, which is for you probably not even difficult, since I'm a newbie.
The thing is, I have some .mov Files I would like to check, or precisely to check the SSIM values between the files.
I already downloaded the newest avisynth, put the ssim.dll in the plugins directory, and also the dll called: QTSource.dll which enables Quicktime-moviefile handling.
The problem I have is, when I activate the following code:
a=QTInput("C:\jsvm\1280x720.mov")
b=QTInput("C:\jsvm\576_auf_1280.mov")
return ssim(a,b,"results.csv","averageSSIM.txt",lumimask=true)

I get the error-message: SSIM: YV12 colorspace required

So can you please help me? I need the solution asap, since the results have to be available in about 8 hours :-S
Thanks in advance

Guest
19th February 2009, 01:32
a=QTInput("C:\jsvm\1280x720.mov").converttoyv12()
b=QTInput("C:\jsvm\576_auf_1280.mov").converttoyv12()
return ssim(a,b,"results.csv","averageSSIM.txt",lumimask=true)

mysticado
19th February 2009, 01:36
Well, that was fast :) ....and helpful !!!

But unfortunately now I get the error that the clips are not the same length, despite TMPGEnc telling me that both have 300 frames, which is 10 sec.
Is there maybe a scripting way to handle that???

Guest
19th February 2009, 01:38
Sure, but I have to leave right now. More later if someone else doesn't help you. Look at Trim().

mysticado
19th February 2009, 01:46
Hmm....found out that somehow one of the videos has one frame more than the other, so i tried it like this:

a=QTInput("C:\jsvm\1280x720.mov").trim(0,300).converttoyv12()

but still the error message appears. After that I put that trim-part on both videos, but still the same problem. Anyone a clue??

Dark Shikari
19th February 2009, 01:47
Hmm....found out that somehow one of the videos has one frame more than the other, so i tried it like this:

a=QTInput("C:\jsvm\1280x720.mov").trim(0,300).converttoyv12()

but still the error message appears. After that I put that trim-part on both videos, but still the same problem. Anyone a clue??Trim(0,300) leaves 301 frames, not 300 ;)

mysticado
19th February 2009, 01:51
ARGH! That was a really STUPID mistake...maybe it's coz of the late hour here in Germany (it's 1:50 AM)...but thank you so much for your help!

mysticado
19th February 2009, 02:12
OK, one more question and then I'm off!

I don't know why, but the calculation doesn't finish somehow. The two log-files keep their 0-byte size and the movie itself is somehow stuck at the 250th frame (of 300 in total).
Have I done something wrong? Avisynth opens the windows media player for the encoding process and usually at the beginning the Play-button is pressed, but now it's the stop-button, without the calculation having finished?
How come?

Guest
19th February 2009, 04:21
Open the script in VirtualDub and hit F5. Does it play to the end?

mysticado
19th February 2009, 10:13
Hey neuron2,
yeah I figured out what the problem was. Obviously the old media player wasn't working very well anymore, so I opened the avs file in the new media player 11, and voila - it goes through all frames till the end ;)
There's just one more thing I don't understand - in every session the script generates the averageSSIM.txt file. I was just wondering how it is possible that the result in this file is i.e. 5.51. I always thought that the SSIM is a measure between 0 and 1 ??

Guest
19th February 2009, 14:30
There's just one more thing I don't understand - in every session the script generates the averageSSIM.txt file. I was just wondering how it is possible that the result in this file is i.e. 5.51. I always thought that the SSIM is a measure between 0 and 1 ?? Sorry, but I know nothing about it.

Zwitterion
19th February 2009, 17:25
There's just one more thing I don't understand - in every session the script generates the averageSSIM.txt file. I was just wondering how it is possible that the result in this file is i.e. 5.51. I always thought that the SSIM is a measure between 0 and 1 ??

For this value, the plugin multiplies the average SSIM value by itself eight times, then by 100.
So 5.51 would equal a SSIM value of roughly 0.7 which is very bad... Make sure your source clips are aligned by doing a StackVertical(a,b).