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 26th November 2012, 12:35   #1  |  Link
lisztfr9
Registered User
 
Join Date: Apr 2010
Posts: 175
YDifferenceFromPrevious, AverageLuma ?

Hi,

"YUV is a color model - or color space - that consists of one luma (a.k.a. brightness) component, Y" (wiki)

Code :
Quote:
WriteFile(filename, "current_frame", "colon", "YDifferenceFromPrevious", "colon", "AverageLuma", flush=true)
Output :

Quote:
0: 0.000000: 91.990440
1: 7.229414: 90.837395
2: 6.917845: 91.439629

3: 5.629769: 91.108070
4: 6.149966: 91.371422
5: 6.249398: 90.300537
6: 5.568695: 91.179222
7: 6.245852: 89.969498
8: 6.368322: 90.976563
9: 5.497233: 90.415611
The average luma difference between frame 1 and 2 :

91.439629 - 90.837395 = 0.599534

YDifferenceFromPrevious = 6.917845

So what is the real relationship between YDiff and luma, or the computation made here ?

I know Ydifference computes the total difference between two frames by pixels, but how ? then even 6.917845 is too low.

I need to select frames while they have more luma than previous and next, but since Ydiff returns absolute (not signed) values i can't use it, i tried yesterday but i didn't succeed. I need to access average luma of previous and next frame, imho.

That's a lot of questions
Thanks, L
lisztfr9 is offline   Reply With Quote
Old 26th November 2012, 14:39   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
Quote:
Originally Posted by lisztfr9 View Post
So what is the real relationship between YDiff and luma, or the computation made here ?
YDiff is not the difference between the average luma of the two frames. Instead, it is the average absolute luma difference between pixels at the same location - for each pixel position, the absolute luma difference is calculated, the results are summed and divided by the total number of pixels to find the average.

Quote:
I need to select frames while they have more luma than previous and next, but since Ydiff returns absolute (not signed) values i can't use it, i tried yesterday but i didn't succeed. I need to access average luma of previous and next frame, imho.
That's right.
Note that using GRunT, you can get these easily with AverageLuma(-1) and AverageLuma(1).
__________________
GScript and GRunT - complex Avisynth scripting made easier

Last edited by Gavino; 26th November 2012 at 14:42.
Gavino is offline   Reply With Quote
Old 26th November 2012, 14:45   #3  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
http://avisynth.org/warpenterprises/...l_20050727.zip
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 27th November 2012, 11:39   #4  |  Link
lisztfr9
Registered User
 
Join Date: Apr 2010
Posts: 175
Thanks to all, Gavino ok i understand it better now, and Chikuzen, it seems a bit similar to native YPlane function.

Edit : i think i could have use also R-Stat for accessing other frames, but Grunt is much easier..

Last edited by lisztfr9; 27th November 2012 at 11:57.
lisztfr9 is offline   Reply With Quote
Old 27th November 2012, 16:52   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,906
Quote:
Originally Posted by lisztfr9 View Post
Edit : i think i could have use also R-Stat for accessing other frames, but Grunt is much easier..
Not really sure how AverageLuma(-1) is much easier than RT_AverageLuma(-1), but it is faster if on full frame only
(maybe its the extra typing involved ie "RT_").
__________________
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 offline   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 06:00.


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