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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#21 | Link |
|
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,407
|
Issuing basic Avisynth syntax/grammar.
![]() Code:
WhateverSourceFilter("thesource.ext")
Source = last
Sup = msuper()
bv = manalyse(Sup, isb=true, delta=3)
fv = manalyse(Sup, isb=false, delta=3)
[..etc..]
Code:
source = WhateverSourceFilter("thesource.ext")
Sup = source.msuper()
bv = manalyse(Sup, isb=true, delta=3)
fv = manalyse(Sup, isb=false, delta=3)
[..etc..]
source = source.RecoverOneFrame(7)
source = source.RecoverFramePair(26)
source = source.RecoverOneFrame(30)
source = source.RecoverFramePair(50)
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
|
|
|
|
|
#23 | Link |
|
Warm and fuzzy
Join Date: Apr 2010
Location: Moscow, Russia
Posts: 206
|
Didee
Are you correct in Code, see below ? . Code:
function RecoverFramePair(clip Source, int N)
{
# N is number of the first frame in Source that needs replacing.
# Frames N and N+1(O) will be replaced.
Source.trim(0,N-1) ++ CandidatesForN.trim(N-1,-1) ++ CandidatesForO.trim(N-1,-1) ++ Source.trim(N+2,0)
}
function RecoverOneFrame(clip Source, int N)
{
# N is number of the frame in Source that needs replacing.
# Frame N will be replaced.
Source.trim(0,N-1) ++ CandidatesForC.trim(N-1,-1) ++ Source.trim(N+1,0)
}
or maybe Code else . Code:
function RecoverFramePair(clip Source, int N)
{
# N is number of the first frame in Source that needs replacing.
# Frames N and N+1(O) will be replaced.
Source.trim(0,N-1) ++ CandidatesForN.trim(N,-1) ++ CandidatesForO.trim(N+1,-1) ++ Source.trim(N+2,0)
}
function RecoverOneFrame(clip Source, int N)
{
# N is number of the frame in Source that needs replacing.
# Frame N will be replaced.
Source.trim(0,N-1) ++ CandidatesForC.trim(N,-1) ++ Source.trim(N+1,0)
}
Wait answer from you... |
|
|
|
|
|
#24 | Link | |
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
The original code is correct.
The 'candidate' clips are produced by MFlowInter and frame N-1 is the interpolation between the original N-1 and N+1 or N+2 to give the replacement frame N or N+1. But actually there is a bug here: Quote:
Last edited by Gavino; 28th November 2011 at 11:06. |
|
|
|
|
|
|
#25 | Link | |
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
Another problem with this code (also in original by pirej) is that the functions don't work for N=1 (ie when replacing frame 1 by interpolating between frame 0 and frame 2 or 3).
Quote:
It should be written instead as Source.Trim(0, -N), and similarly in RecoverOneFrame. (See stickboy's classic Caveats of using Trim in functions.) |
|
|
|
|
|
|
#26 | Link |
|
Warm and fuzzy
Join Date: Apr 2010
Location: Moscow, Russia
Posts: 206
|
I wrote some restore bad frame functions with MFlowInter with following parameters (big number functions - 10)
. delta=11 # 10 frames time=9.09 . Also I wrote Backdoor restore functions. All functions work fine. I really restored 10 continious bad frames in video with motions. Last edited by Jenyok; 1st December 2011 at 19:53. |
|
|
|
|
|
#27 | Link | |
|
Registered User
Join Date: Oct 2011
Location: Germany
Posts: 39
|
Quote:
I am searching for a script that can do this interpolations basing on a ConditionalReader file, that the following script produces. PHP Code:
The ConditionalReader file dups_pl.txt looks like this: Code:
Type int Default 0 57 10 104 1 107 1 110 1 118 1 The report file dups_report.txt looks like this: Code:
frame number : gap-length : Ydiffpregap : Ydiffpostgap : marker 57 10 3.217846 10.803629 ========== 104 1 4.960470 4.838520 = 107 1 7.204895 4.491889 = 110 1 7.093846 4.452096 = 118 1 5.184397 5.302520 = When there are scene changes inside the gap, an interpolation of that gap makes no sense. They can be recognized by a great value of Ydiffn. therefore the script also writes another ConditionalReader file dups_post.txt which contains this value for each gap. Code:
Type float Default 0.0 57 10.803629 104 4.838520 107 4.491889 110 4.452096 118 5.302520 Last edited by sven_x; 2nd December 2011 at 12:06. |
|
|
|
|
|
|
#28 | Link | |
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
Mug Funky wrote a generic function that will replace a specified range of frames (of any length) by MVTools interpolation between the start and end points. See this post (and my comments following it).
@sven_x Quote:
Also, none of the variables need to be global (as can be seen since you have global variables ydiffp and ydiffn, but you actually use variables called ydfp and ydfn in the script). Last edited by Gavino; 2nd December 2011 at 13:05. |
|
|
|
|
|
|
#30 | Link |
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
Can you explain the purpose of the XXXBackFrames functions?
It seems to me, for example, that PairBackFrames(N) replaces frames N-2 and N-1 with new frames interpolated between N and N+3, which doesn't seem right. Also, you should use Trim(0, -N) everywhere instead of Trim(0, N-1), which gives the wrong result for N=1 (as I explained in post #25). |
|
|
|
|
|
#31 | Link |
|
Warm and fuzzy
Join Date: Apr 2010
Location: Moscow, Russia
Posts: 206
|
Gavino
. Thank you for your critic. Please, write correct Code, how you think, in example of function TenBackFrames(clip clp, int N) . See Code below. Thankful in advance to you for your cooperation. . Code:
function TenBackFrames(clip clp, int N)
{
# N is number of the last frame in Source that needs replacing.
# Frames N - 10 and N - 9 and N - 8 and N - 7 and N - 6 and N - 5 and N - 4
# and N - 3 and N - 2 and N - 1 (O) will be replaced.
clp.trim(0, N - 11) ++ interTen1.trim(N, -1) ++ interTen2.trim(N, -1) ++ \
interTen3.trim(N, -1) ++ interTen4.trim(N, -1) ++ interTen5.trim(N, -1) ++ \
interTen6.trim(N, -1) ++ interTen7.trim(N, -1) ++ interTen8.trim(N, -1) ++ \
interTen9.trim(N, -1) ++ interTen10.trim(N, -1) ++ clp.trim(N, 0)
}
|
|
|
|
|
|
#32 | Link |
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
I don't understand the purpose of your 'Back' functions.
Is TenBackFrames(N) supposed to do the same thing as TenFrames(N-10)? If so, why not just use TenFrames instead? If you really want two separate functions for convenience, just make TenBackFrames simply a call to TenFrames. |
|
|
|
|
|
#33 | Link |
|
Registered User
Join Date: Dec 2002
Location: UK
Posts: 1,673
|
What I would love is a generic function that lets me just list the bad frames, and returns a clip with those frames replaced with motion-interpolated versions.
If it works properly for frame number 1, and also for any number of consecutive bad frames, so much the better. So, something like Badframeinter(1,5,6,7,1000,1001,1205). Option to just hand it a text file with frame numbers (one on each line) would be cool too. Shall I ask Santa? ![]() Seriously, I could hack to together myself, in the most inefficient way possible, but I would make all the mistakes described in this thread, and more. Cheers, David. |
|
|
|
|
|
#34 | Link | |
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
Quote:
http://forum.videohelp.com/threads/3...96#post2089696 |
|
|
|
|
|
|
#35 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,407
|
ClipClop() would be of assistance in developing something if Santa does not show up.
EDIT: Just saw that Gavino beat me to it, was meaning something pretty much the same as in the Gavino link. EDIT:, it is my intent to at some stage put up a collection of frame fix options and use ClipClop to select the best particular option for a frame. Eg using Bi-directional predicton, PredictFromPrevious, PredictFromNext and then using eg ClipClop Command file: 1 10 # replace frame 10 using Bidirectional prediction 2 20 # replace frame 20 using PredictFromPrevious 3 30 # replace frame 30 using PredictFromNext Clip 0 would be the original clip, 1 bidir,2 fromPrev, 3 fromNext Quite easy to knock it up yourself. EDIT: You could also make a couple of replacement clips for eg CopyFromPrevious and CopyFromNext just by shifting the frames over by 1 frame.
__________________
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; 14th December 2011 at 18:21. |
|
|
|
|
|
#36 | Link | |
|
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 2,037
|
And here is my Unipolator.
I decided to release it into the wild today, Santa is close and 2011 ran as hell. Can do motion-based interpolation of 0-7 consequent missing frames in 0-52 places at once. Especially designed for in-place repair of heavily damaged frames and/or recalculation and reinsertion of missing frames. It is walkthrough-documented, helps with tailored assertions to check against certain parameter violations and has a nice switchable and resolution and widescreen-dependent overlay. I guess the conditional splicer could be straightened out and forged into a function, the whole beast could be a function as well (a Gavino case?), but my time is too limited right now. -------------- Oops. Quote:
Maybe this post missed the thread, because Unipolator uses MFlowInter, not MVFlow. I will open a new thread. http://forum.doom9.org/showthread.php?p=1547405 This could help the attachment approval as well.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." Last edited by Emulgator; 27th December 2011 at 16:58. |
|
|
|
|
|
|
#38 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,407
|
@Moderator, I hope that Emulgator's attachment can be approved soon, please,
and merry xmas to one & all.
__________________
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 ??? |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|