VideoHelp Forum
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. I am noticing that when my encode is finished, there are artifacts that look like little lines/blocks/rectangles moving around very rapidly in my video.

    They are not present in any previewer for the avisynth script, only in the encode.

    (Video sample)
    https://mega.nz/file/x9x3lBwI#M_7bk0cHu1GIXXpfIPO_nKj_O3OpNDSBwR9DO1DmILg

    Just make the video fullscreen and stare at the woman's brown hair the entire time and you will be able to see what it is I am talking about pretty easily. Might want to turn on repeat as well since it's a short clip.

    You should be able to see it if you fullscreen the 480p video, but if not here is a still screenshot comparison that might help you see what to look for.
    Script Preview / Encode
    https://slow.pics/c/s1MSioqo



    I tried denoisers, dithering, and overly powerful cleaning filters, but these still appear in the video once it's encoded. All those seem to be doing is changing the shape and or location of them a bit. I assume this is either bitrate/compression, or x264 setting related.

    Is there a specific setting I can adjust for x264 to lessen these or make them less obvious? The settings I am using can be found in the 5 second video clips information.
    Last edited by killerteengohan; 6th May 2023 at 17:09.
    Quote Quote  
  2. I looks like not enough bitrate for a grainy source.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    I looks like not enough bitrate for a grainy source.
    I thought that could be a possibility, and I used higher than average bitrate on it and it still had those. I also mentioned I tried denoising and cleaning it way more than I wanted to just to see if that helps and it didn't. So I don't think it's grains fault if it does it even when being cleaned. I literally tried overkill denoise by using deen() twice in a row with default settings just to see what would happen.

    I have an encode from someone else to compare to my dvd encode, and theirs doesn't have that issue when it comes to those artifacts I was referring to. It's only got about 200Kbps more than mine, which is barely anything. I think it might be encoder settings related.
    Quote Quote  
  4. Why do you set qpmin=10 and qpmax=28? Try qpmin=0 (default).
    Quote Quote  
  5. Grain in dark areas is always a problem for x264. Try --aq-mode=3 and more bitrate.
    Quote Quote  
  6. Looking at an inverted Retinex Edge Mask of the clip:

    there are a lot of edges, that should probably not be there and are due to compression artifacts. (other masks show this too)

    To me, it looks like compression artifacts reencoded and creating new compression artifacts since the bit rate isn't enough to deal with the new amount of details,..
    So I would suggest, either:
    • remove more of the initially unwanted edges / noise / compression artifacts
    • try to tweak the encoder ('--aq-mode=3 and more bitrate' and/or try "--nr ...")

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. I tried x265 and it still happens. The artifacts are smaller in size and slightly less obvious, but they are still there unlike in the avisynth preview.

    I will try giving it 18,000 bitrate which is overkill just to see what happens and if it helps any. I doubt the encoder will even be able to use all of that and will cap out somewhere around half that.

    I will reply both of you and let you know the results when it's done. Thanks!
    Quote Quote  
  8. I gave it a try and even with a bitrate set to 18,000Kbps the artifacts are still there. Just like with x265, its better and less obvious, but it still seems to be happening.

    Here is the 18,000kbps output.
    https://mega.nz/file/Zpoj1bTR#PXrDiEb-8sskusAz6jqNGOx0QKP9HKXY1wjXzOqsiwI



    Originally Posted by jagabo View Post
    Grain in dark areas is always a problem for x264. Try --aq-mode=3 and more bitrate.
    Auto Variance AQ (Experimental)? I only see AQ modes 0, 1, and 2 as options.



    Originally Posted by Selur View Post
    Looking at an inverted Retinex Edge Mask of the clip:

    there are a lot of edges, that should probably not be there and are due to compression artifacts. (other masks show this too)

    To me, it looks like compression artifacts reencoded and creating new compression artifacts since the bit rate isn't enough to deal with the new amount of details,..
    So I would suggest, either:
    • remove more of the initially unwanted edges / noise / compression artifacts
    • try to tweak the encoder ('--aq-mode=3 and more bitrate' and/or try "--nr ...")

    Cu Selur

    I think it's those bright white blocks in your image that are what I don't want. How would you recommend removing the edges you are talking about? Overly strong DNR doesn't seem to be working. I think it actually looks worse when this is done.
    18,000kbps with strong DNR applied
    https://mega.nz/file/hkB0iIRL#NpiBgl3R6---pCMLewF-KJm1VKqvpiOoHJpucC_Dhk0


    I will give original DVD footage, and the script I used on it. That sample from before was the outcome of the script to show what was happening once encoded. The preview looked nice and even, it's the encode that has the blocky artifacts.

    It's possible that it's the DVD sources fault and nothing I do is gonna stop it. Not sure if this is the case though because I see these artifacts in just about everything I encode, even 1080p stuff with bitrates of 20,000kbps and up. It's usually much less obvious though and not a problem.

    Use the script I used, and see if you get those artifacts when encoding it to x264.
    For the strong DNR sample, I just changed it from mctemporaldenoise into deen() and removed the mergeluma line right after it.

    VOB Demux
    https://mega.nz/file/NhQFzBJR#brDExDTQcShY1q5LfjqeWS0xhJVY3OSK4czQXAIisCw

    Script
    https://pastebin.com/H1xZY8Gq
    Last edited by killerteengohan; 7th May 2023 at 06:33.
    Quote Quote  
  9. I think it's those bright white blocks in your image that are what I don't want. How would you recommend removing the edges you are talking about?
    The main problem, to me, seem to be to get rid of the artifacts in the flat areas while not removing the details that should be kept.
    -> So I would recommend to look into masking, either by using a mask to only filter a specific part of the image or by using it to see the effect of filters.
    Here's what happens if I look at the inveresed Retinex mask (no filtering):

    Here's what happens if I apply DGDenoise and then look at the mask: (I only chose DGDenoise as an example, no clue whether it is the best suited)

    Here's what it looks like when DGDenoise is applied to the source:

    Problem is, DGDenoise kills too much of the details of the rock, so one could use DGDenoise, but it needs to be restricted, so the goal is to find a mask that fits and then use it together with DGDenoise.
    When I look at a LimitMask with a value of 100 (so everything below 100 - the white parts - get filtered):

    Here's what happens if I use DGDenoise with this mask:

    And here is what the reversed Retinex Mask after this:

    (as one can see, part of the 'noise' is gone)
    => I don't think this is the complete solution, but this should at least show how I would try to approach this. Especially for Anime/Manga cleanups, masking usually can really help.
    I did use Vapoursynth, but I'm pretty sure that these masks (or alternatives) also exist in Avisynth.

    Cu Selur

    Ps.: Hope this helps and isn't just me sharing a general confusion.
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  10. Originally Posted by killerteengohan View Post
    It's possible that it's the DVD sources fault and nothing I do is gonna stop it.
    Try
    Code:
    KNLMeansCL(h=3.0) #adjust the parameters as necessary
    Quote Quote  
  11. I agree, KNLMeansCL with h=2-5 is usually a good approach to attack such artifacts. Problem is, that it's quite destructive, so looking into how masking is done in Avisynth (probably using layers) might still be a good idea.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  12. Would the deblock settings in x264 also have any kind of bearing on this at all?
    Deblocking Strength / Deblocking Threshold
    I currently have those at 1 / 1 instead of default 0 / 0


    A couple have said try AQ mode 3. I only see AQ modes 0, 1, and 2 as options.

    0 = Disabled
    1 = Variance AQ (Complexity Mask)
    2 = Auto Variance AQ (Experimental)
    Quote Quote  
  13. aq-mode 3 applies more bitrate to dark areas.

    https://en.wikibooks.org/wiki/MeGUI/x264_Settings#aq-mode

    See also aq-strength.
    Quote Quote  
  14. These builds have aq-mode 3 ; I doubt that alone will fix your problem completely, you will still need high bitrates to preserve that noise in the source
    https://github.com/jpsdr/x264/releases

    --aq-mode <integer> AQ method [1]
    - 0: Disabled
    - 1: Variance AQ (complexity mask)
    - 2: Auto-variance AQ
    - 3: Auto-variance AQ with bias to dark scenes

    Another compounding problem in this sequences is the duplicate frames are not clean duplicates - the artifacts that are present (including rainbows) change in the source. Not only does this look bad, it will cause consumption of more bitrate in your encodes , and also reduce the effectiveness of any filters that you apply.

    One way to help with the flucutation is to use dup to replace with true duplicates (but that still will not help as much with other filters' effectiveness, because duplicates are still present )

    A better way is make to it VFR before you filter . This means unique frames - it's the best approach in terms of effectiveness for prefiltering, and afterwards with bitrate reduction of encoding . And if you needed to, you could convert back to CFR and reintroduce clean duplicates afterwards
    Quote Quote  
  15. Well it looks like even if the artifacts are cleaned, there are still moving objects, it's just not blocky anymore.

    I think it's because the colors aren't all 100% the same in the flat areas, and it had a lot of moving artifacts originally. Even if the artifacts/blocks are cleaned, it looks like smeary blobs/patches moving around rapidly instead.

    I guess this source is to blame for it this time. Thanks for all the info and help with with blocky artifacts.
    Quote Quote  



Similar Threads

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