Log in

View Full Version : Need help with poor lookin video after encoding


scrtagt69
25th August 2004, 19:39
Hello all,
ive been with this same video for a few days now, and get the quality to come out right. im using avisynth to frameserve into tmpgenc. I have encoded other videos using this method and they look fine, but this one is coming out crappy. I have a dvd source in which i need to ivtc and in tmpgenc im encoding it to svcd.
here is my current script im using.

MPEG2Source("D:\Documents and Settings\Administrator\Desktop\rips\lunatics.d2v",iPP=true)
TweakColor(sat=.70,startHue=80,endHue=140,maxSat=80,minSat=75)
TweakColor(sat=0,startHue=140,endHue=200,maxSat=75,minSat=50)
DeDot(30,30,10,5)
DeGrainMedian(limitY=5,limitUV=10,mode=0)
KernelDeint(1,sharp=true)
blendbob(forceMatch=0,badframes=0,derainbow=1)
Decimate(mode=1,threshold=1.0)

Im going to enclose 2 clips. the m2v one is the encoded one, and you can see the poor quality of the colors and jagged lines, and im enclosing the original vob source, small clips of course. Any input as to what i can use to improve this would be appreciated. thank you.

M2V clipM2V Clip (http://juanordonez.com/videos/lunaticclipm2v.rar)

VOB Clip (http://juanordonez.com/videos/lunaticclipvob.rar)

Leak
25th August 2004, 22:19
Originally posted by scrtagt69
KernelDeint(1,sharp=true)
blendbob(forceMatch=0,badframes=0,derainbow=1)
Decimate(mode=1,threshold=1.0)


I've only downloaded and watched your result clip yet (ISDN on my end), but are you sure you want to use KernelDeint here? BlendBob needs bobbed input, and that's what KernelBob (now included in KernelDeint 1.5.0 (http://forum.doom9.org/showthread.php?s=&threadid=81322)) produces...

If you use the script as-is on 60 fields per second material, it'll discard half of the fields in moving areas AND blends the resulting 30 frames per second video down to 15 FPS, which TMPGEnc probably converted back to 30 FPS by duplicating frames, thus the jerky movement...

np: Funkstoerung - Sleeping Beauty (ft. Lou Rhodes) (Disconnected)

scrtagt69
25th August 2004, 23:26
thanks leak ill give it a try.

Leak
26th August 2004, 00:14
Originally posted by scrtagt69
thanks leak ill give it a try.

Well, I've given your VOB sample a try, and replacing KernelDeint with KernelBob fixed the jerkiness as expected.

Still, your TweakColor statements totally destroy the texture of the wooden wall in the van - I guess there's some calculation in there that wraps around instead of saturating...

Also, the blockiness of the red logo on the van in the beginning is because it's like that in the source; maybe they applied a (bad) digital zoom when editing?

Here's what works for me:

MPEG2Source("test.d2v",ipp=true,cpu=6,idct=7)

#TweakColor(sat=.70,startHue=80,endHue=140,maxSat=80,minSat=75)
#TweakColor(sat=0,startHue=140,endHue=200,maxSat=75,minSat=50)

DeDot(30,30,10,5)
DeGrainMedian(limitY=5,limitUV=10,mode=0)

KernelBob(order=1,linked=false,sharp=true,threshold=10)
BlendBob(derainbow=1)
Decimate(mode=1,threshold=1.0)

np: Pole - Umbrella (Pole)

Boulder
26th August 2004, 09:17
I think that the DeDot and DeGrainMedian lines should be moved after the KernelBob line;)

Leak
26th August 2004, 10:11
Originally posted by Boulder
I think that the DeDot and DeGrainMedian lines should be moved after the KernelBob line;)

Well, I tried both and there wasn't much difference, so I kept them that way... :)

np: Ricardo Villalobos - Bahaha Hahi (Alcachofa)

Boulder
26th August 2004, 10:19
If they are placed before bobbing, you're using them on interlaced material. This is a big no-no unless the filter understands how to process interlaced material. There are very few filters that do, and I'd say it's always a good precaution to bob then filter.

scrtagt69
26th August 2004, 17:03
thanks for the reply leak, however i get an error saying kernelbob doesnt have an arguement named order. i copied this function from one of your other posts..did you update it or change it?

Function KernelBob(clip c, int "topFieldFirst", int "kernelDeintThreshold", bool "sharp")
{
Assert(Defined(topFieldFirst),"topFieldFirst must be specified!")
kernelDeintThreshold=Default(kernelDeintThreshold,3)
sharp=Default(sharp,false)

a=((topFieldFirst == 1) ? c.AssumeTFF() : c.AssumeBFF())
b=separatefields(a).trim(1,0).weave()

a=a.kerneldeint(order=topFieldFirst, \
sharp=false, \
threshold=kernelDeintThreshold)

b=b.kerneldeint(order=(1-topFieldFirst), \
sharp=false, \
threshold=kernelDeintThreshold)

return interleave(a,b)
}

Boulder
26th August 2004, 17:12
If you use Leak's MMX optimized KernelDeint v1.50, you don't need to put the function in the script as the plugin itself now includes KernelBob().

scrtagt69
26th August 2004, 17:17
thanks boulder, im encoding it now in tmpgenc. i will let you guys know how the results turn out. thanks to you and leak for helping.

scrtagt69
27th August 2004, 15:20
I tried it both ways, dedot and degrain after and before kernel bob, and the best results were putting it before. if i left it after, i was left with many dot crawls through out the entire clip. this was the result i was looking for. again thanks to boulder and leak.

scharfis_brain
27th August 2004, 17:11
If someone is interested in another stupid approach reducing chroma artifacts, so here it is:


function improveIVTC(clip i, float th)
{separatefields(i)

e=selecteven()
e1=e.dup(chroma=false,show=false,blend=true,maxcopies=2,threshold=th)

o=selectodd()
o1=o.dup(chroma=false,show=false,blend=true,maxcopies=2,threshold=th)

interleave(e1,o1)
weave()
telecide(order=1,post=0).decimate(5)
mergechroma(last.blur(0,1.58))
}

all you need is decomb.dll & dup.dll

the approach works this way:

in a telecined stream, we have a duped field each four fields.

this means, we can blend the duped fields together to lower the chroma & luma noise without affecting the image quality.

after doing so, we can apply an decimation to 24 fps.
this means, in ever other frame one field is noise reduced by the process applied before the decimation.

and finally after the decimation, we can use a chroma-only vertical blur, which reduces the chroma-artifacts a second time.

and the best thing is: on no motion-scenes this function will remove (and not only reduce) all dotcrawl and chroma-rainbows!