VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 54
  1. Hello,

    I have recently acquired some DVCam footage from the mid 2000s. I have acquired just the digital files, not the master tapes. All of the digital files appear to be interlaced, but traditional deinterlacing methods (i.e. Compressor) do not work to deinterlace them. The closest I have come to solving the issue is by attempting to blend deinterlace the videos by reducing the vertical size by 1/2, exporting, then re-exporting in normal height. This gets rid of most of the harsh interlacing, but still leaves jagged edges and ghosting. I have attached screenshots of both the original file, and the blend deinterlaced file. Is there any way to improve on the blend deinterlaced file? I have looked into Topaz AI, but have heard conflicting reports on its effectiveness, and would prefer not to spend that amount of money if possible.

    Image
    [Attachment 74434 - Click to enlarge]


    Blend Deinterlaced + HandBrake Deinterlacing (EEDI2 Bob) File

    Image
    [Attachment 74435 - Click to enlarge]


    Original File
    Quote Quote  
  2. Share a sample file with the issue, not some screenshots, unless you want folks to give you advice on using some image editor.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Here is a sample of the original video.
    Image Attached Files
    Quote Quote  
  4. It was upscaled progressively to 1280x720p25, while still interlaced - this causes problems and artifacts

    You can try to use an inverse kernel such as debicubic, debilinear to reverse the process back to the original 720x576i25 format. It's not always perfect

    This example uses debicubic, but also double rate deinterlaces to 50p; but you have other options to keep the interlace depending on what the project is

    This is avisynth code, but you could it in vapoursynth as well (probably easier for a mac)
    Code:
    LSmashVideoSource("TEST.mov")
    DebicubicResizeMT(720,576)
    AssumeTFF()
    QTGMC(sharpness=0.5, border=true)

    It's less bad than what you have now. If they still have the original project and files - ask them to export again properly
    Image Attached Files
    Quote Quote  
  5. That's 10bit422 AVC , if you're having problems viewing it here is a prores version
    Image Attached Files
    Quote Quote  
  6. DVCam should be SD, seems like someone tool interlaced dv, and resized it to 1280x720 and saved it progressively (while messing up the aspect ratio).
    Now the content isn't interlaced, but progressive with distorted 'backed in' combing artifacts.
    So even if you throw away half or more of the horizontal resolution, you will still have ghosting.
    => resizing to the original 720x576, then deinterlacing and doing some cleaning like paisendeathray did is probably the best you get.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  7. Originally Posted by poisondeathray View Post
    It was upscaled progressively to 1280x720p25, while still interlaced - this causes problems and artifacts

    You can try to use an inverse kernel such as debicubic, debilinear to reverse the process back to the original 720x576i25 format. It's not always perfect

    This example uses debicubic, but also double rate deinterlaces to 50p; but you have other options to keep the interlace depending on what the project is

    This is avisynth code, but you could it in vapoursynth as well (probably easier for a mac)
    Code:
    LSmashVideoSource("TEST.mov")
    DebicubicResizeMT(720,576)
    AssumeTFF()
    QTGMC(sharpness=0.5, border=true)
    I really appreciate this, thanks for getting back to me. I'm having a lot of trouble trying to get VapourSynth to work for Mac. I seem to have installed a version of the Editor, but am having difficulty adapting the code to get it to apply the settings you did. Are there any resources you know of that I can use to try and get it working on my end?
    Quote Quote  
  8. This is the tutorial I followed (which I believe is primarily for making GIFs, but I assume it should include all functionality): https://hackmd.io/@nibreon/vapoursynth-book/%2F%40nibreon%2Fmacos
    Quote Quote  
  9. It might be easier to use a GUI at first until you are comfortable with using vapoursynth. I think selur's hybrid is still available for macos (?)
    https://www.videohelp.com/software/Hybrid

    It should have everything bundled like QTGMC. Not sure if descale is included . Selur is around he will comment
    https://github.com/Irrational-Encoding-Wizardry/descale



    avisynth can run on mac too now, apparently. Not sure if all plugins can , however...
    https://github.com/AviSynth/AviSynthPlus/releases

    There are mac os assets available

    But script like QTGMC involves collecting dozens of dependencies. So GUI is probably easiest way to go at first



    Best option is still to get the proper SD version exported , and start with that, instead of the upscaled botched version if possible
    Last edited by poisondeathray; 20th Oct 2023 at 10:24.
    Quote Quote  
  10. I think selur's hybrid is still available for macos
    and old version: yes
    (got no mac and nobody is building the files Hybrid uses, so no updates. )
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  11. Thank you both so much. I feel like I'm getting closer to working it out. My brain is like mush at the moment so going to try again after the weekend but will update you with how I get on!
    Quote Quote  
  12. Hi both, I've been trying to get the results that poisondeathray got on the video using Hybrid and am having issues.

    The first issue (which is probably an install issue on my end, but want to check), is that when I run a preview of the script, the editor says that "There is no function named SetFrameProps", and I believe this is causing the Hybrid encoding to crash, meaning I have no way to export the video. I think this is because Hybrid wants to change the color matrix to 709, but I'm not sure this is needed on my video? Either way, any help on that would be great. I can always attempt to reinstall VapourSynth and Hybrid if necessary.

    The second issue is that even if I take SetFrameProps out of the script, and preview the video, the interlacing actually gets worse on my video. I have attached a screenshot as I can't export a video.

    Image
    [Attachment 74509 - Click to enlarge]


    One thing I am having trouble with is that poisondeathray specified using an inverse kernel like debicubic, but I can only see resizing options for bicubic and bilinear, maybe I'm missing something in the UI, but maybe this is why it's not interlacing properly. I'll post the script that the editor previews to see if you think it should have the right settings based on your original code (this is with the problematic SetFrameProps lines):

    # Imports
    import os
    import sys
    import vapoursynth as vs
    # getting Vapoursynth core
    core = vs.core
    # Import scripts folder
    scriptPath = '/Applications/Hybrid.app/Contents/MacOS/vsscripts'
    sys.path.insert(0, os.path.abspath(scriptPath))
    # Import scripts
    import edi_rpow2
    import havsfunc
    # source: '/Users/tom/Desktop/TEST.mov'
    # current color space: YUV422P10, bit depth: 10, resolution: 1280x720, fps: 25, color matrix: 709, yuv luminance scale: limited, scanorder: top field first
    # Loading /Users/tom/Desktop/TEST.mov using LibavSMASHSource
    clip = core.lsmas.LibavSMASHSource(source="/Users/tom/Desktop/TEST.mov")
    # Setting color matrix to 709.
    clip = core.std.SetFrameProps(clip, _Matrix=1)
    clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
    clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=1)
    # Setting color range to TV (limited) range.
    clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
    # making sure frame rate is set to 25
    clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
    # setting field order to what QTGMC should assume (top field first)
    clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
    # Deinterlacing using QTGMC
    clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True) # new fps: 25
    # make sure content is preceived as frame based
    clip = core.std.SetFieldBased(clip, 0)
    clip = clip[::2]
    # resizing using ZNEDI3
    clip = edi_rpow2.nnedi3_rpow2(clip=clip, rfactor=2) # 2560x1440
    # adjusting resizing
    clip = core.fmtc.resample(clip=clip, w=720, h=576, kernel="lanczos", interlaced=False, interlacedd=False)
    # adjusting output color from: YUV422P16 to YUV422P10 for ProResModel
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, range_s="limited")
    # set output frame rate to 25.000fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
    # Output
    clip.set_output()
    Last edited by Tom619; 27th Oct 2023 at 04:40.
    Quote Quote  
  13. Originally Posted by Tom619 View Post
    The first issue (which is probably an install issue on my end, but want to check), is that when I run a preview of the script, the editor says that "There is no function named SetFrameProps", and I believe this is causing the Hybrid encoding to crash, meaning I have no way to export the video.
    SetFrameProp (without the "s") should be in all versions of vapoursynth. I don't use Hybrid, but selur should be around

    I think this is because Hybrid wants to change the color matrix to 709, but I'm not sure this is needed on my video?
    If you left it at SD, the matrix should be 170m (or 601) , But you can an upscale specified, so the procedure should be a 601 to 709 shift. HD uses 709 by convention

    The second issue is that even if I take SetFrameProps out of the script, and preview the video, the interlacing actually gets worse on my video. I have attached a screenshot as I can't export a video.


    One thing I am having trouble with is that poisondeathray specified using an inverse kernel like debicubic, but I can only see resizing options for bicubic and bilinear,
    It's worse because the most important step in your case is the "reverse" scaling. The "de-whatever scaling" that attempts to reverse the scaling algorithm that damaged your video in the first place. It's "descale" in vapoursynth. It has to be applied first. The link is posted above, because I wasn't sure if Hybrid bundled it

    Code:
    clip = core.descale.Debicubic(clip, 720,576)

    Originally Posted by poisondeathray View Post

    It should have everything bundled like QTGMC. Not sure if descale is included . Selur is around he will comment
    https://github.com/Irrational-Encoding-Wizardry/descale
    Quote Quote  
  14. I've reinstalled Hybrid using this guide: https://forum.selur.net/thread-1279.html and the issues I had with SetFrameProps and the colour matrix have vanished thankfully! I'm still having issue getting the footage to descale. From what I can tell on the guide, descale is included, but it's unclear where the option to use it is in Hybrid. Selur describes it here as just using the resize function: https://forum.selur.net/thread-2290.html but the code doesn't include the string you specified, and I think that is leaving the footage still jagged. Hopefully selur can assist!
    Quote Quote  
  15. Originally Posted by Tom619 View Post
    Selur describes it here as just using the resize function: https://forum.selur.net/thread-2290.html but the code doesn't include the string you specified, and I think that is leaving the footage still jagged.
    That's resizing using the internal resizer - it's the wrong one

    You'd need to use the descale algorithm specifically
    Quote Quote  
  16. Yes that's what I thought, but I can't seem to find anyway to access the descale algorithm in Hybrid, or get it to work by inserting it into a script manually.
    Quote Quote  
  17. Works fine by adding custom code, but (assuming you are using Windows) I can send you a dev version with a 'Lower res. before deinterlace' option, which will call descale.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  18. Unfortunately I'm on Mac so I am unable to use that! For the custom code, I feel like I'm just missing one piece of the puzzle. I have gone to Filtering > Vapoursynth > Custom, and Insert before > End, and typed in poisondeathray's code: clip = core.descale.Debicubic(clip, 720,576). However when I run the script, I get this error:

    Failed to evaluate the script:
    Python exception: Descale: Constant format GrayS, RGBS, and YUV444PS are the only supported input formats.

    Here is the full code in case there are any errors with it. My aim is to get a descaled version of the video, and then run it through again with the QTGMC deinterlace:

    # Imports
    import vapoursynth as vs
    # getting Vapoursynth core
    core = vs.core
    # defining beforeEnd-function - START
    def beforeEnd(clip):
    clip = core.descale.Debicubic(clip, 720,576)
    return clip
    # defining beforeEnd-function - END

    # source: '/Users/tom/Desktop/TEST.mov'
    # current color space: YUV422P10, bit depth: 10, resolution: 1280x720, fps: 25, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
    # Loading /Users/tom/Desktop/TEST.mov using LibavSMASHSource
    clip = core.lsmas.LibavSMASHSource(source="/Users/tom/Desktop/TEST.mov")
    # Setting color matrix to 709.
    clip = core.std.SetFrameProps(clip, _Matrix=1)
    clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
    clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=1)
    # Setting color range to TV (limited) range.
    clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
    # making sure frame rate is set to 25
    clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
    clip = beforeEnd(clip)
    # set output frame rate to 25.000fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
    # Output
    clip.set_output()
    Last edited by Tom619; 27th Oct 2023 at 04:40.
    Quote Quote  
  19. you need to use something like
    Code:
    clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="709", range_s="limited")
    clip = core.descale.Debicubic(clip, 720,576)
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, matrix_s="709", range_s="limited", dither_type="error_diffusion")
    and later resize to whatever resolution you want as output.

    In newer versions:
    Code:
    # requires colorformat RGBS
    clip = core.descale.Debicubic(clip, 720,576)
    # width 720
    # height 576
    works, but I don't know whether this already worked in the last mac version.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  20. Thank you so much! I finally have something I'm pretty happy with. Compared with poisondeathray's version, there is a bit more ghosting on mine (is this down to de-interlacing settings?), but thank you both so much for the help!
    Image Attached Files
    Quote Quote  
  21. could be the QTGMC settings
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  22. Spatially, there is not much difference. The biggest difference is 50p vs 25p . I double rate deinterlaced 25i to 50p, keeping all the data where each reconstructed field becomes a frame (50 fields becomes 50 frames). The version you uploaded discarded half the frames (50 fields becomes 25 frames) . Because the motion is smoother at 50p, human eye spends less time seeing the remaining defects
    Quote Quote  
  23. Instead of 'descale.Debicubic' you can also try 'descale.Debilinear' + adding SMDegrain also helps.
    Last edited by Selur; 24th Oct 2023 at 13:17.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  24. Sorry to bother you both again, I've exported the full film and am happy with the results but upon inspection of further parts of the video, there still is a large amount of interlaced line remnants in the image. I've uploaded a section of the video which I have descaled, deinterlaced, and degrained. Do you think the video can get any better than this or is this the limit of what can be done? (P.S. I haven't used Bob as I want to stay close to the original frame rate if I can)
    Image Attached Files
    Quote Quote  
  25. Okay, that sample is useless.
    We would need that section not descaled, deinterlaced and degrained.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  26. Here it is. Just to clarify, it's from the original source as the first video I sent, so in theory should have the same issues.
    Image Attached Files
    Quote Quote  
  27. If you use b=0.333, c=0.333, those are the debicubic parameters used for the avs version of DebicubicResizeMT by default . There is less ghosting, image is sharper
    Quote Quote  
  28. I think I've managed to get those parameters set up on Hybrid, using this code:

    clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="709", range_s="limited")
    clip = core.descale.Debicubic(clip, 720,576,0.333,0.333)
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, matrix_s="709", range_s="limited", dither_type="error_diffusion")
    Last edited by Tom619; 27th Oct 2023 at 04:26.
    Quote Quote  
  29. Here is the result, looks a lot better!
    Image Attached Files
    Quote Quote  
  30. Here is the code, I don't know if I can make any more improvements.

    Code:
    # Imports
    import os
    import sys
    import vapoursynth as vs
    # getting Vapoursynth core
    core = vs.core
    # defining beforeDeinterlace-function - START
    def beforeDeinterlace(clip):
      clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="709", range_s="limited")
      clip = core.descale.Debicubic(clip, 720,576,0.333,0.333)
      clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, matrix_s="709", range_s="limited", dither_type="error_diffusion")
      return clip
    # defining beforeDeinterlace-function - END
    
    # Import scripts folder
    scriptPath = '/Applications/Hybrid.app/Contents/MacOS/vsscripts'
    sys.path.insert(0, os.path.abspath(scriptPath))
    # Import scripts
    import edi_rpow2
    import nnedi3_resample
    import mvsfunc
    import smdegrain
    import havsfunc
    # source: '/Users/tom/Desktop/*EXTRAS/Hybrid Tests/Original File.mov'
    # current color space: YUV422P10, bit depth: 10, resolution: 1280x720, fps: 25, color matrix: 709, yuv luminance scale: limited, scanorder: top field first
    # Loading /Users/tom/Desktop/*EXTRAS/Hybrid Tests/Original File.mov using LibavSMASHSource
    clip = core.lsmas.LibavSMASHSource(source="/Users/tom/Desktop/*EXTRAS/Hybrid Tests/Original File.mov")
    # Setting color matrix to 709.
    clip = core.std.SetFrameProps(clip, _Matrix=1)
    clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
    clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=1)
    # Setting color range to TV (limited) range.
    clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
    # making sure frame rate is set to 25
    clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
    clip = beforeDeinterlace(clip)
    # setting field order to what QTGMC should assume (top field first)
    clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
    # Deinterlacing using QTGMC
    clip = havsfunc.QTGMC(Input=clip, Preset="Slower", InputType=0, TFF=True, TR2=1, Sharpness=0.5, SourceMatch=0, Lossless=0, opencl=True) # new fps: 25
    # make sure content is preceived as frame based
    clip = core.std.SetFieldBased(clip, 0)
    clip = clip[::2]
    # removing grain using SMDegrain
    clip = smdegrain.SMDegrain(input=clip, interlaced=False, opencl=True, device=-1)
    # resizing using NNEDI3CL
    clip = edi_rpow2.nnedi3cl_rpow2(clip=clip, rfactor=2, nns=1) # 2560x1440
    # adjusting resizing
    clip = core.fmtc.resample(clip=clip, w=720, h=576, kernel="lanczos", interlaced=False, interlacedd=False)
    # adjusting output color from: YUV422P16 to YUV422P10 for ProResModel
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, range_s="limited")
    # set output frame rate to 25.000fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
    # Output
    clip.set_output()
    Quote Quote  



Similar Threads

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