PDA

View Full Version : Deinterlacing


sync
1st May 2003, 18:17
I just read the article on deinterlacing in the Links sticky. The article mentions that tv shows can be broadcast either interlaced or progressive. If I'm using a DV to capture tv, will I always end up with interlaced material? In other words, if a broadcast is progressive, the camcorder will record it as interlaced.

neuron2
2nd May 2003, 06:46
No. It will still be progressive after capture. You have to align the fields in some cases, however. Progressive just means that the two fields making up a frame were sampled at the same temporal moment. The capture process cannot affect the original temporal sampling.

sync
2nd May 2003, 15:54
I should have specified in my original post that I'm capturing to DV tape. Does that make a difference?

bb
2nd May 2003, 19:00
No difference. If the source is progressive (or phase-shifted progressive), then the camcorder will record just this kind of data. It will store field by field on the tape as they come from your source. You will be able to restore the progressive frames.

bb

sync
3rd May 2003, 02:35
My understanding is that DV camcorders capture two fields and interlace them into one frame. It's a physical process that is the same whether the source is interlaced or progressive. However, if the source is progressive then the two fields are identical. So even though the frame is created through a process of interlacing, the result is not interlaced. Does that sound right?

vhelp
3rd May 2003, 08:57
hi sync,

I've done many projects that describes your questions. I had these
same questions too, way back when. Then, I found them out (answers)
through trial and error - a good eye, and attention to detail.

Bottom line is like this:
* if you record to miniDV tape, a TV show, and the source is airing it
..in pure Interlace mode ie, NEWS, Gameshows, SOAPS, then YOUR dv cam
..will record it as such.. Interlaced !!

* if you record to miniDV tape, a TV show, and the source is airing it
..in some form of Telecined mode, then your dv cam will record it in
..that mode

* if you record to miniDV tape, a TV show, and the source is airing it
..it in some crazy Interlaced mode, then your dv cam will record it in
..THAT same mode.

* if you record to miniDV tape, a TV show, and the source is airing it
..in PROGRESSIVE mode, then your dv cam will record it in THAT mode.


So, whatever the modes your dv cam records it in, you'll receive it no
difference than if you captured it straight from the source vs. recording
it to miniDV tapes. Your final capture will be the same in any case.

The same goes with recording (or capturing) any source ie, VHS, Cable,
Satellite, DVD etc. etc.

But, when you shoot footage w/ your cam, it will always be in pure
Interlace (every frame is Interlaced.. 2 fields Interlaced into one
frame [if i'm wording it correctly]) every 1/50 or 1/60 th of a second.

The bottom line is, when you capture or record to tape (weather it be
VHS VCR, or DV CAM) you will be recording THAT mode (Interlaced or
telecined or PROGRESSIVE) to tape.

So, when you capture it using your analog capture card, you will be
receiving it as THAT mode, and not any other. Example, say you record
to tape (VHS or miniDV) a NEWS broadcase. You will be recording to
tape, Interlace. When you capture this same tape, your caputre card
will capture those frames as Interlace.
If you record to tape, say, a Movie that was aired this evening, and
later, you replay the tape (VHS or miniDV) and capture it, your card
will be capturing the frame as Telecined (if that movie was Telecined)
else if Movie was aired as PROGRESSIVE, you card would capture it as
PROGRESSIVE.

Ok, now you're confused, because you want to use your dv cams' firewire
instead. And you know that firewire from your dv cam will no doubt
be Interlaced. Well, that is true IF you are using your firewire to
transfer your HOME FOOTAGE you just shot. BUT, if you recorded to a
miniDV tape, a TV Movie, and am instead of using S-Video of your dv
cam, you are using your firewire to hd, then you will be again, receiving
Telecined frames (not Interlace)

If will all depend on what your source is airing. Just be aware that
some broadcasting station (could and will at times) air a Movie or
TV show w/ weird or strange Telecined patterns that will (and can)
drive you crazy. But, don't let that get you confused about what your
dv cam will receive. It's always pendant upon the source airing the
contents.

Sorry for the LONG explanation. I've ben there and done it all (for ya) hehe..

Hope that cleared up any questions you may have.
-vhelp

sync
3rd May 2003, 16:31
vhelp,

Thanks, I definately get it now. ;)

Are you doing all your encoding in MPEG-1? I've found that most encoders, except Procoder, can't handle interlacing when encoding MPEG-2. But it doesn't seem to be an issue for MPEG-1.

You mentioned "strange Telecined patterns that will (and can)
drive you crazy". How are you handling those?

vhelp
3rd May 2003, 17:26
hi sync,

until recently becoming a little more educated w/ Telecine process,
I now realize that I need more education in MY process he he..

As much as I thought I was handling them well, I wasn't. Either too
many fields (wrong or right) are blended, or they get missed, and
a missfire (Interlace) happens/shows up.

Until Donald Graft can perfect his decomb.dll (I think he's re-working it)
(and close to a better algy) we will just have to work w/ what we
have and live with our limitations, or else just make the encode too
blurry hehe..

@sync,
I'm speaking of those video's that I capture from TV. These are a
pain sometimes, when they are badly Telecined. I've had more time
to find other bad patterns in the Telec process. Batman, for example,
is nortorious for iratic behavior. TVLD has this show on, and it's in
great quality!! but, I can't get the pattern worked out w/ Donald Graft's
decomb.dll - - I busting my head wide open on this hehe..
Personally, I DON'T think I need to wait for DVD of this show. The quality,
like I said, is fantasic. I just have to figure out a way to NAIL-DOWN
the Telecine pattern, and TRAIN decomb.dll to properly de-Telecine it,
a.k.a. IVTC.

I'm sure you (as well as everyone else here and there) know how bad
quality can look w/ (IF) encoded w/ Interlace on. I've done a few of
my HOME-FOOTAGE w/ my DV CAM and (low light condition) quality is just
down right awful. If I crank up the bitrate, STILL, down awful. If
shooting footage w/ DV cam, either you get a PROGRESIVE cam, or you
just plain forget it hehe..
Actually, de-Interlacing isn't so bad. Provided you have ADAQUATE lighting !!
But, even w/ vdub's smartde-Interlace, you get color artifacts, BUT, if
you use AVIsynth, w/ the same principle, those same artifacts seem to
dissapear. Here, try .AVS script (bring it into vdub, so you can see
it in it's time-line window) and then proceed to encode it. Doesn't
look too bad, does it ??
Please let me know how it comes out on your end ??

# by vhelp

x="h:\1.11_13.avi"

txt_dir="c:\w98\system\"

LoadPlugin(txt_dir+"decomb.dll")

segmentedAVISource(x)
ConvertToYUY2()

assumeframebased()
separateFields()
selectEvery(1,0)
weave()
fieldDeinterlace()

Well, let me get ready.. want to check out some more researching on
a new DV cam.
-vhelp

bb
3rd May 2003, 18:22
Originally posted by sync
Are you doing all your encoding in MPEG-1? I've found that most encoders, except Procoder, can't handle interlacing when encoding MPEG-2. But it doesn't seem to be an issue for MPEG-1.
MPEG-1 does not support interlaced encoding. If you want to encode MPEG-1 you have to deinterlace - either by using a deinterlacer or by dropping one field.

One of the enhancements of MPEG-2 over MPEG-1 was the ability to encode in interlaced mode.

bb

neuron2
3rd May 2003, 18:39
Originally posted by sync
My understanding is that DV camcorders capture two fields and interlace them into one frame. It's a physical process that is the same whether the source is interlaced or progressive. However, if the source is progressive then the two fields are identical.No. The two fields are not identical. But they are sampled at the same temporal moment. One has the even lines and one has the odd lines.

So even though the frame is created through a process of interlacing, the result is not interlaced. Does that sound right? It all depends on how you use the terms. :) If you take the result and send it in analog form to a TV, the analog signal is interlaced, but the content is still progressive. Just think of whether the two fields are from the same moment or not. If they are, the content is progressive. If they are not, then the content is nonprogressive, which you can call "video" or "interlaced" if you like.

Realize that even progressive content can appear combed (due to field phase shift) and fool you into thinking it is "interlaced".

sync
3rd May 2003, 18:39
vhelp,

The only software I'm familiar with is AVI2SVCD, so I'm not familiar with VirtualDub.

I was deinterlacing, but everything I've read indicates that if interlaced material is being watched on TV, then it's better to leave it interlaced. So right now I'm testing Procoder which is capable of encoding interlaced material.

How do you indentify if material has been Telecined?

sync
3rd May 2003, 18:44
Originally posted by bb
MPEG-1 does not support interlaced encoding. If you want to encode MPEG-1 you have to deinterlace - either by using a deinterlacer or by dropping one field.

One of the enhancements of MPEG-2 over MPEG-1 was the ability to encode in interlaced mode.

bb

When I tried an MPEG-1 encode I didn't notice a problem with motion artifacts and I didn't deinterlace. I'm using AVI2SVCD and I suppose it's possible that it automatically deinterlaced, but I don't think it would know if the source was interlaced. What results should I notice from encoding interlaced material to MPEG-1?

neuron2
3rd May 2003, 18:45
Originally posted by vhelp
Until D.Graph can perfect his decomb.dll (I think he's re-working it) (and close to a better algy) we will just have to work w/ what we have and live with our limitations, or else just make the encode too blurry hehe.. My name is Donald Graft, I am always working to improve Decomb, and it will never be perfect. :)

I just have to figure out a way to NAIL-DOWN the Telecine pattern, and TRAIN decomb.dll to properly de-Telecine it, a.k.a. IVTC.You're always welcome to submit a clip to me for analysis. That is how Decomb gets improved.

neuron2
3rd May 2003, 18:50
Originally posted by sync
When I tried an MPEG-1 encode I didn't notice a problem with motion artifacts and I didn't deinterlace. I'm using AVI2SVCD and I suppose it's possible that it automatically deinterlaced, but I don't think it would know if the source was interlaced. What results should I notice from encoding interlaced material to MPEG-1? SVCD requires MPEG2, doesn't it? How could you make an MPEG1 SVCD?

neuron2
3rd May 2003, 18:51
Originally posted by sync
How do you indentify if material has been Telecined? By reading the sticky in the DVD2AVI forum:

http://forum.doom9.org/showthread.php?s=&threadid=34696

sync
3rd May 2003, 18:52
Originally posted by neuron2
SVCD requires MPEG2, doesn't it? How could you make an MPEG1 SVCD?

It was an MPEG1 VCD.

sync
3rd May 2003, 19:05
Thanks Donald. When I see how complicated all this is, archiving to S-VHS tape starts to look a lot more appealing. :)

sync
3rd May 2003, 19:19
Tivo units use MPEG2. Why doesn't interlacing and Telecining cause problems for it?

bb
3rd May 2003, 19:37
Originally posted by sync
When I tried an MPEG-1 encode I didn't notice a problem with motion artifacts and I didn't deinterlace. I'm using AVI2SVCD and I suppose it's possible that it automatically deinterlaced, but I don't think it would know if the source was interlaced. What results should I notice from encoding interlaced material to MPEG-1?
You will see ugly motion artefacts if you use full resolution.
If you're talking about VCD MPEG-1, you vertically downsize by a factor of two, which can be done in two possible ways: by interpolating consecutive lines of the two frames, or by simply dropping one of the fields. The result won't show interlacing artefacts, but may show some blurring.

You'll get the most proper results by capturing full size, then deinterlace using a good deinterlacer (FieldDeinterlace), then downsize to CIF resolution.

bb

bb
3rd May 2003, 19:43
Originally posted by sync
When I see how complicated all this is, archiving to S-VHS tape starts to look a lot more appealing. :)
Definitely not. You can use a stupid approach to find out what to do with your source (works for PAL, NTSC is a bit more complicated):

1. Watch your source and see if there are combs. If not, your source is progressive, else 2.

2. Open your source through a simple AviSynth script with a Telecide command added, like

OpenAviSource("blabla")
Telecide()

No more combs? Fine. Else 3.

3. Replace Telecide() with FieldDeinterlace(). Combs (at least most of them) should be gone. Your source is "truely" interlaced.

bb

P.S.: Please don't beat me for the simplification...

neuron2
3rd May 2003, 20:08
Originally posted by sync
Tivo units use MPEG2. Why doesn't interlacing and Telecining cause problems for it? Tivo units store the MPEG stream on the hard disk. To play it back they read the stream and decode it with an MPEG decoder and send the results to the TV.

Why do you think there would be a problem?

bb
3rd May 2003, 20:24
Haha, Donald, it's always a pleasure to read your posts :) (by the way: do you have a new cat?)

True, there's no problem at all as long as you watch the stream on an interlaced device (TV). Problems may arise if you start to capture the stream (analogue or digital; I don't know if the latter is possible with Tivo boxes). But I guess most MPEG-2 streams in broadcasts are sent as progressive video, because the TV companies are interested in saving bandwith.

If you capture an interlaced stream by any chance though, then you'll run into the same problems as with any other source as soon as you're starting to re-encode.

bb

sync
4th May 2003, 01:03
Originally posted by neuron2
Tivo units store the MPEG stream on the hard disk. To play it back they read the stream and decode it with an MPEG decoder and send the results to the TV.

Why do you think there would be a problem?
That's DirecTivo. Standalone Tivo units take an analog stream and encode it with MPEG-2.

I realize now that my question is based on an assumption which I haven't stated. Let's forget about Telecine, because it's not clear to me where that is a problem, and focus on interlacing. I've found that if I encode interlaced material with MPEG-2 and play it back on TV that I get motion artifacts. It seems that most MPEG-2 encoders have difficulty with interlacing (Procoder is an exception).

Tivo takes uncompressed video and encodes it with MPEG-2. So I'm wondering why it doesn't exhibit this problem of motion artifacts with interlaced material.

sync
4th May 2003, 05:22
Originally posted by bb
If you capture an interlaced stream by any chance though, then you'll run into the same problems as with any other source as soon as you're starting to re-encode.

bb
As I mentioned in my previous post, I'm wondering why Tivo itself doesn't have this problem with encoding interlaced streams. The streams can be input from a variety of sources: cable, antenna or satellite.

neuron2
4th May 2003, 05:32
Originally posted by sync
I've found that if I encode interlaced material with MPEG-2 and play it back on TV that I get motion artifacts. It seems that most MPEG-2 encoders have difficulty with interlacing (Procoder is an exception).That is correct. Many MPEG2 encoders that claim to support interlacing do not do it correctly.

Tivo takes uncompressed video and encodes it with MPEG-2. So I'm wondering why it doesn't exhibit this problem of motion artifacts with interlaced material. Because they do it correctly. :)

SomeJoe
4th May 2003, 07:38
Originally posted by neuron2
No. The two fields are not identical. But they are sampled at the same temporal moment. One has the even lines and one has the odd lines.

Sorry to diagree with you neuron2, but I believe that is not quite right. Standard DV camcorders capture fields at different instances in time (1/60th of a second apart). The two fields are packed together in a "frame" in the digital datastream. This is why we must know the field dominance of a DV stream, so that we know which field of the frame is to be shown first.

There are some newer (and much more expensive) prosumer/professional DV camcorders that are capable of progressive shooting, where the entire frame is captured at the same instant in time. But the standard consumer Sonys & Panasonics are not in this class.

Originally posted by bb
But I guess most MPEG-2 streams in broadcasts are sent as progressive video, because the TV companies are interested in saving bandwith.

As far as I know, satellite companies like DirecTV and Dish Network send their MPEG-2 interlaced. But they have other tricks available at their disposal. They typically broadcast 10-12 channels together on a transponder, the total channel bandwidth at about 50 Mb/sec. The encoders they have are smart enough to where each channel is VBR, and each channel can "borrow" bandwidth from another channel on the same transponder. In other words, one channel with a fast action motion scene can borrow a few extra Mb/sec from a channel with a still scene for a few seconds. So they can get away with an average 4Mb/channel and still make it look good. :)

neuron2
4th May 2003, 07:45
Originally posted by SomeJoe
Sorry to diagree with you neuron2, but I believe that is not quite right. Read it again. I was responding to this: "However, if the source is progressive then the two fields are identical." What I said is clearly true with respect to this statement.

If the two fields are originally from a progressive frame, capturing them with a DV camera as you described does not make them interlaced. The resulting frame will not be combed. It is irrelevant that they were transmitted 1/60th seconds apart. What matters is when they were sampled.

Field dominance does not matter for progressive content (as long as the corresponding fields are aligned in frames and there is not a one-field phase shift).

Of course, as you say, shooting with a non-progressive DV will produce interlaced video, but I was discussing capturing progressive video.

bb
4th May 2003, 11:32
Although I doubt that this is necessary I second neuron2. If you record a progressive source using an interlaced mode only DV cam, you'll still get a progressive result. Although each field gets recorded at a different point in time, it doesn't change the content during the recording. So if two consecutive fields built a progressive frame in the source, they still do in the target, thus the video remains progressive.

Originally posted by SomeJoe
As far as I know, satellite companies like DirecTV and Dish Network send their MPEG-2 interlaced. But they have other tricks available at their disposal. They typically broadcast 10-12 channels together on a transponder, the total channel bandwidth at about 50 Mb/sec. The encoders they have are smart enough to where each channel is VBR, and each channel can "borrow" bandwidth from another channel on the same transponder. In other words, one channel with a fast action motion scene can borrow a few extra Mb/sec from a channel with a still scene for a few seconds. So they can get away with an average 4Mb/channel and still make it look good. :)
Ok, but they could save more bandwidth without compromising quality by transmitting progressive MPEG-2 (I'd say up to 30%). So they could put more channels together on the same transponder.

On the other hand they could save even more bandwidth by switching over to more advanced compression technologies (e.g. MPEG-4)...

bb

SomeJoe
4th May 2003, 21:51
Originally posted by neuron2
Read it again. I was responding to this: "However, if the source is progressive then the two fields are identical." What I said is clearly true with respect to this statement.

You're absolutely correct. I had no idea you were referring to progressive-shot DV footage. sync's quote in your post was out of context, and it wasn't at all evident that progressive-shot DV was being discussed.


Originally posted by bb
Ok, but they could save more bandwidth without compromising quality by transmitting progressive MPEG-2 (I'd say up to 30%). So they could put more channels together on the same transponder.

Transmitting progressive MPEG-2 might be an option if the original material was progressive (i.e. film). They could set RFF/TFF flags in the stream just like we do on DVDs ... it would only make sense that the MPEG-2 decoder chips in the satellite receivers could deal with this as easily as the same decoder chips do in DVD players.

But if the original material that needs to be broadcast is interlaced, that can't be converted to progressive just to save bandwidth because too much quality is lost. Especially when the satellite company is trying to compete with the over-the-air analog broadcast of your local channels.

zeus163
5th May 2003, 00:41
"I've found that if I encode interlaced material with MPEG-2 and play it back on TV that I get motion artifacts. It seems that most MPEG-2 encoders have difficulty with interlacing (Procoder is an exception)."

I have a hard time buying this with ProCoder. All of my ProCoder encodes (unless I deinterlace) have weird motions. Of course, what I'm doing is using my digital8 camera as a middle man and then encoding those for DVD's. I've had my friends watch numerous test encodes and we have always thought that the ProCoder de-interlace was the best one on any TV in our house and at others (smoothness and quality wise).

However, last night was not the case and FieldDeinterlace won out hands down on the last three test encodes I've done and tested side by side with ProCoder (lower/odd no deinterlace) and ProCoder (adaptive Deinterlace). I know deinterlacing seems to be a big no-no, but I'm banging my head here trying to make sure I get the best encodes for my late night DVD captures for my friends.

Right now I'm switching over to FieldDeinterlace and just wish I could get that to work straight from Premiere to CCE.

As soon as I start my mother's day project, I'll start my next round of encodes as this will be using pure DV footage from the digital 8 camera via firewire to the hard drive.

bb
5th May 2003, 17:46
Originally posted by zeus163
Right now I'm switching over to FieldDeinterlace and just wish I could get that to work straight from Premiere to CCE.
You can: use the PluginPac frameserver.
http://www.debugmode.com/pluginpac/frameserver.php

bb

zeus163
6th May 2003, 08:31
Actually, you can't use fielddeinterlace() with that plug in. I've tried and I've even posted about it on the debug board. The writer of the plug-in replied that he'd look into adding deinterlacing into the plug-in. If you've got it figured out, I'd love some suggestions to be able to use it. It's another step in my decoding process, but I don't mind as I was able to run through three of my encodes today with avisynth scripts in the same amount of time it took to do one ProCoder encode in MQ.