View Full Version : Need help getting good quality out of this clip.
theinv
10th March 2007, 07:33
Hello everyone,
I am a total newbie when it comes to avisynth. Can anyone help me get the best quality out of this clip? I want it to be as clean, as sharp and as contrasty as possible.
Here is the original mpg file:
http://ldbs.heraldsq.com/mtv02_orig.mpg (49MB MPG, 16Mbps)
I tried the script below today, but it didn't give me satisfying results (quality is good, but I want better) because it looked no much different from a simple deinterlaced.
DGDecode_mpeg2source("H:\tvs\ready\avisynth_test\mtv02_orig.d2v")
LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\degrainmedian.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\VagueDenoiser.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\warpsharp.dll")
Import("D:\Program Files\AviSynth 2.5\functions\LimitedSharpen.avs")
# VARIABLES
widthResized = 640
heightResized = 480
superSampling = 4
pixieDustLimit = 2
LeakKernelDeint(order=1,sharp=true)
Undot()
Lanczos4Resize(widthResized,heightResized)
a = last
b=a.degrainmedian(mode=4).VagueDenoiser(threshold=0.8, method=1, nsteps=6, chromaT=0)
LimitedSharpen(ss_x=1.5,ss_y=1.5,Smode=1,strength=400,Lmode=1,overshoot=1,wide=false,soft=false,radius=1,edgemode=0)
Note that I am not looking for suggestions on how to enhance this script because I want to learn from your experience. You can use any filter you like, but please post your script and show before/after screenshot if possible. Your script will be of tremendous help for starters like me.
Thanks!
Pookie
10th March 2007, 09:47
Well, for one thing, you've replaced SeeSaw with Limitedsharpen, but you haven't removed the A=last and B=degrainmedian.....
But even worse, the source has combing artifacts that will take a lot of work to fix, maybe it isn't even fixable.
theinv
10th March 2007, 09:56
Hi Pookie,
Are you saying that these two lines is only for SeeSaw()?
a = last
b=a.degrainmedian(mode=4).VagueDenoiser(threshold=0.8, method=1, nsteps=6, chromaT=0)
Actually, I copied them from your seesaw() post. My original intention was to use the seesaw() filter, but I got some "unknown system exception", so I switched to LimitedSharpen(). I forgot to take out these two lines because I didn't know how these filters work together.
I will remove them and try it again. But it would be nice if someone can provide script examples specific to this video source.
I like the seesaw() result you posted in the other thread. Can you do a seesaw on this video for me? I just want to see how it will look. :-)
Pookie
10th March 2007, 10:09
I'd be happy to, but you've got to take care of the combing artifacts first. Someone with more experience than me in this area should have a look.
http://img228.imageshack.us/img228/9017/examplert9.th.png (http://img228.imageshack.us/my.php?image=examplert9.png)
http://img149.imageshack.us/img149/6073/example2ym9.th.png (http://img149.imageshack.us/my.php?image=example2ym9.png)
theinv
10th March 2007, 10:25
Thanks Pookie!
I am new to these technical terms. Can you tell me what is combing artifact and how do I know a video has combing artifact?
The video was recorded as interlaced, I-Frame only, without any filter. My video capture card is ATI AIW9600, it does come with some built-in filter but I didn't use it because I thought it may degrade video quality.
Is it possible that the artifact in the clip is the interlaced artifact (not the combing)? Also, shouldn't the LeakKernelDeint deinterlacer take care of the artifact? I read somewhere that the LeakKernelDeint is an artifact free deinterlacer.
sillKotscha
10th March 2007, 10:32
Thanks Pookie!
I am new to these technical terms. Can you tell me what is combing artifact and how do I know a video has combing artifact?
that's why he posted two pictures to show you the effect of the combing artifacts ;)
theinv
10th March 2007, 10:33
that's why he posted two pictures to show you the effect of the combing artifacts ;)
Thanks! I saw the pictures.
Pookie
10th March 2007, 10:42
I think you can use Cdeblend and Mrestore to reduce the problem. It is probably originally PAL material that was badly transfered to NTSC. I'll post the results of running the above functions on the clip as soon as it is done.
EDIT- Well, it looks a lot better, still some flicker on the subtitles, but much improved overall
Xvid, 5MB
http://www.bestsharing.com/files/kGPogcW239954/cdeblend_Mrestore.avi.html
theinv
10th March 2007, 10:43
I'd be happy to, but you've got to take care of the combing artifacts first. Someone with more experience than me in this area should have a look.
Pookie, can you tell me which program you use to get the screenshots?
For some reason, when I capture screenshot using the KMPlayer's built-in capture feature during playback, I see very little artifact (and it only appears around the logo edges) in my screenshot. That's probably why I never noticed any artifact problem with my video.
sillKotscha
10th March 2007, 10:45
you can load your clip into virtualdub_mod and extract just one single frame as a picture...
Pookie
10th March 2007, 10:51
That's exactly how I did it :D VirtualDubMod
In case you didn't see it, check out the vid clip posted a few posts above.
You'll probably want to play around with those functions. Here's the thread that explains them in detail.
http://forum.doom9.org/showthread.php?p=673243#post673243
What I ran on your source was
Load("MT_Masktools.dll")
Load("Tdeint.dll")
Load("DgDecode.dll")
Import("Mrestore.avs")
Import("Cdeblend.avs")
MPEG2Source("mtv02_orig.d2v")
tdeint(mode=1)
cdeblend()
Mrestore()
sillKotscha
10th March 2007, 10:59
nice result but I'd crop away a lot!!
EDIT:
crop values changed...
crop(18,64,684,352)
some_resizer(608,352)
theinv
10th March 2007, 11:02
Pookie, the clip does look better. Is the "Cdeblend and Mrestore" the only filter you used?
theinv
10th March 2007, 11:04
nice result but I'd crop away a lot!!
crop(14,64,692,340)
sillKotscha,
why crop left and right? Will you lose some part of the picture?
Usually, I only crop away the black bars from top and bottom.
Pookie
10th March 2007, 11:09
Yeah, it's just a rough example. Definitely needs more cropping. See above post for script.
sillKotscha
10th March 2007, 11:10
you have black bars on the left and right as well ... no video information - safe to crop ;)
EDIT: see above - updated crop values combined with pookie's script!!
Load("MT_Masktools.dll")
Load("Tdeint.dll")
Load("DgDecode.dll")
Import("Mrestore.avs")
Import("Cdeblend.avs")
MPEG2Source("mtv02_orig.d2v")
tdeint(mode=1)
cdeblend()
Mrestore()
crop(18,64,684,352)
LanczosResize(608,352)
Pookie
10th March 2007, 11:22
Nice one, sillKotscha. Looks very good that way. Cleaner...
Looks like Mrestore brought the clip back to 25fps. Wow, that is a powerful function. Wish I understood it more.
Very rare to see that type of blended material, unless it is posted here....
Didée
10th March 2007, 15:37
Very rare to see that type of blended material, unless it is posted here....
Well, so far *each and every* eastern movie I have seen was fieldblended crappola. (There are a few clean ones, but I've not come across them.)
... and if you live in PAL land, then e.g. on the music channels, about 75% of all footage is fieldblended. :)
***
To sum up the facts about this source here: the footage originally was recorded at 24fps, then has been converted to PAL 25p by speedup, then has been "telecined" to NTSC 30i by fieldblending.
Possible solutions in alphabetical order are:
1) CDeblend + MRestore
2) RePal
3) Restore24
Basic scripts for each tool:
# CDeblend + MRestore
XYZSource(...)
crop(...)
YourBobberOfChoice()
CDeblend()
Mrestore()
# RePal
XYZSource(...)
crop(...)
YourBobberOfChoice()
RePal()
# Restore24 (with fast bobbing)
XYZSource(...)
crop(...)
Restore24(numr=1250,deno=2997,useLL=true,r24deint=1,nr=-3)
The results on this sample are:
MRestore: http://www.mytempdir.com/1249136
RePal: http://www.mytempdir.com/1249149
Restore24: http://www.mytempdir.com/1249170
Look & compare carefully:
- is motion fully fluid or slightly stuttering,
- flickering of subtitles,
- etc. pp.
then choose your poison.
Terranigma
10th March 2007, 15:48
Anyone got the scripts and needed filters for these scripts Didée mentioned? All the ones I came across were borked, at least for me.
:p
Didée, I downloaded your 3 samples and compared. Here's my observation from best to worst quality.
1. Restore24: Motion slightly stutters when the girl in the red kimono's gliding through the air, no flickering.
2. Repal: Doesn't stutter, but subtitles tends to flicker every now and then.
3. Mrestore: Stutter and flickers a lot.
So i'd rather stick with restore24 over the current available options.
Didée
10th March 2007, 16:05
For CDeblend/Mrestore you need MOMonster's R_pack (http://forum.doom9.org/showthread.php?t=95924), and MaskTools v2.
Restore24 has a few dependencies more ;) (because it's offering a bunch of choices on how to do the job), but there's this package (http://forum.doom9.org/showthread.php?p=774197#post774197) that bkman once had put up.
RePal you can get - big surprise - from warpenterprises (http://avisynth.org/warpenterprises/#repal). ;)
Edit:
2. Repal: Doesn't stutter, but subtitles tends to flicker every now and then.
Psssst ...
tdeint(mode=1,mthreshL=0,mthreshC=0)
td = last
reduceflicker(strength=1)
maxx = td.mt_expand()
maxx = maxx.mt_logic(maxx.trim(1,0),"max")
minn = td.mt_inpand()
minn = minn.mt_logic(minn.trim(1,0),"min")
mt_lutxy(mt_convolution("1","1 2 1",U=2,V=2),"x x y - 1.49 * +",U=2,V=2)
mt_clamp(maxx,minn,0,0,U=2,V=2)
repal()
Note that the trick in blue is *only* valid when dealing with *fieldblended* input! Never use that on anything else!
Terranigma
10th March 2007, 16:11
Thanks Didée :)
Chainmax
10th March 2007, 16:58
...
I am new to these technical terms. Can you tell me what is combing artifact and how do I know a video has combing artifact?
...
I suggest you to read Decomb's (http://www.neuron2.net/decomb/decombnew.html) readmes and tutorials, the IVTC tutorial (http://www.doom9.org/ivtc-tut.htm) and the capture guide (http://forum.doom9.org/showthread.php?t=78797) as they have a lot of information on determining what kind of video you're dealing with. For deinterlacing, I recommend you to use TDeint, and for IVTCing I recommend you to use TIVTC. There are more complicated methods, but they are mostly for weird scenarios. Hope this helps :).
theinv
23rd March 2007, 03:54
hello everyone,
I am back! Thanks for all the helps!
I am using MeGUI and couldn't get Restore24 to work, but I've tried the "Cdelband/MRestore" and "Repal()". They both work fine. I tested it on a different clip and the result is better (less flickering, maybe it is because it has subtitles on black background)
I have a couple more questions:
1. For the "CDeblend/MRestore" combination, is it okay to replace CDeblend() with something else like unblend() or blendbob()? Which one will work better?
2. Will FixBlendIVTC() work for my source? I tried it as follows
FixBlendIVTC(post=3)
LeakKernelDeint(order=1,sharp=true)
Lanczos4Resize(widthResized,heightResized)
but the output frame rate is the same as original, 29.97 FPS.
Since the functions MRestore(), Repal() and Restore24() all try to restore the frame rate back to PAL standard. So I assume that FixBlendIVTC() is probably not suited for my source. What is the proper way to use FixBlendIVTC()? Maybe I should do cdeblend/Mrestore before FixBlendIVTC()?
3. One thing I don't understand is that why many of you chose to restore() or repal() the clip when you can convert the clip directly to xvid/mp4. The reason I ask this is because the repal() and restore() functions introduce flickering. If I convert the mpeg to xvid/mp4 directly, the quality is pretty good too (no flickering at all and looks better than the restored version).
Thanks!
theinv
23rd March 2007, 03:56
I suggest you to read Decomb's (http://www.neuron2.net/decomb/decombnew.html) readmes and tutorials, the IVTC tutorial (http://www.doom9.org/ivtc-tut.htm) and the capture guide (http://forum.doom9.org/showthread.php?t=78797) as they have a lot of information on determining what kind of video you're dealing with. For deinterlacing, I recommend you to use TDeint, and for IVTCing I recommend you to use TIVTC. There are more complicated methods, but they are mostly for weird scenarios. Hope this helps :).
Thanks! I will read that up...
MOmonster
23rd March 2007, 10:40
Please don´t combinate Cdeblend and Mrestore, use Mretsore or Cdeblend + your fauvorite decimater. For NTSC back to Pal restoring the current Mrestore version is not the best choice, because the too short pattern. Next release will work different and much better for such cases. Restore24 has many nice option Mrestore will never have, for example code to improve the output quality of the deinterlaced frames. Of course you can add this function also to the Mrestore in- or output (same for repal). Repal and Mrestore don´t filter the frames of the bobbed input, just choose what frames to output.
Edit: FixblendIVTC is created for progressive blended sources and has less in common with the other restorers here. If you bob your footage and nearly every second field is blended, than restore24, repal or Mrestore can be a solution. For stronger blended sources Cdeblend can maybe be an option. For non blended sources don´t use one of these function here.
Didée
23rd March 2007, 23:07
3. [...] The reason I ask this is because the repal() and restore() functions introduce flickering.
What kind of flickering? Line flicker from the deinterlacer? Then you need a deinterlacer that doesn't do that ...
One thing I don't understand is that why many of you chose to restore() or repal() the clip when you can convert the clip directly to xvid/mp4.
Sure you can ...
But you might want to give a shot at
THIS SAMPLE (http://forum.gleitz.info/showthread.php?p=324960#post324960)
to get proof that the statement
If I convert the mpeg to xvid/mp4 directly, the quality is pretty good too (no flickering at all and looks better than the restored version).
is off.
This kind of stuff was the reason why Restore24 was invented.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.