PDA

View Full Version : Script suggestions for XviD encoding


12gage
10th May 2005, 04:48
Hello, I'm trying to encode a interlaced NTSC TV Series to XviD. Even at a bitrate of 1200 for video it still seems pixlated. I've seen clips on line of encodes at 800 bitrate that look two times better than mine, even when I use denoisers. What am I doing wrong? I figured I should ask the experts to maybe shared their secret recipes. Any help would be appreciated. Here is one of the scripts if that helps. Thanks in advance

# Created with Gordian Knot
#
# http://gknot.doom9.org

# PLUGINS
LoadPlugin("C:\PROGRA~1\GORDIA~1\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\decomb.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\KernelDeInt.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\dgbob.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\TomsMoComp.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\VSFilter.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\SimpleResize.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\Convolution3d.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\FluxSmooth.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\Undot.dll")

# SOURCE
mpeg2source("F:\THE_OC_D6\123.d2v", idct=0)

# TRIM
trim(0,62191)

# IVTC
#Telecide(order=1,guide=1).Decimate()
# or use
#IVTC(44,11,95)
#GreedyHMA(1,0,4,0,0,0,0,0)

# DEINTERLACING (1)
FieldDeinterlace()
#FieldDeinterlace(blend=false)
#TomsMoComp(1,5,1)

# DEINTERLACING (2)
#KernelDeInt(order=1,sharp=true)
# or maybe
#DGBob(order=1,mode=1)

# DEINTERLACING (3) - special requests
#GreedyHMA(1,0,0,0,0,0,0,0)
#Telecide()
#SeparateFields()

# CROPPING
crop(0,0,720,480)

# DENOISING: choose one combination (or none)
# 2) medium noise

# RESIZING
LanczosResize(576,416)

# DENOISING: choose one combination (or none)
# 2) medium noise
Temporalsoften(3,5,5,mode=2,scenechange=10)
Convolution3d("moviehq")
FluxSmoothST(7,7)
Undot()
Undot()

# BORDERS
#AddBorders(left,top,right,bottom)

# COMPRESSIBILITY CHECK
# !!!!Snip Size now has to be 14 for use in GKnot!
#SelectRangeEvery(280,14)

# FOOL CCEnc
#ResampleAudio(44100)

kassandro
10th May 2005, 09:25
Originally posted by 12gage

# DENOISING: choose one combination (or none)
# 2) medium noise
Temporalsoften(3,5,5,mode=2,scenechange=10)
Convolution3d("moviehq")
FluxSmoothST(7,7)
Undot()
Undot()

You are doing a lot of blurring. As I can see no mistakes in your script, I suppose that the default deinterlace threshold of FieldDeinterlace() causes the troubles. You may either lower this threshold or use the threshold free Tomsmocomp. As you care about compression, you may also use my deinterlacer RGDeinterlace (also threshold free) from my RemoveGrain (http://www.RemoveGrain.de.tf) package and remove all the blurrers and denoisers. Your modified script should look as follows:


function RGDeinterlace(clip input)
{
rg = RemoveGrain(input, mode=12)
return TemporalRepair(rg, input, smooth=2)
}

# SOURCE
mpeg2source("F:\THE_OC_D6\123.d2v", idct=0, ipp=true)

# TRIM
trim(0,62191)

# DEINTERLACING (1)
#FieldDeinterlace()
#FieldDeinterlace(blend=false)
#TomsMoComp(1,5,1)

# DEINTERLACING (2)
#KernelDeInt(order=1,sharp=true)
# or maybe
#DGBob(order=1,mode=1)
RGDeinterlace()
RemoveGrain(mode=17)

# CROPPING
crop(0,0,720,480)

# RESIZING
LanczosResize(576,416)

The script should also be substantially faster and image quality should be better at a probably lower bitrate. Please make sure that you have only one (the most recent) version of the RemoveGrain/Repair plugins in your plugin directory and choose the right one for your CPU. For interlaced or telcined material you should always add "ipp=true" to your "mpeg2source" line.

12gage
10th May 2005, 13:31
thanks alot for your reply, i'll give it a try and let you know the results. thanks for your time and effort

Boulder
10th May 2005, 14:02
Isn't The OC actually shot on film, i.e. it's progressive? I watched some episode for a short while and it has a film look to it.

kassandro
10th May 2005, 17:01
Originally posted by Boulder
Isn't The OC actually shot on film, i.e. it's progressive? I watched some episode for a short while and it has a film look to it.
I wonder that Gordian Knot, which is primarily for people without deep knowledge about video technicalities, uses threshold based deinterlacers. If they are applied to progressive content, they really can mess up things and even worsen compression. On the other hand, simple vertical blending would only slightly blur the video and my RGDeinterlace would become a motion adaptive blurrer, if applied to progressive material.

Boulder
10th May 2005, 17:14
FD and TMC shouldn't also cause big destruction as they are not area-based.

I think the biggest problem here is that Force FILM is not used or IVTC is not done and thus the framerate is at 29.97fps.

12gage
13th May 2005, 13:12
I am using force film, it just seems reguardless of using denoisers or only using undot() in my script (i have been playing around with several different options) the results continue to look grainy/pixelated or oversmoothed. Any advise?

Boulder
13th May 2005, 13:18
If you use force FILM, you do not need any deinterlacer.

Post a before-after screenshot and the script you have used, otherwise it's impossible to say anything. Based on your first script, you are filtering the video to death;)

12gage
14th May 2005, 01:55
thanks for the reply boulder. I didn't know that if you force film you didn't need to deinterlace. I switched to this script with alittle better results, i'll try to post some screen shots alittle later.

# PLUGINS
LoadPlugin("C:\PROGRA~1\GORDIA~1\DGMPGDec\DGDecode.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\decomb.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\KernelDeInt.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\dgbob.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\TomsMoComp.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\VSFilter.dll")
#LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\SimpleResize.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\Undot.dll")

# SOURCE
mpeg2source("F:\THE_OC_D6\121.d2v", idct=0)

# TRIM
trim(0,62200)

# CROPPING
crop(0,0,720,480)

# RESIZING
Lanczos4Resize(576,416)

# DENOISING: choose one combination (or none)
Undot()
Undot()
Undot()
DeBlock()