VideoHelp Forum


Try DVD-Fab Video Downloader and rip Netflix video! Or Try DVD-Fab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 25 of 25
Thread
  1. Hi all new to the forum but not entirely new to video.

    Long story short I have a video I am trying to restore. It has numerous issues, including some corrupt frames somewhere, an absurd amount of macro block artifacts, a badly reduced resolution of 320x240 or so, and is in some "real media" format that I have never dealt with before.
    I know this cannot be "restored" in the sense of making it perfect, but improving it to watchable would be good. I went down the rabbit hole looking for ways to get rid of the compression artifacts and found a number of Avisynth approaches, all of which had one issue or another that I ran into. Rather than play wack a mole with plugins that might be deprecated or superseded I thought I would put the question here of what a good up to date approach would be? Any suggestions appreciated!
    Quote Quote  
  2. Originally Posted by johnmeyer View Post
    No video????
    Should I attach a sample or something?
    Quote Quote  
  3. Originally Posted by MediaHoarder View Post
    some "real media" format
    LWlibavAudioSource() + LWlibavVideoSource() + AudioDub()

    Originally Posted by MediaHoarder View Post
    an absurd amount of macro block artifacts
    deblock_qed()

    Originally Posted by MediaHoarder View Post
    a badly reduced resolution of 320x240
    upscale: nnedi3_rpow2() + aWarpSharp2() + Sharpen()

    Originally Posted by MediaHoarder View Post
    corrupt frames
    ReplaceFramesMC().

    Originally Posted by MediaHoarder View Post
    Should I attach a sample or something?
    No, video filtering is best done without looking at the video.
    Quote Quote  
  4. Ok so I tried the above and got Script error:there is no function named "LWlibavAudioSource"
    I have LSMASHSource.dll in my plugins folder so not sure what the issue is.
    I tried uploading a sample of video but it was not a compatible format in any case.
    Quote Quote  
  5. Originally Posted by MediaHoarder View Post
    Ok so I tried the above and got Script error:there is no function named "LWlibavAudioSource"

    I have LSMASHSource.dll in my plugins folder so not sure what the issue is.
    Are you using correct x86 or x64 versions?

    Try this version
    https://github.com/HolyWu/L-SMASH-Works/releases


    I tried uploading a sample of video but it was not a compatible format in any case.
    If you zip it up with 7-zip or similar archiving software you can upload incompatible file types to this site
    Quote Quote  
  6. I have been choosing x64 for everything, I installed Avisynth 2.6 yesterday and I don't remember seeing an option for 64 or 32 bit at that time.

    I tried the version you linked, same error.

    I have attached a 7z with the video file.
    Image Attached Files
    Quote Quote  
  7. I recommend you use AviSynth+ 64 bit, not the older AviSynth 2.6.

    https://www.videohelp.com/software/AviSynth-Plus
    Quote Quote  
  8. Don't think there's enough information in the video to get something useful out of it,...
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  9. Originally Posted by jagabo View Post
    I recommend you use AviSynth+ 64 bit, not the older AviSynth 2.6.

    https://www.videohelp.com/software/AviSynth-Plus
    Ok so I uninstalled the old version and installed the new one. I moved the LSMASHSource.dll to the plugins64 folder under the AviSynth+ folder and I am still getting the error that the command is not found.

    Update: I added the 32 bit version and that worked, I got as far as deblock_qed(). Now windows media player crashes before showing me an error and Virtual Dub just says deblock_qed() does not exist.
    Last edited by MediaHoarder; 17th Feb 2021 at 17:43.
    Quote Quote  
  10. Originally Posted by MediaHoarder View Post
    ] Now windows media player crashes before showing me an error and Virtual Dub just says deblock_qed() does not exist.
    It's not built into AviSynth. Many of the most useful filters (and this is one) are created by third parties and have to be downloaded:

    http://avisynth.nl/index.php/Deblock_QED

    In addition, many third-party filters require other filters to work. The AviSynth page devoted to it will list them. And, because it's an .avsi and not a dll, you don't use LoadPlugin but Import. Stash it in the Plugins folder and, with luck, it'll load automatically when you want to use it. Never a dull moment, eh?
    Quote Quote  
  11. I had Deblock_QED_MT2Mod.avsi, masktools2.dll, DCTFilter.dll, and Deblock.dll already in the plugins folder which are the 3 listed as required dependencies. So I think maybe there is something else wrong here? How would import it manually?
    Quote Quote  
  12. I think that's the same version of deblock_qed() that I have. Try running AVSInfoTool to analyze your AviSynth setup.

    By the way, deblock_qed() doesn't work well with the sample you provided. It smooths the edges of the blocks a little but doesn't smooth the interiors.
    Quote Quote  
  13. Originally Posted by jagabo View Post
    I think that's the same version of deblock_qed() that I have. Try running AVSInfoTool to analyze your AviSynth setup.

    By the way, deblock_qed() doesn't work well with the sample you provided. It smooths the edges of the blocks a little but doesn't smooth the interiors.
    Ok I ran the info tool. I am not entirely sure what I am supposed to look for here so I am attaching it. But it does have Deblock_QED under the scripts for 32 bit.
    I guess its good to know that it does not work, I came across some other ideas when I was looking earlier that I might be able to try since I have gotten a bit further with Avisynth. I don't expect a miracle either though, its in rough shape.
    Image Attached Files
    Quote Quote  
  14. Note that everything needs to be 32 bit, or everything needs to be 64 bit (aside from the O/S). So to use 32 bit AviSynth you need to use a 32 bit editor, player, or encoder. And all the filters must be 32 bit and in the correct plugins folder.
    Quote Quote  
  15. I have managed to get most of the plugins working by using 32 bit plugins in the 32 bit folder.
    However all of the de-blocking plugins I have tried give an error on the colorspace input. I tried converting the color space input with ConvertToYV12() but it returned the error "can only convert from planar yuv"
    Quote Quote  
  16. Try a simple script like

    Code:
    LWlibavVideoSource("test.rm")
    Info()
    What does it say about the colorspace?
    Quote Quote  
  17. Hmm it says Colorspace: YV12, BitsPerComponent: 8
    Deblock by itself gives me "only planer input supported"
    Quote Quote  
  18. Do you have anything between the source filter and deblock_qed?
    Quote Quote  
  19. No I have tried the following.

    Code:
    LWlibavAudioSource("G:\Personal Files\Downloads\Backup\Testing\test.rm")
    Deblock(quant=25, aOffset=0, bOffset=0, planes="yuv")
    And also tried

    Code:
    video = LWlibavAudioSource("G:\Personal Files\Downloads\Backup\Testing\test.rm")
    audio = LWlibavVideoSource("G:\Personal Files\Downloads\Backup\Testing\test.rm")
    AudioDub(video,audio)
    deblock_qed(quant1=24, quant2=26, aOff1=1, aOff2=1, bOff1=2, bOff2=2, uv=3)
    Quote Quote  
  20. Try:

    Code:
    LWLibavVideoSource("test.rm", cache=false, fpsnum=15, fpsden=1, format="YUV420P8") 
    deblock_qed()
    YUV420P8 is the same YV12 but maybe specifying it will help. You're going to need the fps parameters to force constant frame rate -- as RM is inherently variable frame rate.

    Regarding the "only planer input supported" error: does it specify a script name and line number? It may be one of the support functions giving the error not the main call to deblock_qed().
    Quote Quote  
  21. It never did give a line number for the error, it did on some others I had though and I was able to fix those before I hit this.
    I tried

    Code:
    LWlibavVideoSource("test.rm", cache=false, fpsnum=15, fpsden=1, format="YUV420P8") 
    deblock_qed()
    That did not give an error in Windows Media Player, it just crashed, while Virtual Dub claims there is no function deblock_qed.

    This however did work, with deblock, which it did not before, so that is still some progress.

    Code:
    LWlibavVideoSource("test.rm", cache=false, fpsnum=15, fpsden=1, format="YUV420P8") 
    Deblock(quant=25, aOffset=0, bOffset=0, planes="yuv")()

    I also think I just discovered one stupid mistake of having LWlibavAudioSource where I should have had video, but that still does not explain the deblock_qed issue
    Quote Quote  
  22. So after some more tinkering I came up with a Deblock based script that, at least to my eye, seems to be a slight improvement. I don't really have any audio in Windows Media Player when previewing this, and Virtual Dub claims Deblock is non existent, but other than that it seems to be on the right track.
    Here is the script.

    Code:
    video = LWlibavVideoSource("G:\Personal Files\Downloads\Backup\Testing\test.rm")
    audio = LWlibavAudioSource ("G:\Personal Files\Downloads\Backup\Testing\test.rm")
    AudioDub (video, audio)
    ConvertToYV12()
    Deblock(quant=50, aOffset=1, bOffset=1, planes="yuv")
    nnedi3_rpow2(rfactor=2, nsize=0, nns=3, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=15)
    aWarpSharp2(thresh=128, blur=2, type=0, depth=16, chroma=4)
    Sharpen(.5)

    Is there an easy way to render this so I can view a copy of what it would actually look like?
    Quote Quote  
  23. That looks fairly good, considering the source.

    You can use any encoder you like that supports AVS scripts as input. VirtualDub2, x264cli, ffmpeg.

    Put this in a batch file:
    Code:
    Start /b /low "ffmpeg" "G:\program files\ffmpeg64\bin\ffmpeg.exe" -y -benchmark -v verbose ^
        -i %1 ^
        -c:v libx264 -preset slow -crf 18 -g 50 -movflags faststart -g 50 -colorspace smpte170m -color_range tv ^
        -c:a ac3 ^
        "%~dpn1.avc.mkv"
    pause
    Change the path to ffmpeg.exe to where you have the 32 bit version installed. Then you can drag/drop an AVS script onto it. A new video will be created in the same folder as the AVS script.

    for x264 (video only, audio will be ignored):
    Code:
    start /b /low "x264" "g:\program files\x264\x264-32bit.exe" --preset=slow --crf=18 --keyint=48 --sar=1:1 --colormatrix=smpte170m --stitchable --output "%~1.mkv" "%~1"
    Last edited by jagabo; 18th Feb 2021 at 07:21.
    Quote Quote  
  24. So after some more tinkering I decided to try encoding a sample video to see the results. On the whole I am quite happy with the quality, it is much more watchable than it was. The code I used in the most recent version was as follows

    Code:
    video = LWlibavVideoSource("G:\Personal Files\Downloads\Backup\Testing\test.rm")
    audio = LWlibavAudioSource ("G:\Personal Files\Downloads\Backup\Testing\test.rm")
    AudioDub (video, audio)
    ConvertToYV12()
    Deblock(quant=60, aOffset=1, bOffset=1, planes="yuv")
    dfttest()
    SmoothD2(quant=30, num_shift=3, Matrix=9, Qtype=1, ZW=1, ZWce=1, ZWlmDark=0, ZWlmBright=255, ncpu=1)
    nnedi3_rpow2(rfactor=2, nsize=0, nns=3, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=15)
    aWarpSharp2(thresh=128, blur=2, type=0, depth=16, chroma=4)
    Sharpen(-.8)
    AddGrainC(var=2.0, uvar=2.0, hcorr=0.0, vcorr=0.0, seed=-1, constant=false, sse2=true)
    However, I am having one major issue which I suspect is related to the corrupt frames. In the rendered version, the audio is off, with the video running ahead of the audio. Not sure how to deal with this issue, I looked into ReplaceFramesMC() but if I understand correctly I need to know which frames are bad to replace them which I have no info on. Is there an option to interpolate corrupt frames from adjacent frames?
    Quote Quote  



Similar Threads