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. |
12th March 2013, 12:03 | #21 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,009
|
i and j are clips not frames. (EDIT: The frame being worked on is current_frame)
It should work similarly to the previous script, you are just swapping apples for oranges. Both AverageLuma() and AudioMax() are just functions returning a float used in the conditional part of WriteFileIf(). EDIT: Instead of this: Code:
#This is the line that actually writes the frame number of the FIRST frame that falls below the threshold WriteFileIf(last, filename, "(AverageLuma(i)<blankthreshold)&&AverageLuma(j)>blankthreshold", "current_frame+1", append = false) Code:
#This is the line that actually writes the frame number of the FIRST frame that falls below the threshold WriteFileIf(last, filename, "(AudioMax(i,0) < -100) && AudioMax(j,0) > -100", "current_frame+1", append = false)
__________________
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; 12th March 2013 at 12:13. |
12th March 2013, 12:20 | #22 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,433
|
However, I think johnmeyer's example is incorrect.
Code:
j=trim(i,1,0) #Previous frame Code:
j = SelectEvery(i,-1) |
12th March 2013, 12:29 | #23 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,009
|
Have to admit to a little head scratching when I saw that and the current_frame+1 bit.
(guess I just thought 'must be right' and moved on). Would I be right in thinking that the output should then be on current_frame rather than current_frame+1. ? EDIT: on looking again, looks to me like the JM example outputs the frame number of the 1st frame after black frames, perhaps just labeled wrongly. EDIT: Below looks correct to me (not checked) Code:
j = SelectEvery(i,-1) # Previous frame #This is the line that actually writes the frame number of the FIRST frame that falls below the threshold WriteFileIf(last, filename, "(AverageLuma(i)<blankthreshold)&&AverageLuma(j)>blankthreshold", "current_frame", append = false) Code:
j = SelectEvery(i,-1) # Previous frame #This is the line that actually writes the frame number of the FIRST frame that falls below the threshold WriteFileIf(last, filename, "(AudioMax(i,0) < -100) && AudioMax(j,0) > -100", "current_frame", append = false)
__________________
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; 12th March 2013 at 13:20. |
12th March 2013, 12:36 | #24 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,433
|
Quote:
(I was assuming he used current_frame+1 to get frames numbered from 1 instead of 0, but it may just be a mistake.) |
|
12th March 2013, 18:04 | #25 | Link | |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,714
|
Quote:
As for the trim function, my comment was an error, and I modified my post to add to that comment to explain the error. |
|
Tags |
avisynth, black, detection, frames |
Thread Tools | Search this Thread |
Display Modes | |
|
|