VideoHelp Forum




+ Reply to Thread
Results 1 to 19 of 19
  1. Member
    Join Date
    Aug 2011
    Location
    Brazil
    Search Comp PM
    Hi

    I'm loading an .avs script in VD which, among other stuff, uses separatefield(). The source which avs reads is ntsc 720x480x30fps VHS-capture.. should I feed VD with separated fields to run deshaker (as if it was progressive) or should I weave() and then deshake it as interlaced ?

    Also, separatefields() will output in 720x240x60.. I read somewhere to use a deinterlacer which outputs "full-sized frames"... but.. why? deinterlace to 720x480x30 and then interlace again? (because the final output is a DVD/interlaced)
    Quote Quote  
  2. SeparateFields() followed by deshaking will not work right. The best results would be from a smart bob deinterlace like Yadif(mode=1), or even QTGMC() if you can stand the slow speed. Then deshake and reinterlace.

    WhateverSource()
    AssumeBFF() # or AssumeTFF()
    Yadif(mode=1, order=0) #0=BFF, 1=TFF
    Or

    WhateverSource()
    AssumeTFF() # or AssumeBFF()
    QTGMC()
    Deshake in VirtualDub. Then reinterlace back in AviSynth:

    WhateverSource()
    AssumeTFF() #or AssumeBFF()
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()
    All that assumes your source is true interlaced video. If it's telecined film you are better off with an inverse telecine rather than deinterlacing.
    Last edited by jagabo; 27th Aug 2011 at 20:19.
    Quote Quote  
  3. Member
    Join Date
    Aug 2011
    Location
    Brazil
    Search Comp PM
    yes it is true interlaced..

    yadif would return 720x480x30 ? same fps? or double? but why is it better to deinterlace something that was originally captured interlaced? and then reinterlace after? that doest make any sense to me.. why the original 240p frame isnt good for deshaker? +_+

    also, can I reinterlace in VD?
    Quote Quote  
  4. Yadif(mode=1) or QTCMC() will output 60 fps progressive. Deshaker will work much better with that than 30i. After Deshaker you need to convert back to 30i for DVD.

    SeparateFields() would work badly. Remember the bottom field is one scan line lower than the top field. After SeparateFields() the two fields will look like two frames to Deshaker -- and it won't know that one of those frames is supposed to be lower than the other. It will deshake them so that they are the same vertical position. Then when you weave them back together the lower field will be moved down to where it's supposed to be. That will create a continuous vertical bounce. Also, when the fields are interpreted as individual frames scanlines that aren't really next to each other are treated as if they are. You will get artifacts at sharp horizontal edges.
    Quote Quote  
  5. Member
    Join Date
    Aug 2011
    Location
    Brazil
    Search Comp PM
    what if I move the frame 1 pixel down before deshaking? :P
    so if I use separatefield() for other stuff inside my .avs, I'll have to weave() before yadif() ?
    can I use yadif inside vd in its builtin deinterlacer ?
    Last edited by Heiler; 27th Aug 2011 at 23:37.
    Quote Quote  
  6. Member
    Join Date
    Aug 2011
    Location
    Brazil
    Search Comp PM
    another one.. it seems to me that using deshaker() via loadvirtualdubplugin() is waaaaay slower than using it inside VD itself.. is it true?
    Quote Quote  
  7. Originally Posted by Heiler View Post
    what if I move the frame 1 pixel down before deshaking? :P
    You can't. You would be moving it two scan lines because the frame is only half the height of the original.

    Originally Posted by Heiler View Post
    so if I use separatefield() for other stuff inside my .avs, I'll have to weave() before yadif() ?
    Yes. But there are very few times when SeparateFields() is really the best way of handling filtering. It's a quick hack and better than treating interlaced frames as progressive, but as I indicated earlier, scan lines which are not really next to each other are handled as if they are, and the bottom field is treated as if it's in the same location as the top field.

    Here's some examples of a 720x480 interlaced MPEG 2 video (DVD rip):

    SeparateFields()
    BicubicResize(640,180)
    Weave()
    Subtitle("separate")
    Click image for larger version

Name:	separate.png
Views:	914
Size:	512.2 KB
ID:	8377

    Yadif(mode=1, order=1)
    BicubicResize(640, 360)
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()
    Subtitle("yadif")
    Click image for larger version

Name:	yadif.png
Views:	952
Size:	515.8 KB
ID:	8378

    Note the bright thin highlights at the top of the logo.

    Originally Posted by Heiler View Post
    can I use yadif inside vd in its builtin deinterlacer ?
    Yes but you have to be careful. If your source is interlaced YV12 VirtualDub may screw up the chroma channels. It always treats YV12 chroma as progressive. You can work around this by converting to YUY2 or RGB in AviSynth. With some sources forcing the color format to YUY2 within VirtualDub (Video -> Color Depth...) will work.
    Last edited by jagabo; 28th Aug 2011 at 12:15.
    Quote Quote  
  8. Member
    Join Date
    Aug 2011
    Location
    Brazil
    Search Comp PM
    wow you know how to convince someone.. thank you very much..
    and deshaker() via loadvirtualdubplugin() ? is it really slower than running it from vd itself?
    Quote Quote  
  9. I've never used Deshaker via LoadVirtualdubPlugin() so I dont' know.
    Quote Quote  
  10. Member
    Join Date
    Aug 2011
    Location
    Brazil
    Search Comp PM
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()

    isnt there a way to do this in VD? it would suck to use a temp .avi just to reinterlace again

    there's a simple VD filter called "interlace", it would be the same as separatefields+selectevery+weave, right?
    Last edited by Heiler; 29th Aug 2011 at 02:15.
    Quote Quote  
  11. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by Heiler View Post
    there's a simple VD filter called "interlace", it would be the same as separatefields+selectevery+weave, right?
    Yes, just set the source format to "Progressive frames" and the field order to "Even field first" or "Odd field first" according to desired output (equivalent to Avisynth TFF and BFF respectively).
    Quote Quote  
  12. Member
    Join Date
    Aug 2011
    Location
    Brazil
    Search Comp PM
    Thanks Gavino
    Quote Quote  
  13. Be sure VirtualDub doesn't use YV12 at any point with interlaced frames. It will screw up the chroma channels.
    Quote Quote  
  14. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Originally Posted by jagabo View Post
    Yes but you have to be careful. If your source is interlaced YV12 VirtualDub may screw up the chroma channels. It always treats YV12 chroma as progressive. You can work around this by converting to YUY2 or RGB in AviSynth. With some sources forcing the color format to YUY2 within VirtualDub (Video -> Color Depth...) will work.
    Something I'd read here before rang a bell while I was reviewing my DV (interlaced YV12) workflow, and phew, thanks for pointing this out! You certainly saved me a heap of future pain.

    For posterity here are some examples. The first frame in each output clip is a direct copy (smart rendering) to show actual source colours, and the next frame was forced into a re-encode with the TextSub filter.The colourspace-colourspace file suffixes indicate VirtualDub decompression and compression formats, respectively. Look especially for the extent and shade of cyan in the clouds towards the top of the frames.

    For these examples the Cedocida DV codec was set to produce and accept both RGB32 and YV12. Forcing the YV12<->RGB32 conversions onto the codec rather by specifying RGB32 for VirtualDub's input and output formats nicely supports your suggestion above. Thanks again.
    Image Attached Files
    Quote Quote  
  15. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Originally Posted by Heiler View Post
    ...and deshaker() via loadvirtualdubplugin() ? is it really slower than running it from vd itself?
    Originally Posted by jagabo View Post
    I've never used Deshaker via LoadVirtualdubPlugin() so I dont' know.
    My experience is that running VD plugins in Avisynth has always been slower. Every time I do it that way, it's a headache. And if you want to change the VD plugin's parameters, you're stuck with running the whole script again.

    OK, so you have an intermediate file between separate steps. So what? After you get what you want, don't save the intermediate file -- just save the script in case something has to be altered. As it is, I never process an entire 90-minute movie at one time anyway. Recently I've been making color space conversions with the dither() plugin, which gives me results superior to the way "straight" Avisynth or VirtualDub does it, depending on the nature of the video.

    Just my $0.02 worth (0.01 euro)
    Last edited by sanlyn; 25th Mar 2014 at 06:02.
    Quote Quote  
  16. Originally Posted by fvisagie View Post
    For posterity here are some examples.
    Those are pretty subtle. Here are some very obvious examples.

    Original interlaced frame:
    Click image for larger version

Name:	inter.png
Views:	1014
Size:	812.9 KB
ID:	16214

    Correctly bob deinterlaced into two frames:
    Click image for larger version

Name:	good1.png
Views:	878
Size:	798.9 KB
ID:	16215
    Click image for larger version

Name:	good2.png
Views:	874
Size:	792.9 KB
ID:	16216

    Incorrectly bob deinterlaced into two frames by VirtualDub (interlaced YV12 problem):
    Click image for larger version

Name:	bad1.png
Views:	913
Size:	852.4 KB
ID:	16217
    Click image for larger version

Name:	bad2.png
Views:	841
Size:	846.1 KB
ID:	16218
    Quote Quote  
  17. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    @jagabo, nice sample, and similar to my experience with VDub's results. I also note the quality difference in the bob sample between even and odd frames. Another case in favor of QTGMC -- and don't forget the many QTGMC options that help with "problem" videos.
    Last edited by sanlyn; 25th Mar 2014 at 06:02.
    Quote Quote  
  18. Yes, bob is a crude deinterlacing method (though it's very similar to what you get with an interlaced CRT). But it's the simplest method of cleanly separating two fields and keeping a full height picture. That is, I didn't want to use a complex filter, or sequence of filters, where you could speculate that the problems were caused by the filters, not the incorrect interlaced YV12 to RGB conversion by VirtualDub.
    Last edited by jagabo; 11th Feb 2013 at 08:55.
    Quote Quote  
  19. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Originally Posted by jagabo View Post
    Those are pretty subtle. Here are some very obvious examples.
    Great examples, thanks.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!