Log in

View Full Version : Is this OK to deinterlace an Interlaced PAL-movie


LightningFire
29th September 2004, 22:17
The source is interlaced according to Elecard Mpeg2 Player and DVD2AVi. There is no combing visible and Avisynth reports the source as frame-based, not field-based.

Would deinterlacing this with avisynth without loosing information in the deinterlacing process be performed by the following script? Is there a faster way?

LoadPlugin("E:\VIDEO\PLUGIN\Mpeg2Dec3.dll")
#is not a field-based source but is an interlaced source #It has no combing thus should not be converted to #fieldbased
Mpeg2Source("somefile.d2v")
mve=LumaFilter(+1,1.1)
sep= separatefields(mve)
odd= selectodd(sep)
even= selecteven(sep)
ilv=interleave(odd,even)
wve=Weave(ilv)
crp=Crop(wve, 8, 52, 704, 396)
BilinearResize(crp, 568, 320)

Excuse the bad script writing, haven't done much in avisynth yet.

On a side note. Does the graphics card in the computer determine the view in DVD2Avi and other applications?
Could it be possible that no interlacing artifacts are visible on my monitor in any program because my Radeon 8500 does its adaptive interlacing on all of them. Or is that only on overlay sources, and thus limited to one video window?

Greetings

scharfis_brain
29th September 2004, 22:26
no vsible combing = no deinterlacing needed!

elecard shows only the encoding type of that MPG-file, not its content (progressive/interlaced)

also, the assumption,whether a video is frame/or fieldbased from avisynth is complete useless, cause avisynth does not knopw anything about the video-type.
it just sets framebased as default for any content.
fieldbased video meansin avisynth: fieldseparated video (720x288@50fps).


this is complete nonsense:

sep= separatefields(mve)
odd= selectodd(sep)
even= selecteven(sep)
ilv=interleave(odd,even)
wve=Weave(ilv)

delete it from your script.

LightningFire
29th September 2004, 22:46
Thanks for info on Elecard and other.

Still this confuses me a little.

What if a film-source, 24 fps, full frames, was to be converted to a pal DVD, sped up to 25 fps, and then just because televisions love interlaced content, frames were seperated into fields, interlaced and thus stored into MPEG2 and onto DVD. It would not be nescessary to deinterlace this, but I like my content progressive. Would the script be applicable in that case?

Is there any way to determine accurately whether MPEG2 video images are interlaced or progressive?

scharfis_brain
30th September 2004, 05:32
Is there any way to determine accurately whether MPEG2 video images are interlaced or progressive?

the human eye.

Mug Funky
30th September 2004, 07:09
yes, unfortunately most DVD encoding is done as an automated process, and it usually makes more sense to leave the encoder-box on interlaced mode just in case. because such a wide array of stuff gets put on DVD (not just the main feature, but extras, quite often shot on ntsc and blended down to PAL), usually it's best to leave things interlaced.

this only means the encoder is treating the progressive frames as interlaced, requiring (miniscule) extra overhead which DVD can easily afford, and ensuring that if something is odd about the content (field-shifted progressive for example, like some titles i have) the losses from encoding will be minimal.

it's much worse to encode an interlaced sequence as progressive than the other way round, so people like to be safe about it. this means we have to determine ourselves whether the material is progressive or not... it definitely pays to watch a DVD first before you spend hours transcoding it - when you know what you're looking for, it's easy to tell interlaced from progressive (except with field-shifted stuff). if there's a field-shift, telecide will handle it easily.

LightningFire
30th September 2004, 12:08
And what about the what if situatiion?
It is just to test my understanding of Avisynth.
Will it ensure a progressive image?

Thanks, and greetings

Mug Funky
30th September 2004, 15:39
if you're worried about stray combing getting into your movie, then there's ways to detect combing and deinterlace only these frames. usually they're more trouble than they're worth (speed vs usefulness).

if you're really worried, you can use interlaced encoding in your xvid settings...

by the way, you don't need named variables in avisynth unless you're doing more than just "filters in a line" - "implicit last" takes care of that.

so you can get away with:

mpeg2source("blah.d2v")
crop(8,52,704,396)
lumafilter(1,1.1)

bilinearresize(568,320) # might i suggest bicubic or lanczos4?

Stabmaster-Arson
30th September 2004, 22:25
Encoding an interlaced source as progressive will work just fine as long as the field order is correct. However the encoding bits won't be used as effectively, the encoding interlaced interlqced will yield slightly beter results.

Encoding progressive source interlaced will cause no issues whatsoever.

scharfis_brain
1st October 2004, 05:16
Originally posted by Stabmaster-Arson
Encoding an interlaced source as progressive will work just fine as long as the field order is correct. However the encoding bits won't be used as effectively, the encoding interlaced interlqced will yield slightly beter results.
this is wrong!
encoding interlaced as progressive will destroy the interlaced image.
low contrasted areas and colors become stuttery.

Encoding progressive source interlaced will cause no issues whatsoever.
'no issues' is wrong again. encoding progressive as interlaced will need a higher bitrate, will produce more ringing or comb-leftovers, even if there was no combing in the source!

Mug Funky
1st October 2004, 16:45
hehe... you could always encode to DV - a correctly implemented DV encoder will choose interlace/progressive on a per-macroblock basis. of course, i've seen some shocking decisions made with consumer level DV camcorders (big black smooth chunks in the middle of high-motion interlaced area).

i think for a DVD backup, if it's a movie from film and a quick visual inspection reveals no combing (or a regular 3:2 pattern), then there's nothing to worry about and you can go progressive (after IVTC or whatever of course).

it's only with stuff that was made-for-TV that there's a chance of getting mixed up...

i certainly don't lose sleep over it.

LightningFire
1st October 2004, 17:31
The only thing I have seen in some PAL dvds I looked at is blurred motion in fast motion scenes, no streaking or combing. Guess all is progressive then (and the motion blur is there in the film source as well). I still don't trust the output I see on my monitor, as soon as video overlays with directX are used to display, I think my videocard is applying post processing including, if it ever was nescessary, adaptive deinterlacing. Too bad I haven't got much dirty images to experiment with, I envy you :p.
Got a PAL TV-tuner card which does sets wrong field-dominance in captures and might do bad deinterlacing on top of that but no cable or antenna connection to hook it up anymore.

What I did notice in Avisynth was when doing a stackvertical, the top video always looked as if it played more fluently. Guess that points to a delay in the processing in respect to the order they are rendered in, cause it was irrelated to what video was displayed first.

I choose BilinearResize because it is a downscale, and I like kind of blurred and soft image, more than an image with sharper edges. Didn't notice much difference nevertheless comparing a LanczosResize with BilinearResize.
Thanks for the suggestions.