VideoHelp Forum
+ Reply to Thread
Results 1 to 25 of 25
Thread
  1. Hello Everybody,

    I had to start this thread, because I couldn't find anything helpful on the internet.
    I've got some videos from the internet, which are wrong deinterlaced. Which means they are progressive but still have some interlaced lines at some scenes.
    Here is an example:
    Image
    [Attachment 60001 - Click to enlarge]

    Is there any tool/filter that can fix it?

    Thanks
    Pat
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    May be able to clean it up a little, but usually this damage is baked in.
    Post a representative video sample, 15 seconds probably enough
    Quote Quote  
  3. Hello davexnet,
    thanks for your reply. Here is a smaple.
    Image Attached Files
    Quote Quote  
  4. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    I don't think there's much improvement that can be made, but you may get other input
    Quote Quote  
  5. Sometimes ffmpeg with the yadif filter will make some improvements, and sometimes the Libavcodec Deinterlacer can help. But I agree with the previous response that there generally isn't much that can be done about it.
    Quote Quote  
  6. QTGMC has a repair function for bad deinterlacing artifacts:
    t = QTGMC( Preset="Slower", InputType=2 )
    b = QTGMC( Preset="Slower", InputType=3, PrevGlobals="Reuse" ) # Reuse motion vectors from first call for a good speed-up
    Repair( t, b, 1 )
    Quote Quote  
  7. Thanks for the suggestions. I'll give it a try because I have nothing to lose
    Quote Quote  
  8. There are also Functions like De-Bilinear or De-Bicubic. The stripes are caused by Field-Delays (not interlacing) and then resizing in that state. If you are lucky and find the right parameters you can maybe downsize to original size and then fix the field delay. But you need a lot of luck for this, I never managed it.
    Quote Quote  
  9. You can blur the video, thus blending the fields, but do this only if any other options don't work
    Quote Quote  
  10. Thanks again for the suggestions.
    Unfortunately the yadif or QTGMC couldn't fix it.
    The downsize funktion sounds interesting but I have absolutely no idea what the original size could be.
    I've tried some but it didn't work. Is there any tool that can give me a preview so I can downsize step by step?
    A blur could be also a solution, as the lines are just in some random frames and not the whole video.
    Quote Quote  
  11. Use a function that resizes but keeps the frame size. Call it with Animate().

    Code:
    ###################################################
    
    function vresize(clip c, int vheight)
    {
    	Spline36Resize(c, c.width, vheight) # resize the incoming video
    	AddBorders(0,0,0,c.height-vheight) # restore the original frame size by adding black lines at the bottom
    	Subtitle(string(vheight)) # show the size it was resized to
    }
    
    ###################################################
    
    LWLibavVideoSource("sample.mp4", cache=false) 
    
    Trim(0,length=1) # isolate a good frame for testing
    Loop(700,0,0) # repeat it 700 times
    ConvertToYV24()
    Animate(0,699, "vresize", last,20, last,720) # see it at different verical sizes
    Quote Quote  
  12. I don't know about QTGMC / Avisynth. I use Avidemux for most editing, it can step through frame-by-frame, and it has several deinterlacing filters and a preview mode so you can see what the options do. It also has a scale (resize) function and you can set the size by pixels or percent. It's also possible to step forward one frame at a time in VLC but you have to use the "Customize Interface" option to add the step by step buttons to the control area, they're not there by default.
    Quote Quote  
  13. What @jagabo wrote can be a good thing to watch what happens with different parameters. The problem in this case is, that the clip had been resized while being in a pseudo-interlaced state. That means it is not enough to resize back to the original size, you have to "reverse" the done resizing as far as possible to get the original Interlace-structure, which can be corrected then. This can in many cases be done by the functions I mentioned: De-Bilinear or De-Bicubic, no other chance.
    You can deinterlace or something and then try to improve the blending but this won't work, no matter how you try.
    Quote Quote  
  14. Debicubic(444) worked pretty well.

    Code:
    LWLibavVideoSource("sample.lines.mp4", cache=false) 
    AssumeTFF()
    Debicubic(width, 444)
    QTGMC()
    Spline36Resize(width,720)
    The 444 value was found with a script like the one I gave in post #11, using Debicubic() instead of Spline36Resize(). I converted to RGB rather than YV24 since Debicubic() doesn't support YV24. And 32 AviSynth is required since there doesn't seem to be a 64 bit version of Debicubic().
    Image Attached Files
    Last edited by jagabo; 11th Aug 2021 at 08:36.
    Quote Quote  
  15. Might save my life too, once in the future! Thanks for this, @jagabo!

    Edit: If the output after DeBicubic is very clean then TFM() should be enough to re-order the delayed fields. Then there would no deinterlacer like QTGMC be necessary.
    Last edited by Quint; 11th Aug 2021 at 11:52.
    Quote Quote  
  16. I used QTGMC because I thought it might clean up some of the remaining artifacts. And it wasn't clear what the actual frame rate should be.
    Quote Quote  
  17. Wow, DeBicubic really did a nice job.
    Now one would just need an automated way to find the right height.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  18. Originally Posted by Selur View Post
    Wow, DeBicubic really did a nice job.
    Now one would just need an automated way to find the right height.
    Height can either be 576 or 480, if this was taken from dvd
    Quote Quote  
  19. @sm-p: wrong height. I'm speaking of the Debicubic parameter,...
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  20. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Impressive work. I didn't look at post 11 yet, so I've no idea how long it too to find the value.
    Was also going to mention two or three versions of this video up on Youtube although at first glance
    Jagabo's result is better than those
    Quote Quote  
  21. It only took a few seconds once the script was written:

    Code:
    function vresize(clip c, int vheight)
    {
    	DeBilinear(c, target_width=c.width, target_height=vheight) # downscale
    	AddBorders(0,0,0,c.height-vheight) # restore original height with black border
    	Subtitle(string(vheight)) # show the vheight used for easy reference
    }
    
    LWLibavVideoSource("sample.mp4", cache=false) 
    
    Trim(0,length=1) # get a frame for testing
    Loop(700,0,0) # repeat it 700 times
    
    ConvertToRGB()
    Animate(0,699, "vresize", last,699, last,20) # show sizes 20 to 7
    Bob().SelectEven()
    I suspect you can get even better results by fine tuning the src_top and/or src_height parameters.
    Quote Quote  
  22. The result is quite impressive to be honest. Thank you very much for that work!
    Now I need to figure out how I can get this code into Staxrip
    Quote Quote  
  23. Member
    Join Date
    Aug 2017
    Location
    United States
    Search PM
    Originally Posted by jagabo View Post
    Use a function that resizes but keeps the frame size. Call it with Animate().
    ....
    Great idea there, jagabo. Saved for later use.
    Quote Quote  
  24. Originally Posted by SaurusX View Post
    Originally Posted by jagabo View Post
    Use a function that resizes but keeps the frame size. Call it with Animate().
    ....
    Great idea there, jagabo. Saved for later use.
    Yes, Animate() is a great tool for quickly finding the correct value to use with many filters.
    Quote Quote  
  25. Sorry for bumping old threads, but THANKS! This method works very well!
    Quote Quote  



Similar Threads

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