Log in

View Full Version : Deinterlaced is not progressive... why?


Zach
6th February 2005, 09:04
My dvd recorded mpeg-2 captures are NTSC, 704x480, interlaced, TFF, YV12 colorspace. I'm trying to convert them to NTSC, 704x480, progressive.

(Yes, in my many hours now of doing forum searches and reading hundreds of posts, I am now aware that doing a YV12-interlaced to YV12-progressive conversion is a bad thing due to the chroma sample, or something like that. It's just that I have a TV that accepts progressive input, and I just want to see for myself with my own eyes if the resulting progressive image is more defined and detailed or not--that's more important to me than the color.)

Anyway, long story short, I've tried using both LeakKernelDeint() and TDeint(), but when I load the .avs script in TMPGEnc, it tells me the video is still interlaced, only now it's BFF instead of TFF.

Only if I use LeakKernelBob() does TMPGEnc think it's a progressive source.

Since TDeint() is purportedly better at maintaining detail, and since that's precisely what I'm interested in testing out, how do I use it to produce a progressive stream?

Here's my simple script:

MPEG2Source( "SS-Clip.d2v", idct=5, iPP=true, info=0 )
AC3source( "SS-Clip.ac3" )
AssumeTFF()
LeakKernelBob( order=1, sharp=true )
#TDeint( order=1 )

The above produces a progressive stream. If I comment out LeakKernelBob() and uncomment TDeint(), the stream remains interlaced for some strange reason--well, at least as far as TMPGEnc is concerned. :confused:

tritical
6th February 2005, 09:55
Well, I haven't used tmpgenc in ages and am not sure how it decides whether an avs input is interlaced or progressive considering there is no way to know without actually examining the stream (there is no internal property that distinguishes interlaced/progressive). Though, since it detects the LeakKernelBob() output as progressive, you could most likely add AssumeFrameBased() after TDeint() to have it behave the same way. LeakKernelBob() invokes AssumeFrameBased after itself, which sets the field order to BFF and sets vi.FieldBased(false). TDeint does not invoke AssumeFrameBased after itself but does set vi.FieldBased(false), so possibly tmpegenc's decision depends on the field order. Anyways, try using AssumeFrameBased after TDeint and see what happens. Finally, why does it matter what tmpgenc thinks it is as long as you know what it is?

Also, if you want bobbed output with TDeint, as you will be getting with LeakKernelBob(), you need to set mode=1.

stickboy
6th February 2005, 11:09
As tritical said, TMPGEnc (like any other program) can't determine whether a video is progressive or interlaced nor whether it's TFF or BFF. You are expected to set these yourself.
Originally posted by tritical:
Though, since it detects the LeakKernelBob() output as progressive, you could most likely add AssumeFrameBased() after TDeint() to have it behave the same way.AssumeFrameBased/AssumeFieldBased should have no effect.

LeakKernelBob returns a 60 fps clip (for NTSC), right? More likely TMPGEnc is guessing whether the material is interlaced or progressive based on the framerate.

Edit:
Sure enough:
23.976 fps source: assumed progressive
29.97 fps source: assumed interlaced
59.94 fps source: assumed progressive

Zach
7th February 2005, 00:09
I guess. <shrug>

For TMPGEng Xpress, when I drop an mpeg-2 (or .avs file) into the source window, it pops up a dialog box telling me what type of stream it is. It's important because if it thinks it interlaced, it will deinterlance itself. I don't know how it gets this info--I'm the newbie here ;)--but if I open up my original, it guesses right (interlaced, TTF), and if I open up a known progressive stream, it guesses right. If I open up a KernelBob'ed stream, it guesses right. So I guess you are just saying to ignore TMPGEng's guess and set it to progressive manually? (There's the option to do that, BTW.)

Remember, since my goal is to produce a progressive mpeg-2 to burn to DVD, I have to set the output to progressive mode. Since AviSynth is already deinterlacing the original mpeg-2, having TMPGEng deinterlace it again seems odd to me, particularly when it shouldn't be possible to deinterlace something twice. (I know it does something if I leave the input setting to "interlaced" because it takes longer to encode.)

Also, if I open up the avs scripts in VirtualDub, the frame count is doubled for the LeakKernelBob() stream. (I guess that is just the "bobbing"--I stress again that I'm a newbie, so forgive my ignorance.

So I guess my next question is should I use LeakKernelBob() or just LeakKernelDeint() if my only goal is to convert my original interlaced mpeg-2 to a progressive mpeg-2? (Again, disregard the ramification of the loss in color quality. THis is just to test picture definition when viewed on my progressive input TV.)

tritical
7th February 2005, 01:22
I think what you want is same framerate deinterlacing and not bobbing (bobbing turns each field into a frame so the # of frames is doubled and the fps is also doubled). So use either LeakKernelDeint() or TDeint(mode=0,...). stickboy pointed out that tmpgenc decides interlaced/progressive based on framerate, so it will get it wrong in this case. You will need to set that property and field order manually.

Zach
7th February 2005, 02:25
Okay, I'll give it a shot and see what happens.

Thanks, everyone, for your help! :)

2Bdecided
7th February 2005, 16:04
Originally posted by Zach
(Yes, in my many hours now of doing forum searches and reading hundreds of posts, I am now aware that doing a YV12-interlaced to YV12-progressive conversion is a bad thing due to the chroma sample, or something like that. It's just that I have a TV that accepts progressive input, and I just want to see for myself with my own eyes if the resulting progressive image is more defined and detailed or not--that's more important to me than the color.)


As you mention burning a DVD, I assume you're then going to play it in a standard DVD player? If your TV has a component progressive input, then you need a DVD player with a component progressive output. (Very common in NTSC land, still relatively rare in PAL land, though you can find them).

What you put on the disc is largely irrelevant. If the player thinks there's ~24 frames per second of progressive content on there (whether or not it's correctly labelled as such by the encoder), it'll try to output 50 (PAL) or ~60 (NTSC) _frames_ per second, rather than the usual 50 or ~60 fields per second. In PAL countries, you get each frame of film output twice. In NTSC countries (I assume) you get the good old 3-2 pattern, but with frames instead of fields. Really smart TVs change this to 72fps 3-3, which doesn't look so jumpy.

For genuine interlaced video content, the DVD player will try to deinterlace as best as it can, doing a field bob or (hopefully!) something much smarter. It's unlikely to do as well as the AVIsynth deinterlace tools which deliver 50 or 60 frames per second.

However, there's no way to put 50 or 60 deinterlaced _frames_ per second onto a DVD. You can have ~24, 25 or @30 progressive frames per second (depending on format), and 50 or ~60 fields per second (depending on format). If you give TMPG 50 or ~60 frames per second, it'll either interlace them to 50 or ~60 fields (i.e. just undoing the deinterlacing, and getting you back to where you started, but at lower quality!), or drop every other frame to give you 25 or 30 frames.

By taking a video source, deinterlacing it to 25 or ~30 frames per second, and burning it to DVD, your taking something with the fluid movement of video, and converting it to have the stuttery look of film. If you want to check how your DVD player displays this kind of source, just just a standard film!

I'm a newbie to this too, so if any of this is wrong, I apologise - but it seems to me that you are not going to be able to carry out the experiment properly using your technique.

Cheers,
David.

Zach
8th February 2005, 01:13
Originally posted by 2Bdecided
As you mention burning a DVD, I assume you're then going to play it in a standard DVD player? If your TV has a component progressive input, then you need a DVD player with a component progressive output. (Very common in NTSC land, still relatively rare in PAL land, though you can find them).


Yes, my DVD player/recorder has component progressive output. Actually, for that matter, my TV has the ability to deinterlance an incoming, interlaced video signal, too. :p (And yes, this endeavor to test which does the best job of deinterlacing is becoming quite a tedious chore.)

Actually, my biggest stumbling block is that I don't seem to have any S/W that will allow me to create a mixed mode DVD. :( (Is that even possible?) They either will convert everything to interlaced or everything to progressive depending on the setting. (They do use "Smart Rendering," i.e., no re-encoding when the mpeg matches the DVD setting.)

Because of this, I have to make separate DVD's for each mode, and as you can imagine, this makes it terribly hard, if not impossible, to truly ABX the final output on my TV. With that said, though, my progressive DVD's did seem a little bit sharper and more defined, but I could never swear to that in a court of law or anything. :D

(BTW, the DVD authoring tools I'm referring to are Nero and Ulead's VideoStudio. For Nero, I use their NeroVision to create the files and then feed it to Nero Burning ROM to write it out. [NeroVision crashes when trying to write to my DVD burner, hence why I have to use their Burning ROM. Go figure.])


Originally posted by 2Bdecided
By taking a video source, deinterlacing it to 25 or ~30 frames per second, and burning it to DVD, your taking something with the fluid movement of video, and converting it to have the stuttery look of film. If you want to check how your DVD player displays this kind of source, just just a standard film!

I'm a newbie to this too, so if any of this is wrong, I apologise - but it seems to me that you are not going to be able to carry out the experiment properly using your technique.

As far as the video content is concerned, I'm happy to report that both interlaced and progressive streams played out fine. With the progressive stream, I did have an audio sync problem, but that is a completely separate issue, an issue related to AviSynth apparently. (If my source has an AC3 stream and I use AC3Source() to bring in the audio, all is fine in the final output; but if my source is just plain old LPCM and I use the internal WAVSource(), everything gets out of sync for some strange reason. Of course, this could be a bug in DGIndex as that is what I'm using to demux the mpeg in the first place.)


Conclusion: I still am going to do some more testing, but in all likelihood I'm just going to stick with interlaced. So far, the quality gains (if any) are not enough to justify the extra processing and re-encoding time.

Wilbert
8th February 2005, 10:07
If my source has an AC3 stream and I use AC3Source() to bring in the audio, all is fine in the final output
I doubt that because it downmixes incorrectly.

2Bdecided
8th February 2005, 11:21
Originally posted by Zach
As far as the video content is concerned, I'm happy to report that both interlaced and progressive streams played out fine.


If you have deinterlaced it in software, 25p should look completely different from 25i when anything moves.

If you use AVISynth to get 50p, your MPEG encoder is going to produce 25i or 25p. It is not going to put 50p on a DVD video disc.

Your DVD player's progressive output is going to deliver 50p whatever is on the disc, but if you have 25p on disc then adjacent pairs of frames in the DVD player's 50p output will be identical (film-like movement), whereas if you have 25i on disc then all output frames will be different.


As for ABXing and mixing both on the same disc - what are you using to encode? You should easily be able to mix and match progressive and interlaced content on the same disc. I've just done it using TMPGenc, CCE, and Vegas, then used DVD Architect to author the disc and it works fine. I'd imagine any authoring package is just going to take the (DVD compliant) MPEGs and author them as-is without any change or re-encoding - interlaced or progressive.

Cheers,
David.

Zach
9th February 2005, 00:17
Originally posted by Wilbert
I doubt that because it downmixes incorrectly.
<shrug> It's just a two channel stream. What's there to downmix?

Zach
9th February 2005, 00:33
Originally posted by 2Bdecided
If you have deinterlaced it in software, 25p should look completely different from 25i when anything moves.
Well, I know the streams are different because my TV will tell me if it's receiving an interlaced stream or a progressive one--well, indirectly anyway. (Like I mentioned above, my TV has a feature/setting to deinterlace whatever is coming in on the component input. If I play back a progressive DVD, though, that option gets disabled.)

I don't know what to say, guys. I humbly admit I'm a newbie at all this, so I'm probably doing something wrong, but honestly, I am not seeing much difference between the two in my limited tests. Maybe my equipment (DVD player and/or TV) is just too good, eh? :p j/k

Oh, with that said, though, I do definitely see a huge difference when looking at the output frame by frame on my PC in VirtualDub. Maybe I should post some screenshots. (I'll try later tonight or tomorrow.) That alone is the only reason I am still considering doing the conversion even though it seems not to make a difference when actually viewed on my television.

Finally, keep in mind all this is only for stuff I record off my satellite and the few S-VHS transfers I'm making. I don't make backups of commercial DVD's or anything like that.

Edits: Added "commerical" for clarity; Fixed a brain-freeze typo.