Log in

View Full Version : encoding interlaced


pyrates
8th November 2006, 21:36
I want to encode into an interlaced format using avisynth still. The source is 1080i and I want to preserve that interlaced format. Is there any special commands I need to put into the avs file? I'm using dgmpegdec to create the d2v file and keeping it interlaced their. I'm aware of fields and frames and know whether to specify top field or bottom field depending on the source. I just don't want to go through the process of deinterlacing it, then interlacing it again in the avisynth script.

Here is my avisynth script:

SetMTMode(2,0)
LoadPlugin("C:\Apps\tomsmocomp\Avisynth_2.5\TomsMoComp.dll")
LoadPlugin("C:\Apps\decomb\decomb521.dll")
#LoadPlugin("C:\Apps\MKVMagic\exe\filter\decomb.dll")
Loadplugin("C:\Apps\MKVMagic\exe\Filter\undot.dll")
Loadplugin("C:\Apps\MKVMagic\exe\Filter\Convolution3D.dll")
#Loadplugin("C:\Apps\Deen\Deen.dll")
Loadplugin("C:\Apps\MKVMagic\exe\Filter\Deen.dll")
loadplugin("C:\Apps\MaskTools\MaskTools.dll")
#LoadPlugin("C:\Apps\MKVMagic\exe\filter\MaskTools.dll")
loadplugin("C:\Apps\MVTools\mvtools.dll")
#LoadPlugin("C:\Apps\MKVMagic\exe\filter\Mvtools.dll")
Import("C:\Apps\MKVMagic\exe\Filter\HybridFuPP.avsi")
Import("C:\Apps\MvBob\mvbob.avs")
#Import("C:\Apps\MKVMagic\exe\Filter\mvbob.avs")

# Modify the path so that it finds your DGMPGDec dll file #
LoadPlugin("C:\Apps\DGMPGDec\DGDecode.dll")

# Modify the path so that it finds the d2v file you created using DGMPGDec #
MPEG2Source("E:\test\movie.d2v")
# Take off the bottom 8 pixels
crop(0,0,-0,-0)
#Crop(left, top, -right, -bottom)
# top field
#AssumeTFF().SeparateFields()
#Telecide(order=1)
# bottom field
#AssumeBFF().SeparateFields()
#Telecide(order=0)
# uncomment when figured out whether it's top field or bottom field
#Decimate()
UnDot()
Convolution3d(preset="movieHQ")
# AddBorders(clip clip, int left, int top, int right, int bottom [, int color])
AddBorders(0, 0, 0, 0)
HybridFuPP()
assumefps(30000,1001)

IanB
9th November 2006, 01:49
Only thing is be aware of the temporal displacement of each field and how it effect the filters you are using. Two simple solutions are :-

1. For filters with no temporal dependancy....
SeparateFields()
.... # Whatever needs doing
Weave()2. For filters with temporal dependancy...
SeparateFields()
E=SelectEven().FilterPath()
O=SelectOdd().FilterPath()
Interleave(E, O)
Weave()
...
Function FilterPath(Clip clip) {
clip
.... # Whatever needs doing
return Last
}And of course for filter that are interlaced aware there is no problem.

pyrates
9th November 2006, 03:45
So I would do this then?

SetMTMode(2,0)
LoadPlugin("C:\Apps\tomsmocomp\Avisynth_2.5\TomsMoComp.dll")
LoadPlugin("C:\Apps\decomb\decomb521.dll")
#LoadPlugin("C:\Apps\MKVMagic\exe\filter\decomb.dll")
Loadplugin("C:\Apps\MKVMagic\exe\Filter\undot.dll")
Loadplugin("C:\Apps\MKVMagic\exe\Filter\Convolution3D.dll")
#Loadplugin("C:\Apps\Deen\Deen.dll")
Loadplugin("C:\Apps\MKVMagic\exe\Filter\Deen.dll")
loadplugin("C:\Apps\MaskTools\MaskTools.dll")
#LoadPlugin("C:\Apps\MKVMagic\exe\filter\MaskTools.dll")
loadplugin("C:\Apps\MVTools\mvtools.dll")
#LoadPlugin("C:\Apps\MKVMagic\exe\filter\Mvtools.dll")
Import("C:\Apps\MKVMagic\exe\Filter\HybridFuPP.avsi")
Import("C:\Apps\MvBob\mvbob.avs")
#Import("C:\Apps\MKVMagic\exe\Filter\mvbob.avs")

# Modify the path so that it finds your DGMPGDec dll file #
LoadPlugin("C:\Apps\DGMPGDec\DGDecode.dll")

# Modify the path so that it finds the d2v file you created using DGMPGDec #
MPEG2Source("E:\test\movie.d2v")
# Take off the bottom 8 pixels
crop(0,0,-0,-0)
SeparateFields()
UnDot()
Convolution3d(preset="movieHQ")
# AddBorders(clip clip, int left, int top, int right, int bottom [, int color])
AddBorders(0, 0, 0, 0)
HybridFuPP()
Weave()
assumefps(30000,1001)

IanB
9th November 2006, 05:31
But Convolution3d has temporal dependancies so method 2 is more applicable. Much has been written on this subject :search: Hint:- selecteven selectodd weave separatefields temporal etc get the idea ;)

stickboy
9th November 2006, 12:55
For spatial-temporal smoothers, you might find it easier to use JDL_UnfoldFieldsVertical/JDL_FoldFieldsVertical functions (http://www.avisynth.org/stickboy/).