VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. Member
    Join Date
    Jul 2016
    Location
    Italy
    Search PM
    Hey everybody,
    I was trying to restore some VHS footage I captured some months ago and the input footage is PAL Interlaced (Top Field First). I'd like to export it out of Avisynth keeping the interlacing, as I don't want to deinterlace it. Can anybody tell me how to do it? I assume I should do something like a deinterlace > reinterlace process as I have to crop and resize my footage.

    Thank you.
    Quote Quote  
  2. Exactly what you want to do will depend on the filtering. But something as simple as SeparateFields(), filter(), Weave() may be sufficient. Or QTGMC(preset="fast"), filter(), SeparateFields().SelectEvery(4,0,3).Weave().
    Quote Quote  
  3. Member
    Join Date
    Jul 2016
    Location
    Italy
    Search PM
    I tried both methods but they dont' work ;-(

    This is the script I wrote down:

    INPUT
    AssumeTFF().SeparateFields()

    Trim/Fade
    Crop/Lanczos4Resize
    DeHalo_alpha/MosquitoNR/WhiteBalance/Tweak/MSharpen/GrainFactory3

    Weave()

    Any idea?
    Quote Quote  
  4. What was the error? Try adding AssumeFieldBased() and AssumeTFF() just before the Weave().
    Quote Quote  
  5. You are not allowed to perform any processing that affecting spatial structure of data. To resize interlaced video first it need to be deinterlaced then processed then it can be reinterlaced - exception from this if you perform resizing exactly by 2 or generally even factor .

    Generally for trimming video, it is way more safe to deal with deinterlaced video - frequently it can be seen that some professional broadcasters (public one) may have problems with field dominance due lack of proper deinterlacing before processing.
    Quote Quote  
  6. Member
    Join Date
    Jul 2016
    Location
    Italy
    Search PM
    Originally Posted by jagabo View Post
    What was the error? Try adding AssumeFieldBased() and AssumeTFF() just before the Weave().
    Unfortunately nothing happened. I tried to remove the crop comand but with no results.
    Quote Quote  
  7. +1 pandy

    You unfortunately must deinterlace prior to any re-sizing operation. There is no way around that. I don't like deinterlacing, so I try to always avoid any re-sizing.

    Your code will work for filters that don't look ahead or behind in time (i.e., are not temporal). For temporal filters, you must take your separated fields, and apply the filter to the even and odd fields as separate operations. You then interleave those modified even and odd fields, and then do the weave.

    This post from an old guide explains it better:

    "If you want to process interlaced video (thus leaving it interlaced), you should remember the following issue. When using only a spatial smoother, it is sufficient to use:

    SeparateFields()
    Filter(...)
    Weave()

    But when using a spatio-temporal smoother (or just a temporal smoother), this produces incorrect results. The reason is that the temporal smoothing occurs over two fields from the same frame (this happens for half the number of frames). To avoid this, you should put them in different clips:

    SeparateFields()
    even = SelectEven(last).Filter(...)
    odd = SelectOdd(last).Filter(...)
    Interleave(even, odd)
    Weave()
    "
    Here is a function for replacing duplicate frames found in interlaced video with motion estimated frames. It illustrates how to operate on the even and odd separated fields, and then interleave and weave everything back into interlaced video:

    Code:
    function filldropsI (clip c)
    {
      even = c.SeparateFields().SelectEven()
      super_even=MSuper(even,pel=2)
      vfe=manalyse(super_even,truemotion=true,isb=false,delta=1)
      vbe=manalyse(super_even,truemotion=true,isb=true,delta=1)
      filldrops_e = mflowinter(even,super_even,vbe,vfe,time=50)
    
      odd  = c.SeparateFields().SelectOdd()
      super_odd=MSuper(odd,pel=2)
      vfo=manalyse(super_odd,truemotion=true,isb=false,delta=1)
      vbo=manalyse(super_odd,truemotion=true,isb=true,delta=1)
      filldrops_o = mflowinter(odd,super_odd,vbo,vfo,time=50)
    
      evenfixed = ConditionalFilter(even, filldrops_e, even, "YDifferenceFromPrevious()", "lessthan", "0.1")
      oddfixed  = ConditionalFilter(odd,  filldrops_o, odd,  "YDifferenceFromPrevious()", "lessthan", "0.1")
    
      Interleave(evenfixed,oddfixed)
      Weave()
    }
    Quote Quote  
  8. What do you mean by "they don't work /nothing happened ? /no results ?"

    DO you see anything ? or just original source ?

    Any error message ?

    Post your full script
    Quote Quote  
  9. Member
    Join Date
    Jul 2016
    Location
    Italy
    Search PM
    All right, this is my script:

    DirectShowSource("InputFootage.vob")
    AssumeTFF().SeparateFields()

    Trim(275,0)
    FadeIn(50).FadeOut(50)
    Crop(20,0,-20,0)
    Lanczos4Resize(720,288)

    DeHalo_alpha(rx=2.0, ry=2.0, darkstr=1.0, brightstr=1.0, lowsens=50, highsens=50, ss=1.5)
    MosquitoNR(strength=18, restore=128, radius=2, threads=0)
    WhiteBalance(r1=235, g1=249, b1=249, r2=3, g2=11, b2=4)
    Tweak(bright=2.25, sat=0.925)

    daa().daa().daa()
    MSharpen(threshold=10, strength=100, highq=true, mask=false)
    GrainFactory3(2,1,1,65,71,85,1.5,1.3,1.1)

    AssumeFieldBased().Weave()


    The result is quite strange, as it is rendered progressive but it shows the classic interlace flicker, which is much more noticeable than the source footage.
    Please johnmeyer, according to your quote to that old guide, can you tell me how do I have to modify my script? Thank you.
    Quote Quote  
  10. Originally Posted by Marcoh_ View Post
    All right, this is my script:
    There's quite a lot wrong with that script even before going into how to filter interlaced footage. Maybe you could also make available 10 seconds or so from the source.

    DirectShowSource("InputFootage.vob")
    Make a D2V project file so you can use MPEG2Source.

    Trim(275,0)
    By removing an odd number of fields I think you switched the field order. Maybe you don't care. Someone else can confirm or dispute.

    FadeIn(50).FadeOut(50)
    You lost two more fields/frames by doing it this way. Maybe you don't care. Ordinarily this operation is done like this:

    FadeIO0(50)

    Tweak(bright=2.25, sat=0.925)
    Probably not a good idea. You want to keep the full range, usually, so it might be better written as:

    Tweak(bright=2.25, sat=0.925,Coring=False)

    although, again, a sample would be helpful.
    Quote Quote  
  11. don't use directshowsource for a vob...please.use mpeg2source & dgindex instead
    Quote Quote  



Similar Threads