Log in

View Full Version : 1080i SD upconvert -> DVD


alanisrox69
3rd December 2005, 10:21
Hi there,

I captured Jay Leno the other night, unfortunately, NBC was having network problems and it was just the SD broadcast upconverted to 1080i with black bars on each side.

I wanted to convert this to regular NTSC DVD (720x480), but I'm a bit confused on how to do this in the avs.

I got this:
LoadPlugin("C:\Program Files\AviSynth2\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth2\plugins\Decomb.dll")
MPEG2Source("C:\Documents and Settings\Derek\Desktop\AlanisCrazyLeno.d2v")
Crop(256, 8, -256, -22)
AddBorders(110,0,110,0)
LanczosResize(720, 480)
convertToYUY2()

But still the video is small and only fills up the center of the screen, however it is the correct aspect ratio and their faces aren't stretched, etc.... What am I doing wrong?

Thanks for your help!
-Derek-

scharfis_brain
3rd December 2005, 10:24
Provide an unprocessed sample video, please.

alanisrox69
3rd December 2005, 10:35
Thanks for the fast response!

Here's a sample:
http://216.120.231.15/~unprodi/AlanisCrazyLenosamp.ts

Thanks for your help!

-Derek-

scharfis_brain
3rd December 2005, 10:58
mpeg2source("D:\FORUM\alanisrox69\AlanisCrazyLenosamp.d2v")#,cpu=6)
crop(246,0,-234,-8) # crop it down to 1440x1080 (4x3 with PAR 1:1)

leakkernelbob(order=1,threshold=8) #bob deinterlace (prepare for resize)

bicubicresize(704,height) #resize to 704x480.
converttoyuy2() #in two steps to increase speed,
bicubicresize(width,480) # while doing a YV12 -> YUY2 conversion

assumetff() # set the output fieldorder
separatefields() # reinterlace
selectevery(4,0,3)
weave()

feed this script into your favourite MPEG2 encoder, with these main options:
- interlaced encoding
- fieldorder TFF (Upper/Top Field First)
- resolution 704x480
- Display Aspect Ratio: 4:3

alanisrox69
3rd December 2005, 11:00
OKay, thanks for that.

But may I ask why bicubicresize? Isn't that lesser quality than Lanczos?

and why 704, I'm on NTSC here and prefer 720 (looks nicer on my TV).

-Derek-

scharfis_brain
3rd December 2005, 11:14
Bicubic is faster than lanczos.
Lanczos is only 'better' (there is no real definition for that) if the source is rich in detail.
there is NO difference between 704 and 720. and I doubt that you'd see a quaity gain for 720 over 704.

if you need 720 pixels width just do an
addborders(8,0,8,0)
at the very end of your script.

alanisrox69
3rd December 2005, 11:22
Thanks a lot!

In fact, my script was actually okay too with slight modification:
LoadPlugin("C:\Program Files\AviSynth2\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth2\plugins\Decomb.dll")
MPEG2Source("C:\Documents and Settings\Derek\Desktop\AlanisCrazyLeno.d2v")
Crop(256, 8, -256, -22)
LanczosResize(720, 480)
convertToYUY2()

the reason I was getting small video was because I had "normal size" checked in my MPC. Doh!

I will be encoding this video with my script and your script to compare the two (yours with the addborder to make it 720) using CCE 9pass 9406kbps.

I'll compare the two and post back! Thanks for your help! So glad to find people who are knowledgeable and friendly!

-Derek-

scharfis_brain
3rd December 2005, 11:29
your script will destroy interlacing entirely!
it will make the fluid 60i (60 fps) to a ghost jerky 30p (30fps).

do NOT do that.

trust me. my script is the optimal solution. It is slower, of course. but it leaves image structure, aspect ratio, and color quality intact, what your script does not.

720x480 is NOT 4x3 it is wider that 4x3
only
704x480 or 720x480 with black bars (8 pixels each) on the left & right is true 4x3.

alanisrox69
3rd December 2005, 11:34
OK so for your script, to get 720, I just do:
crop(246,0,-234,-8) # crop it down to 1440x1080 (4x3 with PAR 1:1)

leakkernelbob(order=1,threshold=8) #bob deinterlace (prepare for resize)

bicubicresize(704,height) #resize to 704x480.
converttoyuy2() #in two steps to increase speed,
bicubicresize(width,480) # while doing a YV12 -> YUY2 conversion

assumetff() # set the output fieldorder
separatefields() # reinterlace
selectevery(4,0,3)
weave()
addborders(8,0,8,0)

right? I don't have to change the 704 numbers?
Thanks!
-Derek-

scharfis_brain
3rd December 2005, 11:55
yeah. that's it.

but I strongly suggest you to use 704x480 though.
Cause it
- saves a tad of bitrate
- plays in perfect 4x3 on every PC, while 720 nearly never does on PCs.
- 704 is allowed for DVD.

nebula8
15th December 2005, 10:15
@scharfis_brain

Wouldn't it be better to seperatefields, and resize the fields independantly of each other, then weave them back together, retaining the original interlace, and eliminating the deinterlace and pulldown steps?

scharfis_brain
15th December 2005, 14:16
nebula8: no, this will effectively reduce image resolution by half!
sepfields().resize().weave() will introduce a fieldmisalginment as discussed here:
http://forum.doom9.org/showthread.php?p=594339#post594339