VideoHelp Forum




+ Reply to Thread
Results 1 to 10 of 10
  1. Member
    Join Date
    Jun 2005
    Location
    The Netherlands
    Search Comp PM
    Hello,

    I tried to crop and resize interlaced (TFF) video. In some parts of the video was text. In the original it was sharp, but after avisynth, I could see the text double like this:


    (left: after avisynth, right: original)

    This was the code I used in avisynth:


    Code:
    AssumeTFF()
    Crop(32,84,-32,-92)
    SeparateFields()
    BiCubicResize(720,288)
    Weave()
    
    ConvertToYV12(interlaced=true)
    What am I doing wrong?

    Thanks in advance.
    Quote Quote  
  2. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    You cannot resize an interlaced clip that way.
    When you resize the separated fields, you are altering the spatial offset between them, so they cannot be weaved back together again.

    The simplest solution is to deinterlace before resizing, although there is another method that involves shifting the two fields by an appropriate sub-pixel offset.
    Quote Quote  
  3. Member Alex_ander's Avatar
    Join Date
    Oct 2006
    Location
    Russian Federation
    Search Comp PM
    Originally Posted by loekverhees
    What am I doing wrong?
    Resizing separated fields needs vertical shift correction (the way it is done in internal bob filter) but even then problems remain since throwing away a field leaves you with (relatively) halved spacial sample frequency. If the video is vertically sharp, you'd still get artifacts. A better method involves temporary deinterlacing with doubling the framerate:

    Code:
    LoadPlugin("LeakKernelDeint.dll")
    LeakKernelBob(order=1)#if TFF
    Spline36Resize(720,576)
    DoubleWeave().SelectEvery(4,1)# TFF
    Quote Quote  
  4. Member
    Join Date
    Jun 2005
    Location
    The Netherlands
    Search Comp PM
    Thanks Alex_ander and Gavino. I've use this code now:

    Code:
    Crop(32,84,-32,-92)
    ConvertToYV12(interlaced=true)
    TempGaussMC_beta1()#if TFF 
    Spline36Resize(720,576) 
    DoubleWeave().SelectEvery(4,1)# TFF
    And the results are perfect (takes a long time to render tough ).
    Quote Quote  
  5. Member Alex_ander's Avatar
    Join Date
    Oct 2006
    Location
    Russian Federation
    Search Comp PM
    Take care of the field order with a different bob deinterlacer: on script output you may get not the order you expect. To force output TFF you can simply add 'AssumeBFF' before DoubleWeave (the last line inverts default field order).
    Quote Quote  
  6. Member
    Join Date
    Jun 2005
    Location
    The Netherlands
    Search Comp PM
    Ok, trying this now:

    Code:
    Load_Stdcall_plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
    AssumeTFF()
    Crop(32,84,-32,-92) 
    ConvertToYV12(interlaced=true) 
    Yadif(3,1)
    Spline36Resize(720,576) 
    DoubleWeave().SelectEvery(4,1)
    TGMC_beta1 took too long .
    Quote Quote  
  7. Member Alex_ander's Avatar
    Join Date
    Oct 2006
    Location
    Russian Federation
    Search Comp PM
    You'll have BFF after script since yadif passes input field order to its output. Use AssumeBFF() before DoubleWeave() if you want TFF in the end.
    Quote Quote  
  8. Member
    Join Date
    Jun 2005
    Location
    The Netherlands
    Search Comp PM
    I tried a slightly different code this time (because I thought the deinterlacer was better this time):

    AssumeTFF()
    Crop(32,84,-32,-92)
    ConvertToYV12(interlaced=true)
    yadifmod(edeint=nnedi2())
    Spline36Resize(720,576)
    DoubleWeave().SelectEvery(4,1)
    But when I import this into HCEncoder, it says:

    WARNING, frame rate NOT DVD-COMPLIANT, WARNING, resolution/frame rate mismatch.

    What am I doing wrong?
    Quote Quote  
  9. If you are using yadifmod to bob, and nnedi2 for spatial prediction, both have to be in "bob" or double rate mode instead of single. Have a look at the readme for yadifmod and nnedi2 for more info

    Code:
    AssumeTFF() 
    Crop(32,84,-32,-92) 
    ConvertToYV12(interlaced=true) 
    interp=nnedi2(field=3) #double rate, starts with top
    yadifmod(order=1, field=-1, mode=1, edeint=interp) #TFF,field set to order,double rate
    Spline36Resize(720,576) 
    DoubleWeave().SelectEvery(4,1)
    Quote Quote  
  10. Member
    Join Date
    Jun 2005
    Location
    The Netherlands
    Search Comp PM
    Thanks, now it's working.
    Quote Quote  



Similar Threads

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