Can you check this function? It's in the "style" of the earlier function like recoveroneframe()
I tried it out on some other "bad" sources and it seems to be ok
Code:function RX(clip Source, int N, int X) { # N is number of the 1st frame in Source that needs replacing. # X is total number of frames to replace #e.g. RX(101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for mflowfps interpolation start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point start+end AssumeFPS(1) #temporarily FPS=1 to use mflowfps start_end = last super = start_end.MSuper() backward_vec = MAnalyse(super, isb = true) forward_vec = MAnalyse(super, isb = false) start_end.MFlowFps(super, backward_vec, blend=false, forward_vec, num=X+1, den=1) #num=X+1 AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining Trim(1, framecount-1) #trim ends, leaving replacement frames interp = last Source.trim(0,-N) ++ interp ++ Source.trim(N+X+1,0) }
+ Reply to Thread
Results 271 to 300 of 318
-
-
Yep - looks good.
You can simplify it slightly to make more use of implicit 'last', removing variables start_end and interp.
Also best not to put named parameters (blend=false) before positional ones (forward_vec), although it does seem to work.
Code:function RX(clip Source, int N, int X) { # N is number of the 1st frame in Source that needs replacing. # X is total number of frames to replace #e.g. RX(101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for mflowfps interpolation start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point start+end AssumeFPS(1) #temporarily FPS=1 to use mflowfps super = MSuper() backward_vec = MAnalyse(super, isb = true) forward_vec = MAnalyse(super, isb = false) MFlowFps(super, backward_vec, forward_vec, blend=false, num=X+1, den=1) #num=X+1 AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining Trim(1, framecount-1) #trim ends, leaving replacement frames Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0) }
-
I did very little with the "bad motion" sample. Tried BadFrames() on a spot or two, but didn't like it. I knew I'd have to try something else. Several scenes in the video have this problem. I haven't looked deeper yet. Giving priority now to uglier stuff like the ending. Time is getting to be a factor now, I have an in-law's bat mitzvah tape to transfer soon. At least a "pro" made the tape, but color's dreadful. Thank god it don't look like the opera. I might just have to let some of these less-awful scenes go as-is, and revisit later.
-
In the "end" sequence when damage starts, the 3rd "good" field drops down a notch. Haven't figured how to fix some of the "bad" good fields yet, but will re-work the clip today and see what happens.
-
LOL this is a marathon, it must be "good stuff" for you opera fans to go through this nightmare of fixing it up
If that "bad motion" was basically unprocessed and representative, then I don't see a way around it except to use a temporal smoother to average the background. The frames "morph" in the backgound . Earlier I thought it might have been related to a field order issue, because the morphing goes forward/back/forward/back, so if the wrong motion vectors were used it might cause something like this with a temporal smoother.
You could use masks/roto to isolate the damage, I would argue it's more important to keep the detail of the character, and possibly allow the background (curtains?) to blur a bit -
It's just poor motion control + low bitrate + tape damage with the recording setup.
Say, if I bob a clip of 100 frames, how many fields do I have? 100 or 200?
I ran about 10 versions of the mvtools script on the bobbed clip, then used ReplaceFrameSimple on the odd-numbered fields. I get the same video coming out that went in. AviSynth doesn't work like other programming languages, I guess. I'm out of time. I'll have to tweak what I can and move on. -
If you bob an interlaced 100 frame clip, you have 200 frames (you no longer have fields). So you have 2x the number, but the fps is 2x the speed . Another way of saying this is each field becomes a frame (the initial 100 frame clip had 200 fields)
You can use a better bobber, something like yadifmod+nnedi3, but I don't know if you'll see a big benefit given the quality of the source. You don't want to use a temporal bobber like QTGMC in this example, or the good frames get contaminated
This one doesn't have a deadline does it? You can always come back to it when you have free time -
Let's call the input clip in1. Bob that. You have 200 "frames", then. Submit that clip to mvtools, and you interpolate every frame, good and bad. The bobbed clip has 1018 frames. I asked ReplaceFramesSimple to replace only odd-numbered frames. No good: the function insisted the bobbed field had only 509 frames. So I said, Okay, let's do fields instead of frames. It doesn't make sense to SeparateFrames on a bobbed clip; they have to be rejoined, don't they? I tried that anyway, and got a very strange looking video.
I figured bob -> filter - replace frames (or fields, or whatever) -> reinterlace. I'm probably missing an essential step, but it's obvious I don't know what AviSynth wants. -
I don't understand that step: "Submit that clip to mvtools, and you interpolate every frame, good and bad. The bobbed clip has 1018 frames."
Are you saying the original clip has 509 frames (1018 fields ) ?
I don't understand what "submit that clip to mvtools" means ? Are you using the function Gavino posted in post #223?
https://forum.videohelp.com/threads/322848-Scripts-and-filters-for-an-Opera-(sample-vid...=1#post2089696
If you have a bobbed clip, and every 2nd frame is bad (lets say odd), the way I used earlier would be
R(1)
R(3)
R(5)
.
.
.
R(1017)
And it takes seconds to copy & paste from excel (assuming you wanted to replace every 2nd frame)
I haven't tested Gavino's function yet, but I think the syntax for that would be FixBadFrames("1 3 5 ...1017")
Once they are fixed , then you re-interlace & join with the other sections that don't need this type of fixing (e.g. using Trim() )
I take back what I said about RP ("RP" for replace pair) earlier - The RP function works ok on slow motion content, so it seems to work ok on the bad pairs in the samples you've posted
And that RX function above simplifies using mvtools2 on stretches of bad frames -
-
Not exactly, but similar. I look at this code, and don't see how it would work on a bobbed clip:
Code:c sup = MSuper() bv = MAnalyse(sup, isb=true, delta=2) fv = MAnalyse(sup, isb=false, delta=2) candidates = MFlowInter(sup, bv, fv, time=50.0, ml=100).DuplicateFrame(0) ReplaceFramesSimple(candidates, mappings=frames)
I don't think the original code above was working with a bobbed clip. If it is, then how do you exclude bad "odd" frames from msuper and Manalyze? Let's say frame 55 of the bobbed clip is a bad (odd) frame. Manalyze will look at frames 53 and 57. But 53 and 57 are bad frames, too. Wouldn't this interpolate data from two bad frames and make a "new" bad frame? What would happen to the good (even) frames? Seems a waste of time to interpolate between two good frames that don't have a problem.
Anyway, I tried similar code to use ReplaceFramesSimple with a long list of odd-numbered frames to be replaced (used a text file. Worked OK). Of course, I just replaced old bad frames with "new" bad frames, but even then ReplaceFramesSimple insisted I had only 509 frames, not 1018.
Where are you getting a "good" frame 1017?
I was almost ready to try different logic, since ReplaceFramesSimple can't see all my bobbed frames. In psuodocode, I was going to do this:
Separate the unbobbed 509-frame clip into fields
create two streams with SelectEven and SelectOdd.
Make an msuper of the Even fields.
Create vectors with mAnalyze on the Even fields
create a stream of good Even fields with Mflowinter
Use ReplaceFramesSimple to replace badd Odd fields with good Even fields
- - (Obviously the above line won't work; the offsets are incorrect)
Weave the old Even and the new Odd
- - (That won't work properly either)
Bob the weaved clip, then SeparateFields + SelectEvery(4,0,3) + weave
But I still don't think that'll work, unless bob()/reinterlace is going to correct the offsets. So the problem I haven't solved is, where are the good frames (fields) coming from? -
-
You might be able to "fix" the offset if you stabilize it when it's bobbed , the re-interlace, but it would be better to start with the original field offsets. The reason is, (depending on which bob you use) when you bob a video that has the wrong offset, you can get aliasing (jaggy edges) along borders
I don't think the original code above was working with a bobbed clip. If it is, then how do you exclude bad "odd" frames from msuper and Manalyze? Let's say frame 55 of the bobbed clip is a bad (odd) frame. Manalyze will look at frames 53 and 57. But 53 and 57 are bad frames, too. Wouldn't this interpolate data from two bad frames and make a "new" bad frame? What would happen to the good (even) frames? Seems a waste of time to interpolate between two good frames that don't have a problem.
The way it's written, manalyse will look at the immediate neigbors with 50% shutter, so to replace bad frame 55 of the bobbed clip, it looks at 54 and 56
Anyway, I tried similar code to use ReplaceFramesSimple with a long list of odd-numbered frames to be replaced (used a text file. Worked OK). Of course, I just replaced old bad frames with "new" bad frames, but even then ReplaceFramesSimple insisted I had only 509 frames, not 1018.
no, those are the frames to be replaced, so 1017 is replaced by looking at 1016 and 1018 (which are good). (These were imaginary numbers by the way, I don't know if they match the actual clip you're looking at)
Separate the unbobbed 509-frame clip into fields
create two streams with SelectEven and SelectOdd.
Make an msuper of the Even fields.
Create vectors with mAnalyze on the Even fields
create a stream of good Even fields with Mflowinter
Use ReplaceFramesSimple to replace badd Odd fields with good Even fields
- - (Obviously the above line won't work; the offsets are incorrect)
Weave the old Even and the new Odd
- - (That won't work properly either)
Bob the weaved clip, then SeparateFields + SelectEvery(4,0,3) + weave
But I still don't think that'll work, unless bob()/reinterlace is going to correct the offsets. So the problem I haven't solved is, where are the good frames (fields) coming from?
The bob corrects the field offset (assuming your video was "normal" interlace to begin with; the original video sample was". You have 59.94p video after you bob it. When you re-interlace it, the fields are positionally offset again, as they should be .
You might be having problems because the clip you are using might not have the correct field offset to begin with -
Right, I knew that wouldn't work anyway. As for offset, putting that AVI thru AssumeTFF().SeparateFields() has alternating images hopping like crazy when played, so the offset looks proper to me. No, I'm doing something wrong, or leaving something out.
I've no argument either with Gavino's (even I did I prob'ly wouldn't know what I was talking about). But <squint> trying to learn something here: If setting "time=50.0" makes Manaylze read 1 frame back and 1 forward, what is "default=2" doing?
Well, no, not arbitrary. 1017 would be the next to last frame number (bobbed clips don't have fields, right? They're frames. So altogether the bobbed clip has 0 to 1018 frames). So I'm still down to 2 questions:
Why does ReplaceFramesSimple think I have 509 frames (I get out-of-bounds error on "frame 510"). Maybe before I call that function in RemapFrames, I should state AssumeFrameBased()?.
Q#2 is, why aren't those odd-numbered frames being changed? I also tried the same code without "default=anything", I just let default stay at its default (=1).
Before I hide under the blankets for the nite, I'll try another 10 or 12 versions.
-
50% refers to the interpolation time between frames, not 1 frame back or forward . This is the intermediate time position that mflowinter uses. 50% is even 50-50 split. For a good-bad-good sequence, 50% works perfect. If you look at the RP (replace pair) function, 33% and 66% are specified because it's looking farther away to opposite directions. good-bad-bad-good. Here bad-bad is replaced, the 1st bad using 33% the 2nd bad using 66% .
"delta" specifies the distance between frames that it looks for motion vectors. If you look at the RP function delta=3 because it need to look farther away
the documentation describe it more clearly
Why does ReplaceFramesSimple think I have 509 frames (I get out-of-bounds error on "frame 510"). Maybe before I call that function in RemapFrames, I should state AssumeFrameBased()?.
Q#2 is, why aren't those odd-numbered frames being changed? I also tried the same code without "default=anything", I just let default stay at its default (=1).
Before I hide under the blankets for the nite, I'll try another 10 or 12 versions.
Last edited by poisondeathray; 5th Jul 2011 at 22:28.
-
Right, I knew that wouldn't work anyway. As for offset, putting that AVI thru AssumeTFF().SeparateFields() has alternating images hopping like crazy when played, so the offset looks proper to me. No, I'm doing something wrong, or leaving something out.
I've no argument either with Gavino's (even I did I prob'ly wouldn't know what I was talking about). But <squint> trying to learn something here: If setting "time=50.0" makes Manaylze read 1 frame back and 1 forward, what is "default=2" doing?
Well, no, not arbitrary. 1017 would be the next to last frame number (bobbed clips don't have fields, right? They're frames. So altogether the bobbed clip has 0 to 1018 frames). So I'm still down to 2 questions:
Why does ReplaceFramesSimple think I have 509 frames (I get out-of-bounds error on "frame 510"). Maybe before I call that function in RemapFrames, I should state AssumeFrameBased()?.
Q#2 is, why aren't those odd-numbered frames being changed? I also tried the same code without "default=anything", I just let default stay at its default (=1).
Before I hide under the blankets for the nite, I'll try another 10 or 12 versions.
Last edited by sanlyn; 7th Jul 2011 at 10:13.
-
"last" is implied when you don't specify anything.
e.g.
in1
Super_in = msuper()
since in1 is called , last is implied and it is applied to msuper(), so you don't need in1.msuper()
(I did the same thing above for that RX function , and Gavino cleaned it up)
I think the same logic applies to ReplaceFramesSimple, c was already called (in1 in your script), so that is implied as the source clip. I think this applies for any function . For example, you can use
in1
LSFMod(in1, strength=100)
But "in1" can be omitted because it is implied as the source clip
in1
LSFMod(strength=100)
Still don't understand the use of default=2, if mAnalyze only works 1 frame in each direction.
OK, I have no idea why DuplicateFrame(0) is used. Please explain. I'm serious.
Answering My Own Stupid Questions Dept.: Why did ReplaceFramesSimple think I had only half the number of frames I claimed to have?
Because the clip name I used referred to the un-bobbed clip !
LOL I do this stuff all the time and Gavino seems to always be around to fix it -
That's highly appreciated clarification, poison. I'll revisit the mflowinter notes again and find more examples; it's a little dizzying (and it's 1:25 AM). As for DuplicateFrames(0), oh, well, I'll just keep paying attention. Frames looked worse wthout it.
The AVI I used is a 3rd-stage version, somewhat over filtered (FFT3D + NeatVideo). BadFrames() masked some bubbles in the background and some flashes or hot "glow" in the white gown. I'll keep looking for something in AviSynth that might be cleaner. What a mess. Corny plot, great music.
re: mflowinter. Oh, I get it. Takes a while sometimes. -
I think pdr has basically answered these questions, but just to confirm...
When you say 'default=2', I assume you meant delta=2.
MAnalyze doesn't necessarily work 1 frame in each direction, the delta parameter is what controls the distance.
Here we want to look two frames ahead (and back) so we use delta=2. This allows us to interpolate 50% between 54 and 56 to get a new frame 55. This uses information from frame 54 looking forward to 56 and from 56 looking backward to 54.
The result of MFlowInter has the interpolated frame (which we want to be the new frame 55) in frame 54.
So we add a duplicate frame at the start to push everything up one frame. We need to do this because ReplaceFramesSimple takes the replacement frames from the same numbers as the originals. In the old ('clunky') method using Trims, this wasn't necessary because we were selecting each frame individually by the appropriate number.
Finally, note that when calling any Avisynth function that has a clip as its first parameter, the parameter can be omitted and defaults to 'last'. This is what makes it easy to write a chain of filters with each one using the output of the previous one as its input.
By the way, all plugins in the Avisynth plugins folder are loaded automatically, so you don't need to use LoadPlugin for those. -
Yes. Y'know, I really have to stop doing that!
Most informative, Gavino. I guess I got something less precise from MvTools' page, but your explanation makes more sense. Thank you, this is better than blindly copying scripts.
And I kept wondering why it wasn't automatic. Time to revisit the guidebooks, class, I'll bet it's on Page One. A wonder it didn't bite me as I ran past.
-
Here's the MPEG results of the script I used in post #287. The text file of frames to be replaced (bob'd frames) is attached as "BadFrames2.txt". Not all frames were replaced. Still trying to figure what to do with them (if I have time). The camera shot changes at 472. I worked a few of those frames here, but starting at 472 the dissolve-to-white was treated as a separate clip. This is from an intermediate AVI denoised with FFT3D and NeatVideo, but I overdid it a bit. The levels/colors were tweaked later. Frames "hop" at 219-220.
NTSC MPEG2 352x480, 8.6 MB (NO AUDIO)
http://dc401.4shared.com/download/98hGVB4X/ReplaceFrames.mpg
A bigger clip of the scene was posted earlier, but here's an unprocessed version from the source DVD. Starts with the same frame as above, but has 511 frames instead of 510.
NTSC MPEG2 352x480, 7.3 MB (NO AUDIO)
http://dc417.4shared.com/download/ahycJ5Wo/ReplaceFrames_original.mpg
Version "1st Step" of the same clip as above, after extracting from the DVD with chubbyrain and some TemporalSoften. I think you can see why I wanted to use a later-step AVI to try mvTools. Someone mentioned color earlier (jagabo?). This first attempt at getting some color into the clip used this:
Code:ColorYUV(off_u=+10.5,cont_u=-120,off_v=1.5,gamma_v=50) Tweak(coring=false,bright=-1.50,cont=0.85)
NTSC MPEG2 352x480, 9 MB (NO AUDIO)
http://dc391.4shared.com/download/wMlgz2rC/ReplaceFrames_1stStep.mpg -
Spent the past couple days reading nothing but Doom9 posts about mvTools. As I discovered a while back, it would take months to catch-up with AviSynth (add a few more months to update my old GUI/database C++ from Windows 98 to C++ for graphics circa VisualStudio-6). I'm stuck at a rather basic AviSynth level for the remainder of this opera "tweak".
I struggled a bit with statements like this:
I understand logically what that means, but. . .I see 4 different functions in DePan and haven't been able to get Stab() to run after 3 hours of dependency plugin problems. I have to start a VHS->DVD transfer of a Bat Mitzvah tape for my great-neice, who'll soon receive a unique graduate degree in rabbinical studies from Yale (I'm not Jewish, but she's a devout convert who pleaded with me to color-correct this old tape for the occasion. A 'pro' made the original, no bad problems, but the color makes you weep).
And I still have crap like this tweak: Here's the opening fade from black in Act 2-Scene1. It looks this way after chubbyrain2, FFT3D, some NeatVideo and temporal filters. I cleaned up more of it later.
Act2 Scene2 fade-up NTSC 352x480, Layer-2, 10-secs, 4.4 MB
http://dc406.4shared.com/download/CdBwSNXW/W06A_A01_sample.mpg
The opening goes like this for 1592 frames before settling down (somewhat). My previous cleanup used many temporal filters and BadFrames(). Believe it or not, there's more "detail" here (I use the term very loosely) than the original DVD, which is pretty much a jittery blur. I'll revisit it and replace many frames with mvTools. Every opening and closing fade on Diskette 2 looks like this. So the Big Finish ending I've fiddled with for the past couple of weeks is but a small piece of this mincemeat pie.
Meanwhile I can't annoy people with question-question-question on every line of AviSynth code. AviSYnth will take a while longer. -
stab comes as an avsi , either autoload or import it
http://avisynth.org/mediawiki/Stab
for depan and stab, you have to load DePan.dll, and DepanEstimate.dll (either autoload or manually) , but you call it with depanstabilize() .
stab also relies on temporalsoften but that is an internal filter I think. Post the error message if you can't get it to work
Look at the examples in the documentation, there are quite a few parameters to tweak. The simplest syntax is
mdata = DePanEstimate(range=1)
DePanStabilize()
stab()
I can't remember why , but I think that section worked better with stacking them , or I couldn't figure out ideal settings. I know the range had to be increased because of the up & down "bump" lasted more than 1 frame -
Thanks, poison, I've had the DePan's and Stab around a while, but 4 versions of RemoveGrain/Repair. They finally ran OK, but like I say it was 3 hours and I'm still playing with parameters. Finally found the 4th Repair dll required by another script, in Mano's archive. Anyone learning AviSynth goes through this, but it does take time sifting thru Doom9 archives. I'll just keep at it.
Maybe one could load different versions of plugins by giving each a different name, putting them in a folder other than "plugins", and loading them manually with LoadPlugin. I'm just arrogant enough to try that sometime. Gotta rest up soon, the wife's dragging me off to Ontario for a week -- I have lots of stuff to load to the laptop. Her friends up there better have cable.Last edited by sanlyn; 11th Jul 2011 at 08:32. Reason: the usual typos
-
Big Finish -- well, almost!
Now that the Big Crescendo is done (as much as it will ever be), I've taken the Kick the Bucket Clinch as far as I can. Not thrilled with it. The clip J_W07F__F01A__now.mpg below is where Mignon lands on the little guy in monk's robes. Biggest problem is background noise, fluttery motion, and the fact that no fields in any two or three frames are "clean". I used two steps with mvtools/Manalyze, the first a bobbed clip fixed a bit (mostly bottom field replacement), followed by selected even/odd field replacement. There's still some motion noise, jitter, and scenery flutter but it's now...well, better. Still trying to figure out how to get two clean fields to help tweak the rest. Almost every frame and field has something wrong with it, and errors get propagated with mvtools. BTW, BadFrames() was used in a couple of spots, but I'm dropping that idea. Didn't help.
now.mpg
NTSC MPEG2, 8.5 MB, 16 secs, Layer2 Audio
http://dc200.4shared.com/download/AU5o454t/J_W07F__F01A__now.mpg
Below is an MPEG version of the AVI source before mvTools. The greenish source has been thru chubbyrain2\ColorYuv\FFT3D\NeatVideo. Try viewing it bobbed or with SelectEven/Odd, and watch the background objects, the hero's head at left, and the right-hand scenery. Few clean adjacent fields for Manalyze. It's as if top and bottom fields weren't in sync -- considering the physical damage and budget VCR, they probably were not.
before.mpg
NTSC MPEG2, 8.5 MB, 16 secs, Layer2 Audio
The http://dc390.4shared.com/download/H6xbzHfm/J_W07F__F01A__before.mpgLast edited by sanlyn; 15th Jul 2011 at 19:47.
-
Just when you thought it was safe to go back to this thread . . .
K_BigFinish_start.mpg is the big show's finish, before curtain calls. Plenty of bad frames, jittery motion, background objects hopping and simmering, etc. This is after chubbyrain2, ColorYUV/Tweak, FFT3D, NeatVideo, etc., but before work with mvtools.
NTSC MPEG2, Layer=2, 17 MB 31-secs
http://dc364.4shared.com/download/2vM-whiR/K_BigFinish_start.mpg
"Today" version looks a little green (still work to do!). Went thru one round with bobbed clip working on odd-frame damage noise for the first 1/3 of the clip, then mvtools again replacing even/odd fields. Most bad fields are surrounded by even more bad fields, Motion is about as smoothas I'll get, I guess. Still an odd fluctuation about frame 680 when white dissolves to a shot of the audience. Considering how bad the tape was, I'm surprised there's an image at all. About every 3rd frame needed fixing (where possible!).
NTSC MPEG2, Layer=2, 17 MB 31-secs
http://dc389.4shared.com/download/z_fxupUQ/K_BigFinish_today.mpg
script:
## Plugin = vtools2.dll
## Plugin = RemapFrames.dll (for ReplaceFramesSimple)
AviSource("F:\Mignon02\Work07\W07F\F00\W07F_F00_Bo rd_YUV_rgb2J_tmp3_NV6b_tmp1.avi")
AssumeTFF().ConvertToYV12(interlaced=true).Bob()
in1=last
# ------------ get vectors -------------
In1
Super_in = msuper()
backv = manalyse(Super_in,isb=true, delta=2)
forwv = manalyse(Super_in, isb=false, delta=2)
new_fields = mflowinter(Super_in, backv, forwv, time=50.0, ml=100).DuplicateFrame(0)
# ------------ replace frames (bob'ed clip) -----------
ReplaceFramesSimple(new_fields, "F:\Mignon02\Work07\W07F\F00\BadFrames\BadFrames1. txt")
AssumeTFF().SeparateFields().SelectEvery(4,0,3).We ave()
in2 = last
## ----------- Separate even/odd fields
even_in1=in2.assumetff().separatefields().selectev en()
odd_in1=in2.assumetff().separatefields().selectodd ()
## ----------- Even Fields
even_in1
Super_Even = msuper()
bv1 = manalyse(Super_Even, isb=true, delta=2)
fv1 = manalyse(Super_Even, isb=false, delta=2)
new_even = mflowinter(Super_Even, bv1, fv1, time=50.0, ml=1000).DuplicateFrame(0)
ReplaceFramesSimple(even_in1, new_even, "F:\Mignon02\Work07\W07F\F00\BadFrames\ReplaceEven 1.txt")
even_fix = last
## ----------- Odd Fields
odd_in1
Super_Odd = msuper()
obv1 = manalyse(Super_Odd, isb=true, delta=2)
ofv1 = manalyse(Super_Odd, isb=false, delta=2)
new_odd = mflowinter(Super_Odd, obv1, ofv1, time=50.0, ml=100).DuplicateFrame(0)
ReplaceFramesSimple(odd_in1, new_odd, "F:\Mignon02\Work07\W07F\F00\BadFrames\ReplaceOdd1 .txt")
odd_fix = last
interleave(even_fix, odd_fix)
new_clip = last
new_clip.weave().ConvertToRGB32(matrix="Rec601",in terlaced=true) -
Every time the camera pans across or down in this awful video, no two fields in any frame look alike. Motion differs in each frame (and each field). Finding a "bad" field surrounded by "good" ones is almost impossible; there will be several bad guys in a row. Often a glitch in the top field of frame 1 will appear as the same glitch in the bottom field of frame 2 or 3. Even/Odd fields often don't appear to be in sync. The attached 1.4-second AVI shows what I mean. This is at the opera's end, when the all-white screen dissolves into a panning shot of the audience.
huffyuv AVI, 1.4 secs (41 frames) 6.6 MB. Frame 8 in this clip corresponds to frame 680 in the MPEG's posted above. The clip shows that the dissolve from white suddenly gets darker than the previous frames.
http://dc268.4shared.com/download/FKVRZCsc/L_Frames_674_714.avi
Here's a pic of frames 12, 13, and 14 of the attached clip, using separatefields(). Even (top) fields on the left, odd (bottom) fields on the right. Note the way the white horizontal balcony near the top changes shape irregularly.
Top Fields (left): in the middle image, compared to the top image, the shape of the balcony has changed: in the middle image the top middle curve bows downword and the bottom of the curve has dropped down a few pixels -- but the left-hand edge stays where it was. The balcony's overall shape is slimmer and bows downward in the middle. In the bottom image, the entire balcony has expanded at both the top and underside, so the balcony is now "fatter" than in the previous two fields. It's not the same shape as the right-hand balcony.
Bottom Fields (right): in the top-right image, the balcony is "fatter" than the balcony on the left. In the middle-right image, the midsection of the balcony's curve has dropped a bit, but the bottom of the curve stays about the same shape. In the bottom-right image, the balcony's left and right corners drop, but the rest of the curve hardly moves.
The left and right balcony shapes and pillar positions seldom look alike between fields. The shadows underneath the balcony also change shape in every frame. See Even/Odd fields in frame 14 below:
I was able to smooth some of this with mvtools. I even tried AssumeBFF instead of TFF! There just aren't enough well-behaved fields to do what I wanted. -
I suggested this for the "morphing" problem earlier - you can treat that with QTGMC and TTempSmooth. You can also treat the aliased edges on the balcony this way (the jaggy edges on the bottom left of the balcony)
Unlike that other clip, this ending section has barely any detail to preserve to begin with, so you probably don't even have to use masks. Fine details like hair, face detail, smoke etc.. tend to get erroded - so be careful when using it. Also be careful about using them on "non clean" sections, as the temporal filtering will propogate the errors. As usual, adjust the settings for your taste
Code:MPEG2Source() QTGMC(preset="slower" , edimode="eedi2", sharpness=0.3) TTempSmooth(maxr=1, lthresh=24, cthresh=4, strength=4)
AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
Here is the comparison of AssumeTFF().Bob() on the left, before re-interlacing. Trim(1200,0) was used for this comparison (so frame 0 corresponds to frame 1200). You may have to open it up in vdub or avspmod and go frame by frame to really appreciate the differences -
Will give it a try tomorrow, poisondeathray. You're right, it can make things a little soft (as if they weren't already). I'll play with the settings.
Similar Threads
-
I think an easy way to fix dots flickering (sample included)
By jairovital in forum RestorationReplies: 28Last Post: 11th Jan 2012, 15:39 -
Are these VHS tapes fixable? youtube sample included.
By kcr in forum RestorationReplies: 11Last Post: 29th Sep 2010, 07:37 -
Need help in deinterlacing an old VHS converted video (Sample included) ..
By ahmadka in forum RestorationReplies: 22Last Post: 30th Jun 2010, 12:43 -
Help with Color Correction (Sample Included)
By mlong30 in forum RestorationReplies: 9Last Post: 13th Mar 2008, 23:01 -
Magnetized VHS - How to fix it? (Sample included)
By djnice in forum RestorationReplies: 16Last Post: 18th Sep 2007, 13:14