PDA

View Full Version : Upconvert 4:3 DV to 16:9 720p HD


frubsen
8th July 2010, 00:37
Hi all,
I have some old 8mm tape footage that I've captured through my Digital8 camcorder to give a DV avi file.

Essentially what I would like to do is bob deinterlace it to 60p, crop to a 16:9 frame and resize to 1280x720.

Yes I realize I'm not going to gain any type of quality out of this but I'm putting it into a 720p project so I would like to upconvert it using avisynth before I import it into my editing program.

My script so far....

avisource("video.avi")
converttoyuy2(interlaced=true)
yadif(mode=1,order=0)
Crop(8, 0, -8, -120)
lanczosresize(1280,720)

I'm not sure how much I have to reduce the top and bottom by, because the non square pixel aspect makes my head hurt when trying to calculate proper cropping.

I've cropped the sides 8 pixels each and because this video wasn't framed for 16:9, I'm not going to do an even top and bottom crop. It will differ depending on the shot.

So, how is my script looking? Any sharpening or denoising filters that would help the video out?

Thanks

communist
8th July 2010, 06:45
Is this PAL or NTSC DV? /Edit 60p -> I guess NTSC


So, how is my script looking? Any sharpening or denoising filters that would help the video out?
Hard to tell without any samples/pictures.

The final result will be 16:9 but the image content is going to be distorted.
Assuming it is PAL:
720x576 (1:1,25 or 1:1,333 if you rescale to 768x576) is cropped to 704x456 (1:1,56) and then your scaling to 1280x720 (1:1,7888). Are you sure you that is what you want to do?

1) You need take into account that the input (DV) does not have square pixels and correct for that, 'image should be slightly wider'. That means for PAL rescale to 768x576 (1:1,333)
2) The image after cropping should already have an aspect ratio of 16:9 or you will keep distorting the picture with the upscaling step

/EDIT I'm sure someone can post the values for NTSC

communist
8th July 2010, 06:57
For NTSC your script should work, there is a minor AR error but I guess you can live with it. You can make the cropping part easier if you scale your input to square pixels (640x480 for NTSC) and then crop to a 16:9 frame.

GodofaGap
8th July 2010, 07:18
Why not pillarbox it?

TheSkiller
8th July 2010, 11:34
The correct amount of lines to crop away in this case to get an absolutely correct 16:9 square pixel frame is 120 if you also crop to 704 horizontally (which you do in your script). This is because 720x480 non-square pixels equal a 656x480 square pixel frame and 704x480 equal 640x480.
I've cropped the sides 8 pixels each and because this video wasn't framed for 16:9Don't know what you're trying to say but the cropping to 704 is necessary to keep the aspect ratio correct if you want to crop 120 lines away to get 16:9 (which is the method I recommend, but read on).

And, to hurt your head even more,
one could also do it the other way around: don't crop horizontally (keep 720), and then crop only 111 lines away (=720x369, which equals 656x369) to compensate for the extra space (720<->704) which probably doesn't carry picture information anyway in this case.
The extra space is the difference between the actual active analog picture area and the digitized frame which is a bit wider (mod16) and thus never completely filled with active picture (in case of 720). There are at best 711 horizontal pixels that carry the picture, if it is less then they have been blanked at some point but they still count as active picture area. And there were actually 486 scan lines, but only 480 got digitized because of mod16 (don't worry about it).

So, your script is perfectly okay, but if you want to pillarbox then either
a) crop to 704 and then resize to 960x720
b) resize to 984x720 directly
and then add the necessary amount of pillarboxing to reach 1280.

Hope you understood the logic behind it.

Edit: Oh, and instead of Yadif you could also try Yadifmod with NNEDI2 (example: Yadifmod(mode=1,edeint=NNEDI2(field=-2)) ) or even TempGaussMC.

frubsen
8th July 2010, 15:03
Thanks for the replies

Sorry, the reason I cropped 16 pixels off the sides were because there was about 8 pixels of black on each side.

So if I do my math correctly

704 / 16:9(1.78) = 396

396 x 10/11(0.9) = 360

480-360 = 120 pixels

So 120 pixels total need to come off the bottom and top.

I've thought about pillar boxing, but I'm fine with cropping to have it fill the frame.

2Bdecided
9th July 2010, 11:04
There's a very long thread about doing upscaling...

http://forum.doom9.org/showthread.php?t=145314&highlight=upscale

If you pillar box it, the low quality won't stick out quite so much, though the black bars will. There are various other options aside from pure black bars.

Cheers,
David.