VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or buy Replay Video Capture or PlayON and record Netflix, HBO, etc! :)
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. Member
    Join Date
    Oct 2007
    Location
    United States
    Search Comp PM
    I'm trying to clean up an old anime I have on dvd. Its from around the '70s. It has a lot of grain and noise and some edge enhancements and what looks like to be some small chroma ghosting.

    It's been awhile since I've touched avisynth so I don't remember what the good denoisers, etc are.

    I do remember that DeHalo_Alpha is good to fight the edge enhancement.

    So, just wondering if anybody could give me a few good denoisers to try out or some filter chains to try in general.

    Thanks
    Quote Quote  
  2. Originally Posted by Akai-Shuichi View Post
    So, just wondering if anybody could give me a few good denoisers to try out or some filter chains to try in general.
    http://avisynth.nl/index.php/External_filters#Denoisers

    For more specific help a sample would be needed.
    Quote Quote  
  3. Member PuzZLeR's Avatar
    Join Date
    Oct 2006
    Location
    Toronto Canada
    Search Comp PM
    Neat Video can be very effective, and works with AviSynth. However, as mentioned, a sample would indeed be helpful.
    I hate VHS. I always did.
    Quote Quote  
  4. Member
    Join Date
    May 2014
    Location
    North Carolina, US
    Search Comp PM
    Originally Posted by Akai-Shuichi View Post
    I'm trying to clean up an old anime I have on dvd.
    DVD? Your sample appears to be re-encoded MPEG4/AVC. Don't you have the original?

    The clip is 23.976 telecined for 29.97 playback.
    AssumeTFF().TFM().TDecimate() doesn't have any ghosting that I can see. I do see some frame jitter. Try Stab().
    Last edited by LMotlow; 25th Feb 2015 at 07:22.
    - My sister Ann's brother
    Quote Quote  
  5. Member
    Join Date
    Oct 2007
    Location
    United States
    Search Comp PM
    Originally Posted by LMotlow View Post
    Originally Posted by Akai-Shuichi View Post
    I'm trying to clean up an old anime I have on dvd.
    DVD? Your sample appears to be re-encoded MPEG4/AVC. Don't you have the original?

    The clip is 23.976 telecined for 29.97 playback.
    AssumeTFF().TFM().TDecimate() doesn't have any ghosting that I can see. I do see some frame jitter. Try Stab().
    Thanks. Anything you could recommend for dealing with the noise?
    Quote Quote  
  6. Member
    Join Date
    May 2014
    Location
    North Carolina, US
    Search Comp PM
    You're not paying attention. Work with the original, not with a re-encode. Suggestions we give you for the low bitrate reencoded sample won't work with the original DVD.
    - My sister Ann's brother
    Quote Quote  
  7. I agree that the original MPG source would be better. But try something like this:
    Code:
    ffVideoSource("clip112.mkv") 
    AssumeTFF()
    TFM() # match fields
    TDecimate() # back to 23.976 fps
    ColorYUV(cont_y=50, off_u=6, off_v=-2, cont_u=50, cont_v=50) # levels, white balance, saturation
    Stab() # remove film bounce
    Crop(6,4,-10,-4) # remove borders
    McTemporalDenoise(settings="high") # easy (but slow) denoise
    Dup() # replace duplicate frames
    Quote Quote  
  8. Member
    Join Date
    May 2014
    Location
    North Carolina, US
    Search Comp PM
    New sample is much better to analyze, Akai-Suitchi. Thank you.


    Originally Posted by jagabo View Post
    I agree that the original MPG source would be better. But try something like this:
    Code:
    ffVideoSource("clip112.mkv") 
    AssumeTFF()
    TFM() # match fields
    TDecimate() # back to 23.976 fps
    ColorYUV(cont_y=50, off_u=6, off_v=-2, cont_u=50, cont_v=50) # levels, white balance, saturation
    Stab() # remove film bounce
    Crop(6,4,-10,-4) # remove borders
    McTemporalDenoise(settings="high") # easy (but slow) denoise
    Dup() # replace duplicate frames
    Hey, jagabo, cool. Dup is a new one for me. Every time you post a script I'm on the 'net form 2 hours learning something new. But don't stop. Dup seems to smooth motion a bit. Thanks.

    Can stop work on the low-bitrate mkv and see what folks do with the mpg. Those compression artifacts were a lot of work! But you'll need something different for the mpg. Anyway, I got this far with it before I gave up (attached).
    Image Attached Files
    Last edited by LMotlow; 25th Feb 2015 at 09:51.
    - My sister Ann's brother
    Quote Quote  
  9. Originally Posted by LMotlow View Post
    Dup is a new one for me. Every time you post a script I'm on the 'net form 2 hours learning something new. But don't stop. Dup seems to smooth motion a bit. Thanks.
    Yes, replacing near duplicate frames (differing only by compression artifacts) with exact duplicate frames makes the video more compressible. One usually needs to set the threshold so that it's high enough to catch all the duplicate frames but not so high as to lose small motions.
    Quote Quote  
  10. Member
    Join Date
    Oct 2007
    Location
    United States
    Search Comp PM
    On the black jacket there is this kind of moving color/shimmer, don't know the name for what that is called (maybe its a type of compression artifact), just wondering if there is anything that can be done there? Also, is there any type of GUI or anything that can be used with ColorYUV such as with sliders for the different options? As it would be great to see the changes in real-time.

    Thanks
    Quote Quote  
  11. Member
    Join Date
    May 2014
    Location
    North Carolina, US
    Search Comp PM
    Black jacket? I see a dark grayish jacket, not black. There is some banding and block noise in the solid color area from compression artifacts. It's worse in your low-bitrate mkv sample, but it's difficult to see in the mkv I posted in #10 made fom your mkv. Jagabo's script fixed most of it, too. There isn't as much of it in the mpg. Your mkv sample was encoded at too low a bitrate, which almost causes banding and similar problems in dense color areas. The same motion compensated denoisers calmed the edge shudder, too. Jagabo used MCTemporalDenoise, I used dfttest.

    AvsPmod is a GUI for Avisynth. A learning curve involved. I don't use it because of it doesn't gel into my workflow well. I did the color work on the mkv in #10 with VirtualDub.
    - My sister Ann's brother
    Quote Quote  
  12. Originally Posted by Akai-Shuichi View Post
    On the black jacket there is this kind of moving color/shimmer, don't know the name for what that is called.
    It's called irregular coloring from hand painted cels. That isn't something you fix, it's something you cherish.
    Quote Quote  
  13. Member
    Join Date
    Oct 2007
    Location
    United States
    Search Comp PM
    Originally Posted by LMotlow View Post
    Black jacket? I see a dark grayish jacket, not black. There is some banding and block noise in the solid color area from compression artifacts. It's worse in your low-bitrate mkv sample, but it's difficult to see in the mkv I posted in #10 made fom your mkv. Jagabo's script fixed most of it, too. There isn't as much of it in the mpg. Your mkv sample was encoded at too low a bitrate, which almost causes banding and similar problems in dense color areas. The same motion compensated denoisers calmed the edge shudder, too. Jagabo used MCTemporalDenoise, I used dfttest.

    AvsPmod is a GUI for Avisynth. A learning curve involved. I don't use it because of it doesn't gel into my workflow well. I did the color work on the mkv in #10 with VirtualDub.
    What exactly were the settings you used on dfttest?
    Quote Quote  
  14. Try this with the MPG file:

    Code:
    Mpeg2Source("VTS_01_1.d2v", CPU2="ooooxx", Info=3) 
    TFM() 
    TDecimate() 
    ColorYUV(cont_y=50, off_u=7, off_v=-2, cont_u=50, cont_v=50)
    Stab()
    Crop(6,4,-10,-4)
    TemporalDegrain()
    TemporalDegrain() is a little faster than MCTD. Note that it reduces temporal noise (film grain, capture noise) but not spacial noise (in the original cells). If you want to remove that too try FFT3DFilter() or dfttest().

    Dup() was causing problems with the background panning in the shot starting at about 1:30 in the new clip. To eliminate that problem required turning the threshold down so low that there was on point in using dup().

    I changed the ColorYUV() parameters a bit based on some large (presumed) black areas in the new sample.

    Starting with the new source gives less of that quantization problem in the dark suit.
    Quote Quote  
  15. Member
    Join Date
    May 2014
    Location
    North Carolina, US
    Search Comp PM
    Yep, jabao, I fiddled with Dup for a while and came to the same conclusion. But another video could give different results.

    Originally Posted by Akai-Shuichi View Post
    What exactly were the settings you used on dfttest?
    Well, all the filters mentioned do similar work but have different results, depending on the video. MCTemporalDenoise, TemporalDegrain, dfttest, FFT3Dfiler...Best to test these using a short clip. They're all slow, because they do a lot of work. I even gave it a quick run with MDegrain2, and got something different again! Clean, but different. Often with denoising you'll have to add some very fine film-like grain with AddGrainC to keep things from looking too filtered.

    I used 16-bit dithering versions from the dither plugin, along with GradFun3. The settings can be tweaked, just as the other filters can:

    Code:
    Dfttest(sigma=5, lsb=true)
    dfttest(lsb_in=true, lsb=true)
    GradFun3(lsb_in=true, lsb=true)
    DitherPost()
    But that was for the low-bitrate mkv. It would be on the strong side for the mpg, which doesn't have as much noise. And pretty slow, too (well, you can't have everything). For the mpg, dfttest in that code would probably be enough. "sigma=5" is a fairly mild setting.
    - My sister Ann's brother
    Quote Quote  
  16. Member
    Join Date
    Oct 2007
    Location
    United States
    Search Comp PM
    Originally Posted by LMotlow View Post
    Yep, jabao, I fiddled with Dup for a while and came to the same conclusion. But another video could give different results.

    Originally Posted by Akai-Shuichi View Post
    What exactly were the settings you used on dfttest?
    Well, all the filters mentioned do similar work but have different results, depending on the video. MCTemporalDenoise, TemporalDegrain, dfttest, FFT3Dfiler...Best to test these using a short clip. They're all slow, because they do a lot of work. I even gave it a quick run with MDegrain2, and got something different again! Clean, but different. Often with denoising you'll have to add some very fine film-like grain with AddGrainC to keep things from looking too filtered.

    I used 16-bit dithering versions from the dither plugin, along with GradFun3. The settings can be tweaked, just as the other filters can:

    Code:
    Dfttest(sigma=5, lsb=true)
    dfttest(lsb_in=true, lsb=true)
    GradFun3(lsb_in=true, lsb=true)
    DitherPost()
    But that was for the low-bitrate mkv. It would be on the strong side for the mpg, which doesn't have as much noise. And pretty slow, too (well, you can't have everything). For the mpg, dfttest in that code would probably be enough. "sigma=5" is a fairly mild setting.
    Thanks for all the help! One last thing what is the difference between lsb_in=true and lsb=true? and by setting both as parameters for GradFun3() essentially feeding the information to them from dfttest? And is there any documentation on what DitherPost() does because or its parameters because I can't find it anywhere
    Quote Quote  
  17. Member
    Join Date
    May 2014
    Location
    North Carolina, US
    Search Comp PM
    Documentation for dither functions and the dither version of dfttest (which is the same as the Avisynth 2.6 Alpha5 version of dfttest), is in the html and dfttest read-me that comes with dither's plugin package. Dfttest and GradFun3 can be used without the 16-bit-business. Stronger dithering is needed for bad compression artifacts. http://forum.doom9.org/showpost.php?p=1386559&postcount=3

    lsb=true means 16-bit data is being output. lsb_in means 16-bit data is being input. Dither_post() makes the proper scaling back to normal 8-bit video. The default value for lsb and lsb-in is false. They're not used for regular filtering. Careful, though. This kind of stuff works often for bad anime, but for real video the 16-bit modes often cause posterizing ("clay-face" effects).

    Truth is, folks don't usually use strong stuff like dithering or TemporalDegrain for most video. But sometimes you need it.
    - My sister Ann's brother
    Quote Quote  
  18. [removed my message -- posted in wrong thread -- sorry!]
    Last edited by johnmeyer; 25th Feb 2015 at 18:15. Reason: posted in wrong thread
    Quote Quote  
  19. Originally Posted by Akai-Shuichi View Post
    Also, is there any type of GUI or anything that can be used with ColorYUV such as with sliders for the different options? As it would be great to see the changes in real-time.
    About the closest you can get to a realtime GUI is avspmod (press F5 to see the result). It lets you adjust parameters with a slider. But it doesn't update the picture until you let go of the slider. I usually just edit the script in notepad and view the result with VirtualDub (F2 reloads the script, keeping the current frame). I also use a program CSamp to read RGB values off the screen.

    I sometimes use the Animate() filter to see changes interactively. I open the script in VirtualDub so it's easy to scroll through the video to see the result.

    Code:
    function animate_cont_y(clip c, int val)
    {
       ColorYUV(c, cont_y=val)  # make the adjustment
       Subtitle(String(val)) # write val onto the clip
    }
    
    Mpeg2Source("VTS_01_1.d2v") 
    
    Trim(2150,2150) # only  frame 2150
    Loop(256,0,0) # repeated 256 times
    
    Animate(0,256, "animate_cont_y", 0, 256) # vary from 0 to 256
    
    ConvertToYUY2() # required for VideoScope
    VideoScope("both", true, "Y", "Y", "UV")
    In that script I'm using VideoScope() to view the Y channel as a waveform graph. Alternately, you can use Histogram(). Histogram puts a vertical graph on the right so I usually use TurnRight().Histogram().TurnLeft() to get a horizontal graph on the top. Histogram() doesn't require YUY2 and it marks the super dark and super bright regions with yellow bars (you don't want your video going into those regions).

    I usually start by adjusting the Y channel to give good darks and brights (levels). In the above clip I decided that ColorYUV(cont_y=50) was about right. Contrast could go a little higher but I thought it started looking a little too contrasty.

    Usually when you increase the contrast you need to increase the color saturation by about the same amount. That's what I did with ColorYUV(cont_u=50, cont_v=50).

    I then looked at white balance in the dark areas. Full black should have U=128 and V=128. Using VideoScope("both", true, "U", "V", "UV") showed that U and V were a little off. I cropped the frame down to a small black area and looked at the U channel:

    Code:
    function animate_off_u(clip c, int val)
    {
       ColorYUV(c, off_u=val)
       Subtitle(String(val))
    }
    
    Mpeg2Source("VTS_01_1.d2v") 
    Trim(2150,2150)
    Loop(256,0,0)
    Crop(700-64,240,-0,64) # a small area of nearly all black (guys hair)
    
    ColorYUV(cont_y=50, cont_u=50, cont_v=50)
    Animate(0,256, "animate_off_u", -128, 128)
    
    ConvertToYUY2()
    VideoScope("both", true, "U", "V", "UV")
    From that I decided that off_u should be 7. I followed that with looking at the V channel and decided that off_v should be -2. After those changes the guys hair was nice and black. After those adjustments the whites weren't too far off so I called it a day. But if you wanted to further adjust the whites you could use different ColorYUV() adjustments for whites then blend the two adjustments together with a alpha mask based on the brightness of the pixels. I used the whites of the eyes in the same frame to adjust whites, then:

    Code:
    darks = ColorYUV(cont_y=50, off_u=7, off_v=-2, cont_u=50, cont_v=50)
    brights = ColorYUV(cont_y=50, off_u=10, off_v=-4, cont_u=50, cont_v=50)
    lmask = ColorYUV(cont_y=100) # mask based on luma, adjust to suit
    Overlay(darks, brights, lmask)
    That should give you some ideas.
    Quote Quote