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 25th October 2013, 11:36   #1  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Can FreezeFrame be applied iteratively?

Let's say I have a video where bad frames fall more or less within a formula like x+y*n, for example, 175+20n (so, 175, 195, 215, etc...). Is there a way to have all the frames in falling in that formula be replaced by their following one with FreezeFrame? If not, what would you suggest to replicate it with?
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 25th October 2013, 12:27   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
I think it could be done using stickboy's ApplyEvery plugin in some way, but I don't have time to work out the details right now.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 25th October 2013, 19:10   #3  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
In Runtime Environment (untested),
Code:
c
ScriptClip("""
    c = last
    current_frame % n == x ? c.DeleteFrame(0) : c
""")
martin53 is offline   Reply With Quote
Old 25th October 2013, 19:18   #4  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
And I think also (assume to replace 2nd frame in group of 4)
Code:
Interleave(c, c.DeleteFrame(0), c.DeleteFrame(0,1,2), c.DeleteFrame(0,1,2)).SelectEvery(4)
martin53 is offline   Reply With Quote
Old 25th October 2013, 19:40   #5  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by martin53 View Post
Code:
Interleave(c, c.DeleteFrame(0), c.DeleteFrame(0,1,2), c.DeleteFrame(0,1,2)).SelectEvery(4)
Doesn't that just give c?
(Interleaving 4 clips and taking the first frame of each group of 4 will give you the frames of the first clip.)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 25th October 2013, 20:54   #6  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Quote:
Originally Posted by Gavino View Post
Doesn't that just give c?
Code:
Interleave(c, c.DeleteFrame(0), c.DeleteFrame(0,1,2), c.DeleteFrame(0,1,2)).SelectEvery(4)
Without the blue '2', yes. But I expect with the blue '2', the third frame (I accidentally wrote 2nd when I meant #2 counted from #0) is in fact one frame ahead.

EDIT: No, you are right, Gavino. SelectEvery takes only the 1st of the interleave group, which is c. Instead it should read
Code:
Interleave(c.SelectEvery(4), c.SelectEvery(4,1), c.SelectEvery(4,3), c.SelectEvery(4,3))

Last edited by martin53; 25th October 2013 at 21:02.
martin53 is offline   Reply With Quote
Old 25th October 2013, 21:37   #7  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by martin53 View Post
Code:
Interleave(c.SelectEvery(4), c.SelectEvery(4,1), c.SelectEvery(4,3), c.SelectEvery(4,3))
That can be written simply as
c.SelectEvery(4, 0,1,3,3)
which works for the example you gave.

The original problem had groups of 20, which is more tedious to do this way (but clearly possible), but imagine if you wanted to freeze, say, every 100th frame, it starts to become a pain.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 25th October 2013, 22:27   #8  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by Gavino View Post
I think it could be done using stickboy's ApplyEvery plugin in some way, but I don't have time to work out the details right now.
This should work for the problem originally described (replace frames 175+20*n by following ones):
Code:
start = Trim(0, 174)
Trim(175, 0)
start + InterleaveEvery(DeleteEvery(20), SelectEvery(20,1), 20)
__________________
GScript and GRunT - complex Avisynth scripting made easier

Last edited by Gavino; 25th October 2013 at 22:30.
Gavino is offline   Reply With Quote
Old 14th November 2013, 04:19   #9  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Thanks for the suggestion, I'll try it and get back you.
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax 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 08:34.


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