Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Need A Special Field Swap Filter Made
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
s00pcan
Posted: Jun 17 2003, 10:39 PM


Unregistered









I hope this would be easy for someone here to make for me. When I captured video at full resolution from my playstation 2 then tried do slo-mo by de-interlacing I noticed that every fourth field is in the wrong spot. It's like playing the field backwards. So what I need is a filter that swaps the field dominance every third frame.

 
  Top
fccHandler
Posted: Jun 18 2003, 12:23 AM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



QUOTE (s00pcan @ Jun 17 2003, 06:39 PM)
So what I need is a filter that swaps the field dominance every third frame.

I would try Avisynth with the following script:

CODE
src = AVISource("drive:\path\filename.avi")
clip1 = SelectEvery(src, 3, 0)
clip2 = SelectEvery(src, 3, 1)
clip3 = SelectEvery(src, 3, 2).SwapFields()
Interleave(clip1, clip2, clip3)



--------------------
May the FOURCC be with you...
 
     Top
s00pcan
Posted: Jun 18 2003, 02:20 AM


Unregistered









Wait. I need it to swap fields on every even numbered frame. It sounds simple..

 
  Top
fccHandler
Posted: Jun 18 2003, 02:44 AM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



QUOTE (s00pcan @ Jun 17 2003, 10:20 PM)
how about separating the fields first then swapping every fourth/fifth frame?

CODE
AVISource("drive:\path\filename.avi")
SeparateFields()
SelectEvery(5, 0,1,2,4,3)
Weave()


--------------------
May the FOURCC be with you...
 
     Top
s00pcan
Posted: Jun 18 2003, 02:57 AM


Unregistered









scr = AVISource("clip.avi")
SelectOdd(scr).SwapFields()
separatefields

didn't work, but should have. I'll try your new code.
 
  Top
fccHandler
Posted: Jun 18 2003, 03:21 AM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



QUOTE (s00pcan @ Jun 17 2003, 10:20 PM)
Wait. I need it to swap fields on every even numbered frame. It sounds simple..

Hey, you edited your post. That's not fair. tongue.gif

CODE
src = AVISource("drive:\path\filename.avi")
clip1 = SelectEven(src).SwapFields()
clip2 = SelectOdd(src)
Interleave(clip1, clip2)


--------------------
May the FOURCC be with you...
 
     Top
s00pcan
Posted: Jun 18 2003, 11:04 AM


Unregistered









Gah! That code makes complete sense but doesn't look any different than just separatefields by itself!

http://www.skateflint.com/slomo.avi

Here's an compressed clip so you can see what I mean. Using separatefields you can clearly see that problem. This should help.

 
  Top
fccHandler
Posted: Jun 18 2003, 03:24 PM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



I see. At times the motion appears backward, but it looks random to me. If there's no pattern to it then it's going to be really difficult to fix.

One question: Did you capture this at 29.97 fps originally? If not, then that could be the cause of the screwed-up field order.

--------------------
May the FOURCC be with you...
 
     Top
s00pcan
Posted: Jun 18 2003, 04:55 PM


Unregistered









Well I captured it at 30fps.. I tried 29.97 and it still does it.
 
  Top
fccHandler
Posted: Jun 18 2003, 06:01 PM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



Looking at your sample again, there is a pattern which kicks in after the 11th field. At that point (like you said), every fourth field is backwards. Try this:

CODE
AVISource("drive:\path\filename.avi")
SeparateFields()
SelectEvery(4, 0,1,3,2)


And ring all the changes for "SelectEvery" until it comes out right. If the pattern really is every fourth field, then there are 4 possibilities:

SelectEvery(4, 1,0,2,3)
SelectEvery(4, 0,2,1,3)
SelectEvery(4, 0,1,3,2)
SelectEvery(4, 3,1,2,0)

--------------------
May the FOURCC be with you...
 
     Top
s00pcan
Posted: Jun 19 2003, 02:16 PM


Unregistered









SelectEvery(4, 1,0,2,3)
this works very well but then starts to mess up. I'm guessing there was a dropped frame or something that threw it off. I'll try capturing another clip.

http://www.skateflint.com/goodslomo.mpg
the filename speaks for itself.. thanks!

 
  Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
10 replies since Jun 17 2003, 10:39 PM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Filters and Filter Development