PDA

View Full Version : 1440x1080-50i to 1280x720-25p ?


smok3
19th March 2007, 12:47
the material is mpeg2 HDV from Sony HVR-Z1U HDV Camcorder, it is interlaced. I would like to do some compositing on it, basically i would prefer 1280x720 progressive for the speed and simplicity, the question:

Avisynth script that would do a nice/speedy conversion from 1080i to 720p?

davidhorman
19th March 2007, 19:59
It's all going to come down to how nice and how speedy you want - one tends to rule out the other.

Speedy (assuming the input is anamorphic):

bob.selecteven
[...]resize(1280,720)

From there, scripts tend to get nicer as they get slower.

David

scharfis_brain
19th March 2007, 20:52
if you want pure speed, this is the solution:

separatefields().selecteven().bilinearresize(1280,720)

obviously this is not optimal, since you are throwing away half of the image information due to field discaring.

a better but also much slower solution is this:

tdeint(type=3).bicubicresize(1280,720)

this can be sped up by some amount if you split the resizing in horizontal-only and vertical-only:

bicubicresize(1280, height) # squeeze 1440 to 1280 to let lesser pixels bypass the deinterlacer
tdeint(type=3) # deinterlace
bicubicresize(width, 720) # just downsize the image height from 1080 to 720 after deinterlacing.

smok3
19th March 2007, 20:57
davidhorman: yeah, i forgot that one allready, that would be the fastest 'deinterlacer' i guess? and there should be no motion errors of any kind, which is cool, will try.

scharfis_brain: nice idea about vertical scaling first, will try. (considering speed: i really meant that things that generally render slower than 1fps on fast machines are not very welcome.)

davidhorman
19th March 2007, 22:12
Actually Scharfi's separatefields.selecteven is a better way to start - that way there's only one resize (bobbing is effectively a resize to double height).

David

Blue_MiSfit
20th March 2007, 02:53
Now wouldn't it be nice if there were some way to improve the chroma resolution of HDV (YV12), to make keying easier? :)

smok3
20th March 2007, 08:53
well, actually this camera seems to take the least amount of any color corrections, (compared to jvc HD100 hdv for example) before ugly posterisations show up, is there any teoretical explanation for that? like maybe crapy built in mpeg2 compressor? or maybe interlaced nature?

DeathWolf
21st March 2007, 01:05
If you want to do something dirty, and do not mind losing a bit of vertical resolution:
weave()
bicubicresize(1280,540)
lanczosresize(1280,720)

davidhorman
21st March 2007, 10:48
If you want to do something dirty, and do not mind losing a bit of vertical resolution:
weave()
bicubicresize(1280,540)
lanczosresize(1280,720)

What's the logic behind that? You're blending 2 frames (4 fields) and the output with 12.5P. And why two resizes?

David

DeathWolf
21st March 2007, 13:50
You can remove the weave if the fields were already combined.
(It was just there in case you had fields each separated in frames.)
The logic is not needing any deinterlace by merging 2 fields at a time.
And the two resizes is that if you resize to 720 lines directly you'll create tons of interlacing artifcats.
Whereas by going to 540 first, you're doing a poor man's ultra fast "deinterlacing"(Effectively removing 100% of the interlacing) while keeping a much more stable image(less flickering and associated artifacts).

You might argue that just using the top field(or bottom field) would be even faster though. But (from experience) you gain a little quality by merging the fields.

davidhorman
21st March 2007, 13:56
You might argue that just using the top field(or bottom field) would be even faster though. But (from experience) you gain a little quality by merging the fields.

Ah, I see. You might get a bit of a "double blur" if you shot with a quicker shutter than 1/50s, and in my experience 100% motion blur is too much (c.f. the sitcom Spaced, which appears to have been field blended like this, albeit from SD).

David

Leak
21st March 2007, 13:57
You might argue that just using the top field(or bottom field) would be even faster though. But (from experience) you gain a little quality by merging the fields.
Ummm... since the material was filmed in 50i he'd gain lots of blending/ghosting whenever something is moving - I'm not sure if that accounts for quality...

Also, scaling from 540 to 720 vertically isn't *that* bad.

smok3
21st March 2007, 14:23
i cant really see any difference between:
1.
# speed
avisource("izbira_prvi_del.avi")
converttoyuy2()
separatefields()
selecteven()
bilinearresize(1280,720)

and
2.
# quality
avisource("izbira_prvi_del.avi")
converttoyuy2()
bicubicresize(1280, 1080) # squeeze 1440 to 1280 to let lesser pixels bypass the deinterlacer
tdeint(type=3) # deinterlace
bicubicresize(1280, 720) # just downsize the image height from 1080 to 720 after deinterlacing.

will post some frames later.
--------------------------------------------
edit, and
3.
#dirty
avisource("izbira_prvi_del.avi")
converttoyuy2()
assumefieldbased()
weave()
bicubicresize(1280,540)
lanczosresize(1280,720)

is really a lot of ghosting.

DeathWolf
21st March 2007, 14:37
Just go for #2 then, it's much more proper for overall quality;) (You can change the deinterlacer to whatever you like most too)

Leak
21st March 2007, 14:44
The best solution would probably have been to film with the camera rotated sideways, then using only the odd or even fields and scaling the width from 1080 to 1280... :D

*ducks*

davidhorman
21st March 2007, 14:47
edit, and
3.
#dirty
...
weave()
...

is really a lot of ghosting.

You shouldn't weave, because you haven't separatedfields.

David

smok3
21st March 2007, 15:19
ok, #quality is rendering at about 2.5 fps, good enough.

scharfis_brain
21st March 2007, 16:18
use type=2, or type=1 for faster interpolation methods of TDeint.

smok3
21st March 2007, 21:09
scharfis_brain: ok, will try that on the next project, i must admit that i dont get any 'help' from tdeint.htm help file.

scharfis_brain
21st March 2007, 23:01
better use the txt file included with the archive of tdeint.dll

it explains all available options very well.

Alain2
21st March 2007, 23:22
@scharfis
tdeint.txt doesn't exist anymore, tdeint.htm as replaced it in the last versions, and contains all the same details / explanations but in the "avisynth doc" format