Log in

View Full Version : HDV 1440x1080i to DVD (720x480)


mikeathome
14th November 2006, 05:17
Hi,

Lost in interlace...

http://rapidshare.com/files/3273683/1.mpg (48MB) is an anamorphic interlaced -HDV- clip (1440x1080i @ 29.97fps + MPEG Audio, PS made from HDV/Sony HC3 TS .m2t).

Looking for an Avisynth script using motion adaptive resize, possibly with SecureTDEint or MVBob to DVD compliant size for use with CCSP, HC, Quenc, TMPEG. Want to preserve the anamorphic nature and possibly the interlace as well, whatever you guys recommend. Read a lot about MVBob and SecureTDEint but couldn't get neither one to work. I found at least three different MVBob.avs in the Inet, I am lost...

PLEASE help me...

Thanks,
mike

Pookie
14th November 2006, 06:13
http://forum.doom9.org/showthread.php?p=594339#post594339


http://forum.doom9.org/showthread.php?t=117779

2Bdecided
14th November 2006, 15:03
In my opinion, if you start with an interlaced HD source, and want to end up with an interlaced SD source, there's little advantage to the smarter, slower deinterlacing methods. A dumb bob, resize, re-interlace is all you need.

By all means try the mvbob methods, but compare the quality of the output with a dumb bob, look at the amount of time involved, and judge for yourself if it's worth it.

For myself, even on "difficult" content, it's not worth going beyond bob() (or equivalent).

(Of course, for SD>SD, or interlaced>progressive, things can be completely different - but this is HD>SD interlaced>interlaced).

Cheers,
David.

mikeathome
14th November 2006, 15:45
http://forum.doom9.org/showthread.php?p=594339#post594339


http://forum.doom9.org/showthread.php?t=117779

Pookie,
thanks.

The first link talks simple interlaced resize, is way old prior to scharfis_brain MVBob development. The second link NTSC->PAL. I was interested in explanation HOWTO use SecureDEint and/or MVBob for motion adaptive interlace resize.

I will take David's proposalIn my opinion, if you start with an interlaced HD source, and want to end up with an interlaced SD source, there's little advantage to the smarter, slower deinterlacing methods. A dumb bob, resize, re-interlace is all you need.

By all means try the mvbob methods, but compare the quality of the output with a dumb bob, look at the amount of time involved, and judge for yourself if it's worth it.

For myself, even on "difficult" content, it's not worth going beyond bob() (or equivalent).

(Of course, for SD>SD, or interlaced>progressive, things can be completely different - but this is HD>SD interlaced>interlaced).

Cheers,
David.Global NewHeight=480
Global NewWidth=720

Mpeg2Source("blah.d2v")

AssumeTFF()
SeparateFields()

Shift=(Height()/Float(NewHeight/2)-1.0)*0.25 # Field shift correction

Tf=SelectEven().LanczosResize(NewWidth, NewHeight/2, 0, -Shift, Width(), Height())
Bf=SelectOdd().LanczosResize(NewWidth, NewHeight/2, 0, Shift, Width(), Height())
Interleave(Tf, Bf)
Weave()as I do not understand howto use SecureDEint. This was my original thought, BUT I stumbled over a post here (http://forum.doom9.org/showthread.php?t=114730&highlight=interlace+resize) which tells that this gives you distortion and to avoid this you should use motion adaptive resize (SecureDEint). Unfortunately this post ends up on Aug 20 unresolved. I tried to make it work ... no success. My Material is not 1920x1088 but 1440x1080i.

Well, if someone is willing to invest a little in this, here's scharfis_brain's proposal I could not runFor interlaced resizing the only method I recommend is

Horizontalresizing()
Bobbing()
Converttoyuy2()
VerticalResizing()
Reinterlacing()

Preferrably an motion adaptive deinterlacer with ELA or EDI interpolation like TDeint(mode=1) or SecureDeint().

So a correct 1080i to 480i should look like this:

mpeg2source("video1080i.d2v")
(last.height == 1088) ? last.crop(0,0,0,-8) : last
Bicubicresize(704, last.height)
SecureDeint()
Converttoyuy2()
Bicubicresize(last.width, 480)
Separatefields().Selectevery(4,0,3).Weave()

Avisyth bitches at me already at the resize statements and I found three (3) different MVBob.avs in the INet, one containing the SecureDEint, unfortunately not working, missing parameters. You see I was not lazy just relying on the forum I could not get it working...

Thanks folks,
mike

mikeathome
14th November 2006, 17:59
Hi,

ok, got it working. Found another SecureDeint in the INet (http://www.technik.movie2digital.de/thread.php?threadid=31481&sid=836fba3f0f3085f7d8cf6717a14d50ec - german Board)LoadPlugin("C:\Programme\AviSynth 2.5\plugins\DGDecode.dll")

function securedeint(clip i, int "th", int "l", int "mode")
{ th=default(th,6)
l = default(l,1)
mode=default(mode,2)

function staticmask(clip e, int th, int l)
{e0=e.motionmask(thy1=0,thy2=th,thc1=0,thc2=th,thSD=255,u=3,v=3).temporalsoften(6,1,1)
e1=e0.trim(1,0)
e2=e0.trim(2,0)
e3=e0.trim(3,0)
e4=e0.trim(4,0)
e5=e0.trim(5,0)
e6=e0.trim(6,0)
e7=e0.trim(7,0)
ea0=logic(e0,e1,"OR")
ea1=logic(e2,e3,"OR")
ea2=logic(e4,e5,"OR")
ea3=logic(e6,e7,"OR")
eb0=logic(ea0,ea1,"OR")
eb1=logic(ea2,ea3,"OR")
ec=logic(eb0,eb1,"OR")
(l==0) ? ec .duplicateframe(0).duplicateframe(0).duplicateframe(0) :\
(l==1) ? eb0.duplicateframe(0) :\
(l==2) ? ea0 : e0
}

i.converttoyv12(interlaced=true).separatefields()
e=selecteven().staticmask(th, l)
o=selectodd().staticmask(th, l)
mi=interleave(e,o)
m=mi.bob()
#interleave(mi.weave().tomsmocomp(-1,0,0), mi.doubleweave().selectodd().tomsmocomp(-1,0,0))
m=merge(m.trim(1,0),m,0.5).binarize(upper=false,u=3,v=3)

eedi = getparity(i) ? i.separatefields().eedi2(field=3) : i.separatefields().eedi2(field=2)
toms = interleave(i.tomsmocomp(-1,0,0), i.doubleweave().selectodd().tomsmocomp(-1,0,0))
krnl = i.leakkernelbob(order=(getparity(i) ? 1 : 0), threshold=0)
dumb = i.bob(0,1)

b = (mode==0) ? dumb : (mode==1) ? krnl : (mode==2) ? toms : eedi

d=i.doubleweave()

overlay(d,b,mask=m)
#interleave(min,m,mex)
getparity(i) ? assumetff() : assumebff()
}

video=MPEG2Source("HDV-MPEG-2-(1440x1080i@29.97)_.d2v").Bicubicresize(704,1080).SecureDeint().Converttoyuy2().Bicubicresize(704,400).Separatefields().Selectevery(4,0,3).Weave().AddBorders(0,40,0,40,$000000)
audio=WavSource("HDV-MPEG-2-(1440x1080i@29_97).wav")

AudioDub(video,audio)... and well, it looks really nice. AR corrected ...

mike

Backwoods
15th November 2006, 00:45
SeparateFields()
SelectEven()
Lanczos4Resize(720,360)
Addborders(0,60,0,60)

kidding kidding

foxyshadis
15th November 2006, 10:06
In the current mvbob scripts, securedeint is called SecureBob. (No forwarder attached.) That's a very old version, though, and will give you worse results than the current. I agree with 2BDecided, either a dumb bob or at most TDeint is enough for HD->SD conversion, the resizer you use will have more effect on the apparent visual quality.

If you do use SecureBob, try it with type=0, 1, or 2 before settling for the very slow default of 3 (eedi2). The default in your much older version is TomsMoComp anyway, so it's not a big deal.