View Full Version : Delay bottom field
O.S.D
17th April 2006, 22:29
Hi
When i captured a vhs video it droped 1 frame and to fix it
i ned to delay the bottom field and swap field order at that
place in the video. I tryed it in virtualdub whit the plugin
field delay and it worked realy good, so is there a way to do the same in Avisynth?
if you wont restore fields:Clip=AVISource("..\Banket26.avi",audio=False)
Clip.SeparateFields.SelectEven
StackVertical(BilinearResize(Width,Height-1,0,.5,Width,Height-1),Crop(0,Height-1,0,0))
# up field becose restore upFields from downFields
ConvertToYV12(False)
back_vec_Even = MVAnalyse(isb = true, truemotion=true, pel=2, idx=1)
for_vec_Even = MVAnalyse(isb = false, truemotion=true, pel=2, idx=1)
cropped_Even = crop(4,4,-4,-4)
back_vec2_Even = cropped_Even.MVAnalyse(isb = true, truemotion=true, pel=2, idx=2)
for_vec2_Even = cropped_Even.MVAnalyse(isb = false, truemotion=true, pel=2, idx=2)
Last.MVFlowFps2(back_vec_Even,for_vec_Even,back_vec2_Even,for_vec2_Even,num=50,idx=1,idx2=2)
Restore_Odd=SelectOdd
Clip.SeparateFields.SelectOdd
StackVertical(Crop(0,0,0,1),BilinearResize(Width,Height-1,0,.5,Width,Height-1))
# down field becose restore downFields from upFields
ConvertToYV12(False)
back_vec_Odd = MVAnalyse(isb = true, truemotion=true, pel=2, idx=3)
for_vec_Odd = MVAnalyse(isb = false, truemotion=true, pel=2, idx=3)
cropped_Odd = crop(4,4,-4,-4)
back_vec2_Odd = cropped_Odd.MVAnalyse(isb = true, truemotion=true, pel=2, idx=4)
for_vec2_Odd = cropped_Odd.MVAnalyse(isb = false, truemotion=true, pel=2, idx=4)
Last.MVFlowFps2(back_vec_Odd,for_vec_Odd,back_vec2_Odd,for_vec2_Odd,num=50,idx=3,idx2=4)
Restore_Even=SelectOdd
Restore=Interleave(Restore_Even.FadeIn(0),Restore_Odd)
Clip.ConvertToYV12(True).SeparateFields
Trim(0,99)+Restore.Trim(100,-1)+\
Trim(101,299)+Restore.Trim(300,-1)+\
Trim(301,0)
AssumeBFF.WeavePS my English is very bad...
Mug Funky
18th April 2006, 07:19
@ AI: wouldn't there still be useful information in the bottom field though?
@ O.S.D: try:
avisource("capture.avi")
last.trim(0,cut_point_frame_number),last.doubleweave().selectodd().trim(cut_point_frame_number+1,0)
that may not sort out the dropped field properly though - you might want to splice in a new frame (photoshopped?) or just leave it as is.
O.S.D
18th April 2006, 09:02
Thanks for your help. I gess i forgot to say that i am not so good at Avisynth and i cant get this to work i get an error if i try to opend the *.avs in virtualdub line5 column14 can some one tell my wht is wrong.
LoadPlugin("mvtools.dll")
avisource("test.avi")
last.trim(49),last.doubleweave().selectodd().trim(77)
Clip=AVISource("test.avi",audio=False)
Clip.SeparateFields.SelectEven
StackVertical(BilinearResize(Width,Height-1,0,.5,Width,Height-1),Crop(0,Height-1,0,0))
# up field becose restore upFields from downFields
ConvertToYV12(False)
back_vec_Even = MVAnalyse(isb = true, truemotion=true, pel=2, idx=1)
for_vec_Even = MVAnalyse(isb = false, truemotion=true, pel=2, idx=1)
cropped_Even = crop(4,4,-4,-4)
back_vec2_Even = cropped_Even.MVAnalyse(isb = true, truemotion=true, pel=2, idx=2)
for_vec2_Even = cropped_Even.MVAnalyse(isb = false, truemotion=true, pel=2, idx=2)
Last.MVFlowFps2(back_vec_Even,for_vec_Even,back_vec2_Even,for_vec2_Even,num=50,idx=1,idx2=2)
Restore_Odd=SelectOdd
Clip.SeparateFields.SelectOdd
StackVertical(Crop(0,0,0,1),BilinearResize(Width,Height-1,0,.5,Width,Height-1))
# down field becose restore downFields from upFields
ConvertToYV12(False)
back_vec_Odd = MVAnalyse(isb = true, truemotion=true, pel=2, idx=3)
for_vec_Odd = MVAnalyse(isb = false, truemotion=true, pel=2, idx=3)
cropped_Odd = crop(4,4,-4,-4)
back_vec2_Odd = cropped_Odd.MVAnalyse(isb = true, truemotion=true, pel=2, idx=4)
for_vec2_Odd = cropped_Odd.MVAnalyse(isb = false, truemotion=true, pel=2, idx=4)
Last.MVFlowFps2(back_vec_Odd,for_vec_Odd,back_vec2_Odd,for_vec2_Odd,num=50,idx=3,idx2=4)
Restore_Even=SelectOdd
Restore=Interleave(Restore_Even.FadeIn(0),Restore_Odd)
Clip.ConvertToYV12(True).SeparateFields
Trim(0,99)+Restore.Trim(100,-1)+\
Trim(101,299)+Restore.Trim(300,-1)+\
Trim(301,0)
AssumeBFF.Weave
stickboy
18th April 2006, 09:53
When i captured a vhs video it droped 1 frame and to fix it i ned to delay the bottom field and swap field order at that
place in the video. I tryed it in virtualdub whit the plugin field delay and it worked realy good, so is there a way to do the same in Avisynth?Try my JDL_ReverseFieldDominance (http://www.avisynth.org/) function. You'd use it like:
c = AVISource("video.avi")
seg1 = c.Trim(0, frameNumber - 1)
seg2 = c.Trim(frameNumber, 0)
seg1 + seg2.ComplementParity().JDL_ReverseFieldDomaince(true)Thanks for your help. I gess i forgot to say that i am not so good at Avisynth and i cant get this to work i get an error if i try to opend the *.avs in virtualdub line5 column14 can some one tell my wht is wrong.Post the exact error message.
O.S.D
18th April 2006, 10:41
The error message is
Avisynth open failure:
Script error: syntax error
("filname".avs, line 5, column 14)
line5:last.trim(49),last.doubleweave().selectodd().trim(77)
column14 is Bold
What you want?
Possible separate lines?
last.trim(49)
last.doubleweave().selectodd().trim(77)
Next: That I know "trim need 2 parametrs - begin & end"
Mug Funky: I don't understand :( rephrase.
Wilbert
18th April 2006, 11:44
Line 5 is the following line, right?
last.trim(49),last.doubleweave().selectodd().trim(77)
You should fix the trims and the comma. Afaics you don't use that line later on in your script, so you can remove it (as well as the AviSource on line 4).
edit: too late :)
O.S.D
18th April 2006, 12:22
Hi a gen and thanks for taking the time to help me.
I have uploaded a sampel it is 18mb it is the part that is bad
in the movie, frame 5 is dropped and the problem starts at frame 6.
Any whay to fix this in Avisynth? I tryed virtualdub and delayed the bottom field and then swaped fields looked ok.
http://www.savefile.com/files/7778029
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.