VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 33
Thread
  1. Happy Friday! and thanks in advance for any help. I'm trying for the first time to downscale a 4K 2060p HEVC 10bit video to 2K 1080p AVC 10bit but am having trouble. The script

    Code:
    # Set DAR in encoder to 1920 : 817. The following line is for automatic signalling
    global MeGUI_darx = 1920
    global MeGUI_dary = 817
    LoadPlugin("PathToLSMASHSource.dll")
    LWLibavVideoSource("TestClip[2160p].mkv", format="YUV420P8")
    SetFilterMTMode("Default_MT_Mode",2)
    SMDegrain(TR=3,ThSAD=500,RefineMotion=True,Plane=0,Chroma=False,n16=True,n16_Out=True)
    ### Spline36Resize(1920,817).Sharpen(0.2) ###
    FastLineDarkenMod4()
    F3KDB(Y=100,Cb=100,Cr=100,GrainY=0,GrainC=0)
    PreFetch(5)
    works as it should, but as soon as I activate the resize line MeGUI crashes. I've spent half a day searching for a solution without any success. I'm thinking it's an issue with the HEVC source but, to be honest, I've no idea .

    Here's a short clip[New].

    Thanks again for any help .
    Last edited by LouieChuckyMerry; 6th May 2023 at 15:04.
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Typical delivery format video, with 4:2:0 chroma sampling has to be mod2 sizes, width and height
    Quote Quote  
  3. For better performance I Would move resize line above smdegrain
    Quote Quote  
  4. Originally Posted by davexnet View Post
    Typical delivery format video, with 4:2:0 chroma sampling has to be mod2 sizes, width and height
    Thanks for your reply; would you be willing to translate it?


    Originally Posted by Atak_Snajpera View Post
    For better performance I Would move resize line above smdegrain
    It's my understanding that it's better to denoise before resizing; why would you resize first?
    Quote Quote  
  5. 4x Less pixels to denoise. 4x better performance.
    Why Would you denoise pixels just to discard them in next step VIA resizing?
    Last edited by Atak_Snajpera; 5th May 2023 at 16:12.
    Quote Quote  
  6. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by LouieChuckyMerry View Post
    Originally Posted by davexnet View Post
    Typical delivery format video, with 4:2:0 chroma sampling has to be mod2 sizes, width and height
    Thanks for your reply; would you be willing to translate it?
    Translate? It just means width / height must be cleanly divisible by 2, no odd numbers allowed
    Quote Quote  
  7. so, instead of Spline36Resize(1920,817) use either Spline36Resize(1920,818) or Spline36Resize(1920,816)
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  8. Originally Posted by Atak_Snajpera View Post
    4x Less pixels to denoise. 4x better performance.
    Why Would you denoise pixels just to discard them in next step VIA resizing?
    As explained to me at Doom9 by several people, removing noise first allows for better accuracy on the resize.
    _____________

    davexnet; Selur: It still crashes with Spline36Resize(1920,818) or Spline36Resize(1920,816).
    Quote Quote  
  9. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by LouieChuckyMerry View Post
    Originally Posted by Atak_Snajpera View Post
    4x Less pixels to denoise. 4x better performance.
    Why Would you denoise pixels just to discard them in next step VIA resizing?
    As explained to me at Doom9 by several people, removing noise first allows for better accuracy on the resize.
    _____________

    davexnet; Selur: It still crashes with Spline36Resize(1920,818) or Spline36Resize(1920,816).
    Does MeGui actually crash with an error code - Or are you getting an Avisynth error message?
    Quote Quote  
  10. Originally Posted by LouieChuckyMerry View Post
    That file is 1920x808, not 4K.
    Quote Quote  
  11. davexnet: No error code of any kind, MeGUI simply disappears.
    _____________

    Originally Posted by jagabo View Post
    Originally Posted by LouieChuckyMerry View Post
    That file is 1920x808, not 4K.
    Here's the MediaInfo for the video:

    Code:
    Video 
    ID : 1 
    Format : HEVC 
    Format/Info : High Efficiency Video Coding 
    Format profile : Main 10@L5@High 
    Codec ID : V_MPEGH/ISO/HEVC 
    Duration : 1 h 50 min 
    Bit rate : 20.6 Mb/s 
    Width : 3 840 pixels 
    Height : 1 634 pixels 
    Display aspect ratio : 2.35:1 
    Frame rate mode : Constant 
    Frame rate : 23.976 FPS 
    Color space : YUV 
    Chroma subsampling : 4:2:0 
    Bit depth : 10 bits 
    Bits/(Pixel*Frame) : 0.137 
    Stream size : 15.9 GiB (85%) 
    Default : Yes 
    Forced : No 
    Color range : Limited 
    Color primaries : BT.709 
    Transfer characteristics : BT.709 
    Matrix coefficients : BT.709
    Quote Quote  
  12. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    @LouieChuckMerry, the video on your "Here's a short clip" link in your post #1 is as Jagabo says:

    Code:
    General
    Unique ID                                : 298982791378727529867026321803490179530 (0xE0EDFDB73D8DEB7D37532C65EA2D39CA)
    Complete name                            : C:\Users\bb19\Downloads\TestClip[2160p].mkv
    Format                                   : Matroska
    Format version                           : Version 4
    File size                                : 14.4 MiB
    Duration                                 : 5 s 89 ms
    Overall bit rate                         : 23.8 Mb/s
    Frame rate                               : 23.976 FPS
    Encoded date                             : 2023-05-05 19:28:48 UTC
    Writing application                      : mkvmerge v68.0.0 ('The Curtain') 64-bit
    Writing library                          : libebml v1.4.2 + libmatroska v1.6.4
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.1
    Format settings                          : CABAC / 5 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 5 frames
    Codec ID                                 : V_MPEG4/ISO/AVC
    Duration                                 : 5 s 89 ms
    Bit rate                                 : 23.7 Mb/s
    Width                                    : 1 920 pixels
    Height                                   : 808 pixels
    Display aspect ratio                     : 2.40:1
    Frame rate mode                          : Constant
    Frame rate                               : 23.976 (23976/1000) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Is it not the HEVC file you reference in the post above.
    Quote Quote  
  13. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    I would create a manual script in Notepad, and see if it opens in VIrtualdub2 or AVSPmod
    See if it performs as expected.
    As was mentioned previously, the clip posted in the first post above, is not what you're describing.
    It's neither HEVC, 10-bit nor 4K
    Quote Quote  
  14. ALL: I'm really sorry and not sure why my uploaded clip is not as the source (I did wonder why a five second section cut from a source using MKVToolNix registered as a five-plus minutes file in MediaInfo). I'll make a more accurate clip as soon as I can, thanks for your patience.
    Quote Quote  
  15. Originally Posted by LouieChuckyMerry View Post
    Originally Posted by Atak_Snajpera View Post
    4x Less pixels to denoise. 4x better performance.
    Why Would you denoise pixels just to discard them in next step VIA resizing?
    As explained to me at Doom9 by several people, removing noise first allows for better accuracy on the resize.
    _____________

    davexnet; Selur: It still crashes with Spline36Resize(1920,818) or Spline36Resize(1920,816).
    That's total BS. Simple Spline36Resize filter does not need denoised pixels to be accurate. Besides when you downscale you already perform denoising because 4 pixels will be averaged to just 1 pixel. What you do is extremely inefficient. Your time , your electricity bill and your placebo effect...
    Quote Quote  
  16. That's total BS.
    It's not.
    It's easier/more accurate to properly clean (denoise, deblock, derainbow,..) in the native resolution, especially if you upscale afterward.
    If you !downscale!, depending on the noise and artifacts in the source, it can be fine to resize first, and it will be beneficial to the processing speed.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  17. But we are NOT upscaling! We are downscaling. No need to waste time for pixels which will be discarded anyway and then butchered by H.264/AVC compression algorithms.
    Last edited by Atak_Snajpera; 6th May 2023 at 03:23.
    Quote Quote  
  18. True, but the general advice isn't BS. + depending on the nature of the source, downscaling can unnecessarily change the nature of artifacts&co and thus hinder proper cleaning.
    So your advice isn't really that good of a general advice either.
    => it always depends
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  19. it is obvious what I meant if you read his post

    As explained to me at Doom9 by several people, removing noise first allows for better accuracy on the resize.
    Quote Quote  
  20. Not, to me. To me, that seems more like a not so well phrased statement. And it's more about the quality of the resize than the accuracy.
    So I agree, to disagree and think your blatant
    That's total BS.
    still is unwarranted.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  21. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    I agree with Selur. Saying "That's total BS." is wrong.

    If you denoise before upscale is always better. If you denoise before downscale it can produce better results or it can be transparent with respect to a denoise after downscale.

    Then, if you denoise before you're never wrong, and it is always the best blind choice. Eventually, you may loose resources efficiency and electricity bill in downscaling under certain conditions, but is marginal and neglettable.
    Quote Quote  
  22. When you downscale from 4K to FHD you are averaging 4 pixels to 1 pixel.
    Example



    This means that you do not have to use aggressive denoising settings later in the script. More aggressive settings in SMdegrain may introduce ghosting artefacts. Simple!
    Last edited by Atak_Snajpera; 6th May 2023 at 05:49.
    Quote Quote  
  23. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    If one if the four gray pixel is noise, it will be included in the average pixel while it should be not, and it will be not possible to remove it later after downscale.
    There are other cases where this do not apply.
    Simple!

    P.S. SMdegrain perform its best feature as a temporal denoiser, meaning that it looks to denoise between frames and not inside same frame, like TemporalDegrain2. Choose a pure spatial denoiser for your example
    Quote Quote  
  24. You live in perfect world where SMDegrain can ALWAYS detect noise perfectly. Averaged pixels will be less visible to our eyes so what is your problem? Besides lossy codecs like x264/x265 will destroy your fine pixels anyways by further "averaging" those pixels.

    Stop living in placebo bubble and do not waste energy.
    Quote Quote  
  25. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    so what is your problem?
    My problem is that you are technically wrong and instead replying with facts bring into the discussion "points of view"

    Besides x264/x265 will destroy your fine pixels anyways by further "averaging" those pixels.
    I agree. But we are talking about science before everything else. Then, given the further compression, we may consider that any video improvement is a waste of time (but at low CRF even h264 is not really different from original at normal view, so it is worth, instead)

    Stop living in placebo world and do not waste energy.
    There is no waste of enery trying to obtain the best possible result. Sometimes the chosen road can be not the shortest, but what is important is the final results. Reread my post #21 and you'll understand better.
    Quote Quote  
  26. Have you ever heard about term "Diminishing returns"
    https://en.wikipedia.org/wiki/Diminishing_returns

    I'm talking about common sense. You just like placebo effect.
    Quote Quote  
  27. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Have you ever heard about term "Diminishing returns"
    I am familiar with any concept you can bring into our discussion, yes. Which does not change a comma in what said.

    I'm talking about common sense. You just like placebo effect.
    It's just your conclusion. (You didn't re-read post number 21, did you?)
    Quote Quote  
  28. ALL: I used Avidemux to cut the clip and it seems OK; the link in my original post has been edited.
    _____________

    Originally Posted by davexnet View Post
    I would create a manual script in Notepad, and see if it opens in VIrtualdub2 or AVSPmod
    See if it performs as expected.
    As was mentioned previously, the clip posted in the first post above, is not what you're describing.
    It's neither HEVC, 10-bit nor 4K
    This script:

    Code:
    # Set DAR in encoder to 1920 : 816. The following line is for automatic signalling
    global MeGUI_darx = 1920
    global MeGUI_dary = 816
    LoadPlugin("PathToLSMASHSource.dll")
    LWLibavVideoSource("TestClip[2160p].mkv", format="YUV420P8")
    SetFilterMTMode("Default_MT_Mode",2)
    SMDegrain(TR=3,ThSAD=500,RefineMotion=True,Plane=0,Chroma=False,n16=True,n16_Out=True)
    Spline36Resize(1920,816).Sharpen(0.2) ###
    FastLineDarkenMod4()
    F3KDB(Y=100,Cb=100,Cr=100,GrainY=0,GrainC=0)
    PreFetch(5)
    Opens in both VirtualDub2 and AvsPmod. I also noticed that when adding the source to MeGUI for indexing, the option to resize is grayed out. Is it possibly an MeGUI issue? Maybe I'll resize it in VirtualDub2 using a lossless codec then clean it up and shrivel it with MeGUI.
    _____________

    Atak_Snajpera: For what it's worth, when I began trying to learn AviSynth I wanted to know the "best" way to order things and wound up at Doom9. After much helpful input I settled on:

    Code:
    # Deinterlace
    # Color Conversion
    # Color Adjustment
    # Crop
    # Denoise
    # Resize
    # Sharpen
    # Deband
    # Dither
    Of course, that was going on ten years ago so maybe things have changed since then; I'm far far far from expert so I've just stuck with the above because it seems reasonable to me .
    Last edited by LouieChuckyMerry; 7th May 2023 at 13:54. Reason: Typo
    Quote Quote  
  29. Maybe that "global MeGUI_dary = 817" is a problem in MeGUI?
    Quote Quote  
  30. Try mClean instead of SMDegrain.

    Cu Selur

    Ps.: SCUNet, isn't bad to remove such noise: https://imgsli.com/MTc2NTM4 (but it's probably too slow and would require Vapoursynth)
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  



Similar Threads

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