Log in

View Full Version : Why deinterlace?


redeemer-dk
10th June 2003, 15:19
Why do we deinterlace? MPEG2 supports interlaced contents fine, and if you uncheck the "Progressive" checkbox in CCE the players will treat it as interlaced content. All the titles i have encoded that were deinterlaced has come out fine... so why deinterlace?

-Rune Svendsen

gerti67
10th June 2003, 16:53
Hi reedeemer-dk,

try to do an interlaced encode with a max bitrate of 2788 kbit/s (SVCD max standard) - and you will see why people want to deinterlace at such low bitrates. ;)

Greetz,
Gerti

Justinus
11th June 2003, 03:20
It would give you better compression ratio when you deinterlace the video. Also, if you plan to watch that movie on computer monitor, you better deinterlace. It looks much more better.

redeemer-dk
11th June 2003, 15:33
I can understand the bitrate issue. But when i watch interlaced DVDs in PowerDVD they look fine...

Kika
11th June 2003, 15:46
Interlaced SVCD will also look fine - if you are using Bitrates much higher than SVCD-Standard (2/3 of DVD-Standard).

Swan
11th June 2003, 21:17
@redeemer-dk
I think deinterlacing ruins the material completely.
Never deinterlace interlaced material unless you resize it below 576 (PAL) or 480 (NTSC) vertical lines of resolution, use a format that doesn't support interlace, and aim to view it *only* on the computer monitor.

Deinterlacing for DVD and SVCD creation is something I find especially awful.
Yes, PowerDVD deinterlaces the video on the fly, that is what one wants when watching interlaced video on a computer monitor (which is progressive). Then, when one pops the SVCD in the standalone DVD player, it will look good on the TV as well.
So, by *not* deinterlacing, one gets the best of both worlds.

Sure, deinterlacing may save bits and there'll in some cases be less blocking.
But it also totally ruins motion, if you ask me. Plus, you'll get ghosting and other unsightly effects from the deinterlacing and I find that much more offensive to the eye than a little blocking every now and then.
Some material just isn't suited for SVCD. Music videos, interlaced video like sports (lots of action, rapid motion, many scene changes), for example. Progressive video is of course the best, because it's easier for the Mpeg-2 encoder to deal with, but interlaced material can look smashing too. Documentaries looks great, sitcoms, talkshows, well, most material looks great when one makes an effort to set up the encoder right. But only when kept interlaced.

Why do we deinterlace? MPEG2 supports interlaced contents fine, and if you uncheck the "Progressive" checkbox in CCE the players will treat it as interlaced content If you uncheck "progressive" in CCE it will use a different method for encoding the material most suitable way. For progressive video content, CCE uses something called "Zig-Zag scan" and for interlaced it uses "Alternate scan". When you uncheck "progressive", it uses alternate scan which is better for interlaced material.
The same goes for most encoders, such as TMPGEnc, they can switch between these algorithms.
You can read more about it if you do a search on the web. But you are absolutely right, there is no need to deinterlace Mpeg-2. In fact I think it is wrong to do so.

RB
12th June 2003, 07:33
I agree with everything Swan said, well done. But just to make sure, when encoding interlaced material, besides unchecking "Progressive frames", you'll also have to uncheck "ZigZag scan" (CCE 2.50) and set scanning order to "Alternate" (CCE 2.66+).

Swan
12th June 2003, 11:37
RB, you are absolutely right, thanks for adding the info.
The "progressive" checkbox in CCE (2.66+) just sets the flag in the Mpeg-2 header to "progressive".
Unchecking "Zig-Zag scan" and selecting "Alternate" is *very* important.

I'm glad someone agrees with me, most people don't seem to understand why deinterlacing is wrong when encoding interlaced material to SVCD/DVD. ;)

Kika
12th June 2003, 12:15
I agree.
Hehe, i guess some people are thinking interlacing is an error in the Video :rolleyes:

There are only a couple of reasons for Deinterlacing:
Very low bitrates
Output-Format does not support interlacing
Captures from very old VHS-Tapes

Swan
12th June 2003, 13:19
I'm sorry, Bach, but I was talking about interlaced video and assumed everyone else was too.
For me, the words "interlaced video" means genuinely interlaced material (shot on a video camera which takes 29.97 frames per second, 59.94 fields for NTSC, 25 frames per second, 50 fields for PAL), and not "artifically interlaced", i.e. telecined.

Deinterlace is something that is done on interlaced video and is damaging. In contrast, to perform IVTC on NTSC telecined material is 100% correct. That is not damaging at all. If done right, of course.
I don't call that procedure deinterlacing, I call that inverse telecine.

But just as you say, when the video is neither fish nor fowl, that's when it gets tricky (a bad telecine, like snip.avi the one I stumbled upon and you mention above). I'll try your script.
I ended up encoding it as interlaced, in order to not risk add any more ghosting and blending. And the resulting SVCD looked as bad as the DVD, in terms of blended fields. But at least not worse. :)

So.. I stand by what I wrote:
Deinterlacing interlaced material is wrong.
Because degrading the quality of the material, to me, is wrong.

Swan
12th June 2003, 16:45
where the "|" means that you have a scene cut/edition at this point. As you can see, the video starts as "top field first" and suddenly becomes "botton field first". The decoders doesn't have problems with it, because it reads the "field order flag of the
I understand 100% about field order.
I have never encountered a DVD (or video elsewhere) with both Top and Bottom field first order, but I can see how it can happen and why it doesn't matter on, say a DVD, where the decoder just reads the flags.

Luckily, these things are rare.:)
All I am saying is that I am against deinterlacing *genuinely* interlaced video (shot on a video camera which takes 29.97 frames per second, 59.94 fields for NTSC, 25 frames per second, 50 fields for PAL). Artifical interlace (telecining) is something else. At least to me.:)
And that in some cases, it's better to leave a badly telecined film to DVD transfer as it is, as opposed to just blending already blended fields and creating an even uglier video. :)

slk001
12th June 2003, 21:33
Swan,
You are 100% correct - never deinterlace true interlaced video. However, I think that redeemer-dk was confusing interlaced video with telecined video - which should be IVTC'ed.

Swan
13th June 2003, 12:53
I should not have been so quick to say DVDs with "variable" field order are unusual. I just stumbled upon one. :-(
One minute (!) of the DVD has bottom field first, while the rest it top. It's interlaced (genuinely interlaced) NTSC video. And it happens right in a scene, not on the start of one scene or at the start of a chapter.
Now, I don't want to deinterlace the entire video for one minute's worth of wrong field order.
I can see the field order problem with the naked eye when watching the SVCD I did on the TV, but also when using bob () in a script loaded into VirtualDub. Motion is fluid until that 1 minute starts, the everything moves backwards and forwards in the "wrong" way. Duh!

So, there is no way to deinterlace just those 60 seconds or change the field order on that particular spot? :(

auenf
13th June 2003, 14:58
Originally posted by Swan
So, there is no way to deinterlace just those 60 seconds or change the field order on that particular spot? :(

when it was orginally authored, it was probably made up of two files so maybe are different cells or something.

or just cut the m2v and encode the 2 parts separate ;)

back on the topic, as ive said many times:

Deinterlacing improves compressability at the expense of motion

(i know that doesnt apply to IVTC tho, so dont pick me up on that ;))

Enf...

Swan
13th June 2003, 16:48
Bach, I'm not skilled with Avisynth, so I'm probably doing something wrong. But this script won't open in Virtualdub:

I get "Avisynth open failure, script error,expected a, or )
(F:\music\concert.avs, line 6, column 40)"

LoadPlugin("C:\PROGRA~1\GORDIA~2\mpeg2dec3.dll")
mpeg2source("F:\music\concert.d2v")
i=fi/196867
f=fe/200601
a=trim(0,i)
b=trim(i+1,f).separatefields().trim(1,2(f-i)-1).weave()#.swapfields()
c=trim(f+1,0)
new_stream=a+b+c
new_stream


Plus, I found a second problematic spot on the DVD. :-(
So there are two of them.

Swan
13th June 2003, 22:17
Bach! I encoded the video, a portion of the "normal" (top field order), that went into the problematic area (bottom field order) and even the transition between them looks perfect. It works!

The script you so kindly wrote is like a magic spell to me, though. :)
It's the most intricate Avisynth script I've ever seen.
If you have time, could you please explain what it does?
Would it be possible to add another section (I have another place, 4 minutes, on the DVD backup needs the same treatment)?

I don't know how to thank you.:D

Swan
14th June 2003, 18:09
It looks great, Bach. :D

So, I can put in several
reverse_field(last, first_field, last_field)
wherever I need them?

But you overestimate me if you think I understand this script. ;)
You remove the first problematic field. Then "reconstruct the frames of the problematic segment" using "weave ()" which
"takes pairs of fields from the input video clip and combines them together to produce interlaced frames. The new clip has half the frame rate and frame count. Weave uses the frame-parity information in the source clip to decide which field to put on top. If it gets it wrong, use ComplementParity beforehand or SwapFields afterwards."
I understand the words, but this is way above my level, right now. ;)
So only the problematic parts of the video are touched?
And the video in the problem areas will still be interlaced? You just changed the field order?

I am very grateful to you. Thanks for taking the time to help me out like this.

Swan
15th June 2003, 20:38
For me avisynth is a so marvelous tool that it deserves a "how to use" advertising.
For, me, Bach is a marvelous Avisynth function writer who takes the time to help out.
Thank you so much! :D

TheJez
18th June 2003, 14:05
Originally posted by Kika
I agree.
Hehe, i guess some people are thinking interlacing is an error in the Video :rolleyes:

There are only a couple of reasons for Deinterlacing:
Very low bitrates
Output-Format does not support interlacing
Captures from very old VHS-Tapes

I'm capturing & converting old VHS-Tapes to DVD at the moment, and don't do deinterlacing. Could someone explain to me why deinterlacing would be better for old VHS-Tapes ? What's the criterium for this decision (e.g. how old or how bad does the tape need to be..?)

The Jez :confused:

Kika
18th June 2003, 14:15
This depents on the Tape and the VCR. On some VCRs, older tapes do result in "jerky Lines". To encode this interlaced, you need a lot of Bitrate or real heavy filtering.
My old VCR was one of them with this "problem". My new one (S-VHS-ET)provides a digital stabilisation, so there's no need to do any deinterlacing only for the reason that the Tape is an old one.
That's all.

TheJez
18th June 2003, 14:44
Thanks for the info. I think the tapes I convert are still good enough (or my VCR corrects this problem good enough), so I can stay in the interlaced domain for encoding. :)

Thanks a bunch,

The Jez

omer123
15th October 2003, 12:24
Using AVI2SCVD and CCE 2.5 to convert my DV home videos,can anyone tell me what should be the average bitrate for interlaced encoding?:rolleyes:

TheJez
15th October 2003, 19:51
@omer123

I don't think there is a difference in required bitrate between interlaced and non-interlaced material. The encoder 'knows' what you source material is, and will treat it that way.
I don't have any experience with SVCD, but as far as I know, this is 'just' MPEG2 video. So a bitrate that provides enough image quality for your needs should do the trick. Generally, I believe, a full movie of say 90 minutes is devided over 2 SVCD's. So in that case you have to make two cd's with approx 45 minutes. Take off some space for your audio track (e.g. 224kbit/s), and you come up with approx. 2196kbit/sec for you video. Try this, and see if the result is satisfying. If not, increase the number of discs and re-calculate.
You can use the online SVCD calculator at http://alfter.us/bitratecalc.html to calculate the avg. and maximum bitrate to use.

Good luck !

TheJez

Mug Funky
5th November 2003, 14:29
interlaced takes a higher bitrate.

MPEG-2 does DCT in both progressive (zigzag scan) and interlaced (alternate scan), but the motion vectors (the major determining factor of quality) is done in frames, not fields. okay, it can be done per field with field picture coding, but this isn't supported by CCE or TMPGenc, and many others.

when the motion estimation is done with an interlaced frame, basically all the error that comes from moving fields by single pixels will have to be added in with DCT blocks later, which increases required bitrate by quite a lot indeed.

just look at a PAL anime encode that's "converterboxed" from NTSC. it's got blocks all over it, even at 7000 kbps (FLCL, anyone?).

if the high quality encoders supported field picture coding, then interlaced SVCD would be more viable, but still higher bitrate due to more temporal info being stored (i don't know the MPEG-2 spec, so i couldn't get into the specifics of it...).


that said, with the right bunch of settings you can get away with 2300kbps SVCD with interlacing. i've done this with TMPG, but not CCE. in theory it's possible.

Sulik
5th November 2003, 19:29
Actually, there is virtuall no difference between field and frame pictures. If anything, field picture coding is usually much less efficient.
Frame pictures can use field or frame DCT. The problem with interlaced content is that there is just much more information than progressive content, and this translates into needing more bits.
Interlaced with no motion is no different than progressive in terms of compression efficiency, but interlaced with motion means much more high frequency coefficients after the DCT, ie more bits.

omer123
6th December 2003, 19:28
Thank u all guys for all the information.I'm doing some testing with a short intelaced dv file.My question is : can I use bitrates higher than 2300 kbps for svcd or the DVD player won't play it?

r6d2
7th December 2003, 13:48
Originally posted by omer123
can I use bitrates higher than 2300 kbps for svcd or the DVD player won't play it?
It depends on the player. By spec, no. However, SVCD specs require a 2x CD drive. Where would the player manufacturers get one today? They are likely using at least 4x, which allows for 5Mbps.

auenf
10th December 2003, 12:57
Originally posted by r6d2
It depends on the player. By spec, no. However, SVCD specs require a 2x CD drive. Where would the player manufacturers get one today? They are likely using at least 4x, which allows for 5Mbps.

actually, the drive that is in most DVD players only supports 2x DVD, its not like the use components the same as in a boxed drive, and its also the reason why dvd standalones are cheaper than dvd-roms.

Enf...