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. |
27th December 2011, 16:52 | #1 | Link | |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
Unipolator - an universal frame interpolator script
And here is my Unipolator.
I decided to release it into the wild today, Santa was close and 2011 ran as hell. Unipolator is an universal frame interpolator script to be run under Avisynth, based on MFlowInter from MVTools2 plugin. To ease restoration of film scans Unipolator performs motion-based interpolation of up to seven consequent missing frames in up to 52 places at one call. Especially designed for in-place repair of heavily damaged frames and/or recalculation and reinsertion of missing frames. A walkthrough-documentation is part of the script, which helps with tailored assertions to check against certain parameter violations. Unipolator has a nice switchable and resolution and widescreen-dependent info overlay which fits into bigger scripts that evaluate source and final video parameters. 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. Suggestions and Improvements welcome. -------------- Oops. Quote:
__________________
"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:54. |
|
3rd January 2012, 20:30 | #5 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
Frame 1500:
Code:
insertbeforeAA=1500 insertlengthAA=-1 This is not implemented directly as Replace, here up to 3 in a row are possible. But using pure Frame Insertion in Unipolator up to seven missing frames are implemented. No sweat here: First Trim() away the defect frames, then apply Unipolator for Frame Insertion: Code:
Trim(0,1699) ++ Trim(1705,0) Then call Unipolator again Code:
insertbeforeAA=1700 insertlengthAA=5
__________________
"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; 3rd January 2012 at 21:04. |
3rd January 2012, 21:02 | #6 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
I will give some little helpers here to everyone to find your way through the interpolated frames, where they are and where the frame bilance actually ends up:
Put your sourcefilter here... Code:
..source("X:\path\file") (you only use 0 to mute any overlays, 1 to see input framenumbers only and 5 to see input and output frame numbers. The other controls are only useful in my bergwerk script;-) Code:
FrameCounterOverlay=0 ## 0: FrameCounterOverlay OFF | 1: Source only | 2: Source+PostTrim | 3: Source+PostTrim+PostDec ## 4: Source+PostTrim+PostDec+PostDeRoll | 5: Source+SourceTrim+PostDec+PostDeRoll+PostInterpolator ## 6: All (Source+SourceTrim+PostDec+PostDeRoll+PostInterpolator+Final) Code:
ResizerWide= false ResizerHD= false OverlayFontWidth= ResizerWide==true ? 3.75 : 4.0 OverlayFontSize= ResizerHD==true ? 12 : 10 Code:
#[*#.....................................................................................Print Source-Framenumber Top/Bottom..................................................................................................... function PrintSourceFrameNumberATop(clip a) { ScriptClip(a, """Subtitle("Source Frame "+string(current_frame), size=overlayfontsize+2, align=5, x=(width*1/8)+12, y=overlayfontsize+10, font_width=OverlayFontWidth, text_color=$00AAAAFF)""") } function PrintSourceFrameNumberABottom(clip a) { ScriptClip(a, """Subtitle("Source Frame "+string(current_frame), size=overlayfontsize+2, align=5, x=(width*1/8)+12, y=height-12, font_width=OverlayFontWidth, text_color=$00AAAAFF)""") } FrameCounterOverlay>=1 ? PrintSourceFrameNumberATop(last) : NOP FrameCounterOverlay>=1 ? PrintSourceFrameNumberABottom(last) : NOP #*]#.........................................................................................End of Source-Framenumber Top/Bottom.............................................................................................. Code:
[*################ Start of Emulgator's Universal Motion Based Frame Interpolator ####################### ..... *]############ End of Emulgator's Universal Motion Based Frame Interpolator Unipolator 1.15 ################### Code:
#[*#...........................................................................Print PostInsert-Framenumber Top/Bottom....................................................................................................... function PrintPostInsertFrameNumberETop(clip e) { ScriptClip(e, """Subtitle("PostInterpol Frame "+string(current_frame), size=overlayfontsize+2, align=5, x=(width*6/8)-24, y=overlayfontsize+10, font_width=OverlayFontWidth, text_color=$00EEEEEE)""") } function PrintPostInsertFrameNumberEBottom(clip e) { ScriptClip(e, """Subtitle("PostInterpol Frame "+string(current_frame), size=overlayfontsize+2, align=5, x=(width*6/8)-24, y=height-12, font_width=OverlayFontWidth, text_color=$00EEEEEE)""") } FrameCounterOverlay>=5 ? PrintPostInsertFrameNumberETop(last) : NOP FrameCounterOverlay>=5 ? PrintPostInsertFrameNumberEBottom(last) : NOP #*]#..........................................................................End of PostInsert-Framenumber Top/Bottom......................................................................................................
__________________
"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..." |
3rd January 2012, 23:55 | #7 | Link | |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
To illustrate cases where linear motion interpolation between two frames might not succeed
(jiggling motion, to and fro, colliding objects...), I'd like to quote from PM: Quote:
__________________
"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..." |
|
4th March 2012, 09:52 | #8 | Link |
Registered User
Join Date: Sep 2007
Location: Europe
Posts: 602
|
Sorry, but can you explain how to use this?
Let's say I have a file and I want to replace one damaged frame, say, frame 51186, using data from frames 51185 and 51187. How do I do this with your script? I've tried changing the values inside the .AVS file, for example: insertbeforeAA=51186 insertlengthAA=-1 But it just throws the error, "Evaluate: Unrecognized exception". |
4th March 2012, 10:20 | #9 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
Lyris, your syntax is correct.
Hm. I could not repeat this fault. I just opened an .avi source, total length 5750 frames, Code:
insertbeforeAA=5118 insertlengthAA=-1 (source was interlaced, so horizontally scrolling credits are a bit skewed.) Maybe a dependency on MVTools versions ? At my editing system (WinXP32 SP3 T7600G, 4GB RAM, 9x500GB HDD), Unipolator calls mvtools2 version 2.5.11.6 at the moment. As the shape of the frame number renderings up to 4th position suggest, the resulting frame 5118 is indeed an interpolation of the former adjacent frames 5117 and 5119. If you had seen the first frame version before 10:34 GMT+1, please refresh your browser, I had my new version of filldrops3 still activated in the chain while screenshooting...
__________________
"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; 4th March 2012 at 10:51. |
24th April 2012, 12:13 | #11 | Link |
Registered User
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
|
This filter does a great job at SD resolutions. I use it to repair damaged frames from TV broadcasts.
Unfortunately I can't get it to work at HD resolutions. Nothing in the instruction manual mentions high definition sources being restricted.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake? Curly: Burned at the stake! Moe: Why? Curly: A hot steak is always better than a cold chop. |
25th April 2012, 21:41 | #12 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
|
Yes, confirmed. I developed Unipolator for SD restoration and was happy with it.
Now that I have some HD footage to restore myself I will have to make it work for HD too... On a WinXP32 SP3 here Unipolator eats up 2GB rapidly when loading HD. When reaching the first frame to be interpolated and MVtools kick in, Memory use gets even higher and voila: access violation. Will see how it behaves on a Win7U64 sooner or later, but no time for now.
__________________
"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..." |
Thread Tools | Search this Thread |
Display Modes | |
|
|