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!
+ Reply to Thread
Results 1 to 25 of 25
-
-
LWlibavAudioSource() + LWlibavVideoSource() + AudioDub()
deblock_qed()
upscale: nnedi3_rpow2() + aWarpSharp2() + Sharpen()
ReplaceFramesMC().
No, video filtering is best done without looking at the video. -
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. -
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. -
I recommend you use AviSynth+ 64 bit, not the older AviSynth 2.6.
https://www.videohelp.com/software/AviSynth-Plus -
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, marcorocchini -
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.
-
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? -
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?
-
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. -
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" -
Try a simple script like
Code:LWlibavVideoSource("test.rm") Info()
-
Hmm it says Colorspace: YV12, BitsPerComponent: 8
Deblock by itself gives me "only planer input supported" -
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")
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)
-
Try:
Code:LWLibavVideoSource("test.rm", cache=false, fpsnum=15, fpsden=1, format="YUV420P8") deblock_qed()
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(). -
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()
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 -
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? -
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
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.
-
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)
Similar Threads
-
Badly deinterlaced video
By themaster1 in forum RestorationReplies: 5Last Post: 9th May 2020, 14:19 -
Avisynth anime restoring
By BeyondTheEnergy in forum RestorationReplies: 11Last Post: 13th Aug 2018, 11:55 -
Need help with AVISynth script - source badly converted from NTSC?
By duffbeer in forum DVD RippingReplies: 3Last Post: 29th Dec 2017, 02:56 -
Trying to improve badly exposed footage with Avisynth (AutoLevels? HDRAGC?)
By abolibibelot in forum Video ConversionReplies: 16Last Post: 1st Sep 2016, 20:09 -
Badly deinterlaced video(?)
By Colek in forum EditingReplies: 3Last Post: 24th Jul 2016, 11:38