VideoHelp Forum
+ Reply to Thread
Results 1 to 25 of 25
Thread
  1. Hi, I'm trying to remove all the noise from movie and sharpen the footage ( see sample below) using Hybrid or even ffmpeg which ever is best. Can someone tell me what is the best method to do this please.

    https://easyupload.io/t7020w
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    You can clean up some of those small artifacts in Avisynth, but those large areas of film damage on the right
    will take more work
    Image Attached Files
    Quote Quote  
  3. Originally Posted by davexnet View Post
    those large areas of film damage on the right will take more work
    I went ahead and did it in AviSynth.
    Image Attached Files
    Quote Quote  
  4. Originally Posted by davexnet View Post
    You can clean up some of those small artifacts in Avisynth, but those large areas of film damage on the right
    will take more work
    Thanks looks much better
    Quote Quote  
  5. Originally Posted by jagabo View Post
    I went ahead and did it in AviSynth.
    Wow thats very impressive. Thanks for that. Can I ask you to share the script you used on this please.

    Also can the fps be changed from 25 to 24fps and it be upscale to 1080p. I want to see how it would look with your script please if possible.
    Quote Quote  
  6. Here's the script I used with the addition of halo reduction, more noise reduction, and upscaling.

    Code:
    ffVideoSource("Seven Steps Of Kung Fu 1979 SAMPLE.mp4") 
    
    ColorYUV(off_y=-12, gamma_y=25)
    ColorMatrix(mode="rec.601->rec.709")
    BilinearResize(480, height)
    FineDehalo(rx=2.5, ry=1.0)
    RemoveDirtMC(50, false)
    KNLMeansCL(d=1, a=2, h=3)
    SMDegrain(thsad=300, tr=3, PreFilter=4)
    Sharpen(0.3, 0.0)
    MergeChroma(aWarpSharp2(depth=15))
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=696, fheight=height)
    Sharpen(0.3)
    
    ReplaceFramesRIFE(481,1)
    ReplaceFramesRIFE(1028,1)
    ReplaceFramesRIFE(1057,3)
    ReplaceFramesRIFE(1088,1)
    ReplaceFramesRIFE(1178,1)
    ReplaceFramesRIFE(1207,2)
    ReplaceFramesRIFE(1236,3)
    
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1280, fheight=632)
    aWarpSharp2(depth=3)
    Sharpen(0.30)
    
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1920, fheight=948)
    aWarpSharp2(depth=3)
    CAS(0.7)
    You can find ReplaceFramesRIFE() here:
    https://forum.videohelp.com/threads/410553-Jumping-Hesitating-Video?highlight=replacef...fe#post2699556

    I stepped through the video frame by frame to find those with the big blotches and added the ReplaceFramesRIFE() calls. It will be tedious to do with the entire movie.

    In the end, I'm not sure this is really an improvement. And it needs some work on the colors.
    Image Attached Files
    Quote Quote  
  7. Thank you Jagabo. This looked very impressive. Epreciate all your efforts.
    Quote Quote  
  8. Here's the script I used with the addition of halo reduction, more noise reduction, and upscaling.
    I've installed avisynth and when i open your script i get following error:
    Image
    [Attachment 73659 - Click to enlarge]


    I'm new to avisynth. what am i doing wrong would you know
    Quote Quote  
  9. I believe mt_expand_multi is included in Dither Tools:
    http://avisynth.nl/index.php/Dither_tools

    Yes, there are hundreds of third part support filters. It can be hard to find everything you need.
    Quote Quote  
  10. Yes, there are hundreds of third part support filters. It can be hard to find everything you need.
    Thanks Jagabo

    Okay so I've managed to install the plugins required for your script so far. I'm now stuck on ReplaceFramesRIFE, I had a look on this forum for thread covering it but cant figure out what I'm doing wrong once again.

    The errror message is :
    Image
    [Attachment 73662 - Click to enlarge]


    so I copied your code from (https://forum.videohelp.com/threads/410553-Jumping-Hesitating-Video?highlight=replacef...fe#post2699556) and saved as ReplaceFramesRIFE.avs into avisynth plugin folder.

    Not sure this is what i am supposed to do.

    here is the replaceFramesRife script i have saved:
    Image
    [Attachment 73663 - Click to enlarge]
    Quote Quote  
  11. Yes, copy/paste the code from that post and put it in an AVS script. Or paste it into your main script. But your ReplaceFramesRIFE.avs should contain only the two functions, ReplaceFramesRIFE and InsertFramesRIFE. Don't include the code after that.

    ReplaceFramesRIFE.avs
    Code:
    function ReplaceFramesRIFE(clip Source, int N, int "X")
    {
      # N is number of the 1st frame in Source that needs replacing. 
      # X is total number of frames to replace
      # e.g. RX(101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for interpolation
      #
      # requires YV12, YV16, or YV24 input, outputs same as input
    
      X = default(X, 1) # default to replacing 1 frame
    
      Trim(Source, N-1, 1)+Trim(Source, N+X, 1)
      z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f")
      Rife(gpu_thread=1, model=9, factor_num=X+1, factor_den=1, sc=false)
    #  Source.IsYV12 ? z_ConvertFormat(pixel_type="YV12", colorspace_op="rgb:709:709:f=>709:709:709:l") : last
    #  Source.IsYV24 ? z_ConvertFormat(pixel_type="YV24", colorspace_op="rgb:709:709:f=>709:709:709:l") : \
    #                z_ConvertFormat(pixel_type="YV16", colorspace_op="rgb:709:709:f=>709:709:709:l") 
       z_ConvertFormat(pixel_type=Source.pixeltype, colorspace_op="rgb:709:709:f=>709:709:709:l") 
    
      AssumeFPS(Source.FrameRateNumerator, Source.FrameRateDenominator)
      Trim(1,X)
    #Subtitle("RIFE")
    
      Source.trim(0,N-1) ++ last ++ Source.trim(N+X,0)
    }
    
    
    function InsertFramesRIFE(clip Source, int N, int "X")
    {
      # N is number of the 1st frame in Source that needs replacing. 
      # X is total number of frames to replace
      # e.g. RX(101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for interpolation
      #
      # requires YV12, YV16, or YV24 input, outputs same as input
    
      X = default(x, 1)
    
      Trim(Source, N-1, 1)+Trim(Source, N, 1)
      z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f")
      Rife(gpu_thread=1, model=9, factor_num=X+1, factor_den=1, sc=false)
      z_ConvertFormat(pixel_type=Source.pixeltype, colorspace_op="rgb:709:709:f=>709:709:709:l") 
    
      AssumeFPS(Source.FrameRateNumerator, Source.FrameRateDenominator)
      Trim(1,X)
    #Subtitle("RIFE")
    
      Source.trim(0,N-1) ++ last ++ Source.trim(N,0)
    }
    Quote Quote  
  12. Originally Posted by Akuma786 View Post
    Also can the fps be changed from 25 to 24fps
    You can change to 24.0 fps with AssumeFPS(24.0). Or 23.976 fps with AssumeFPS(24000,1001). Those will also increase the running time by about 4 percent as they keep every frame and the frames are unchanged. If you're handling audio within the script add sync_audio=true to those commands.

    I highly recommend against using DirectShowSource() as it's not frame accurate. It should be used a last resort when ffmpegSource and LSMASHSource filters have failed.
    Quote Quote  
  13. Yes, copy/paste the code from that post and put it in an AVS script. Or paste it into your main script. But your ReplaceFramesRIFE.avs should contain only the two functions, ReplaceFramesRIFE and InsertFramesRIFE. Don't include the code after that.

    ReplaceFramesRIFE.avs
    still getting error :

    Image
    [Attachment 73667 - Click to enlarge]


    this is the ReplaceFramesRIFE.avs which i have saved in the plugin64 folder of avisynth+ :
    Image
    [Attachment 73668 - Click to enlarge]


    Sorry to be a pain.
    Quote Quote  
  14. You need to remove the bottom two lines of ReplaceFramesRIFE. Or include the entirety of InsertFramesRIFE. You might need it later anyway.
    Quote Quote  
  15. Originally Posted by jagabo View Post
    You need to remove the bottom two lines of ReplaceFramesRIFE. Or include the entirety of InsertFramesRIFE. You might need it later anyway.
    Thank you Jagabo. I have finally managed to get the script to run on AvsPmod without any errors now!

    so i opened the script on Virtualdub2 64bit and tried to save the file as mp4 and it crashes after a few minutes into rendering it.

    Image
    [Attachment 73675 - Click to enlarge]
    Quote Quote  
  16. Try disabling putting return(last) just before the first call to ReplaceFramesRIFE:

    Code:
    ffVideoSource("Seven Steps Of Kung Fu 1979 SAMPLE.mp4") 
    
    ColorYUV(off_y=-12, gamma_y=25)
    ColorMatrix(mode="rec.601->rec.709")
    BilinearResize(480, height)
    FineDehalo(rx=2.5, ry=1.0)
    RemoveDirtMC(50, false)
    KNLMeansCL(d=1, a=2, h=3)
    SMDegrain(thsad=300, tr=3, PreFilter=4)
    Sharpen(0.3, 0.0)
    MergeChroma(aWarpSharp2(depth=15))
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=696, fheight=height)
    Sharpen(0.3)
    
    return(last)
    
    ReplaceFramesRIFE(481,1)
    ReplaceFramesRIFE(1028,1)
    ReplaceFramesRIFE(1057,3)
    ReplaceFramesRIFE(1088,1)
    ReplaceFramesRIFE(1178,1)
    ReplaceFramesRIFE(1207,2)
    ReplaceFramesRIFE(1236,3)
    
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1280, fheight=632)
    aWarpSharp2(depth=3)
    Sharpen(0.30)
    
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1920, fheight=948)
    aWarpSharp2(depth=3)
    CAS(0.7)
    That will essentially disable everything after the return(last). Can you render the result now? If not, try moving that return(last) earlier in the script and render again. Keep doing so until you find what is causing the problem.

    There are many variations of RemoveDirtMC() so that's another suspicious filter. And I really don't trust DirectShowSource() -- try ffVideoSource instead.
    Quote Quote  
  17. Can you render the result now?
    Worked after deleting removeDirt MC Line from script. But after that when i removed "return(last)" it started crashing again.

    Basically the script wont work with removeDirt MC and these lines (after ReplaceFramesRife):

    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1280, fheight=632)
    aWarpSharp2(depth=3)
    Sharpen(0.30)

    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1920, fheight=948)
    aWarpSharp2(depth=3)
    CAS(0.7)
    Quote Quote  
  18. So if you disable (put a # at the start of the line) or remove the RemoveDirtMC() line it still doesn't work? Make sure you have nnedi3 and aWarpSharp2 installed. And make sure you have any filters those filter rely upon. For example the RemoveDirtMC that I used requires fft3dfilter, mv_tools2, and RemoveGrain. And in turn, those filters may have some other requirements.
    Last edited by jagabo; 10th Sep 2023 at 19:51.
    Quote Quote  
  19. so I have installed all other filters required. Still crashes some times 1/3 into the movie so i managed to do it in 3 segments and then after joining it all together.

    I would like toi know, is there way to not have the RIFE writing in the corner of video ?

    also the audio is out of sync with DirectShowSource and when i change to ffVideoSource, there is no audio playing.
    Last edited by Akuma786; 29th Sep 2023 at 09:39.
    Quote Quote  
  20. Remove the Subtitle() line(s). They were there just so it was easy to see which frames were created by Rife.

    ffVideoSource() only loads the video. If you're not changing the running time of the video there's no need to load the audio; you can simply mux with the original audio. If you need to edit the audio in AviSynth you can use ffAudioSource():

    Code:
    a = ffAudioSource("filename.ext") # get the audio
    v = ffVideoSource("filename.ext") # get the video
    AudioDub(v, a) # join them together for further processing
    Quote Quote  
  21. Thank jagabo. I think i understand, so this is what I've tried now:

    a = ffAudioSource("D:\7 STEPS FILES\Seven Steps Of Kung Fu 1979 576P Dvd-Adc.mp4")
    v = ffVideoSource("D:\7 STEPS FILES\Seven Steps Of Kung Fu 1979 576P Dvd-Adc.mp4")
    AudioDub(v, a)
    AssumeFPS(24.0)
    sync_audio=true

    The audio is now playing on AvsPmod but not in sync.
    Quote Quote  
  22. sync_audio needs to inside the AssumeFPS():

    Code:
    a = ffAudioSource("D:\7 STEPS FILES\Seven Steps Of Kung Fu 1979 576P Dvd-Adc.mp4")
    v = ffVideoSource("D:\7 STEPS FILES\Seven Steps Of Kung Fu 1979 576P Dvd-Adc.mp4")
    AudioDub(v, a)
    AssumeFPS(24.0, sync_audio=true)
    Quote Quote  
  23. sync_audio needs to inside the AssumeFPS():
    Got it, Thank you so much for your assistance.
    Quote Quote  
  24. A little late... just saw your thread.
    I know you're going to find it very bad, but only with a few DaVinci Resolve filters and a little bit of Neat.

    Kung-Fu mod.mp4
    Quote Quote  
  25. Appreciate it Gelinox. I did use DaVinci Resolve for the final colour correction on some scenes.
    Quote Quote  



Similar Threads

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