New plugin for dealing with Interlace problems

Comments

farss wrote on 9/1/2009, 2:24 PM
"I didn't have to do the regular thing of selecting a deinterlace method and sacrificing the pristine quality of progressive clips just to avoid artifacts with the interlaced shots"

I'm not following something. If the material is progressive then selecting a de-interlace method should have no effect on it.

Bob.
Dawdle wrote on 9/1/2009, 2:29 PM
There's little chance of a 64bit version. I don't have a PC with a 64 bit processor and I don't think I'll be able to get a new PC anytime soon so you're out of luck there.
John_Cline wrote on 9/1/2009, 2:35 PM
"In other words, separate the fields, high quality resize, then refold the fields into a new interlaced image."

I'm virtually certain that this is exactly what Vegas does anyway.
Laurence wrote on 9/1/2009, 2:41 PM
Yes that is what Vegas does anyway...that is if you select a deinterlace method! The problem is that if you have a project that is a mix of progressive and interlaced footage, selecting a deinterlace method applies this process to the progressive footage as well losing half your vertical resolution.

Actually after doing a test render I can say that if you are starting out with an HD project and downrezzing, things are fine just the way they are. It is only if you mixed in some 60i SD into an HD progressive project and wanted to uprezz it that the process I am describing would help. Like most of us, I never shoot SD anymore so I really am pretty darned pleased with this plugin just the way it is.

64 bit compatibility would be nice, as would a higher quality interpolation algorithm, but all in all, this plugin rocks as is!
farss wrote on 9/1/2009, 2:49 PM
OK. I think I understand what you're saying.
If the progressive material is in fact PsF then Vegas treats it as interlaced?

Bob.
Laurence wrote on 9/1/2009, 2:59 PM
The method of resize of all the footage in a given Vegas is determined not by what kind of footage is in the timeline, or whether or not the project properties are set to interlaced or progressive. The resize method is determined by whether or not you select a deinterlace method. If a deinterlace method is chosen (it doesn't matter if it is blend fields or interpolate), all the footage (regardless of whether it is interlaced or progressive) in that project will be split into fields before it is resized. This avoids artifacts from resizing the interlace comb on the interlaced footage but loses vertical resolution on the progressive.

In a project that is all progressive or all interlaced there is no problem. You just select a deinterlace method for interlaced and don't for progressive. The problem is that when you have a mix of progressive and interlaced footage you need to select a deinterlace method because the artifacts generated if you don't select a deinterlace method look a whole lot worse than the resolution you lose if you don't.

This plugin lets me not select a deinterlace method, thereby forcing vegas to treat the whole project as if it was progressive, then I can selectively add deinterlacing to any interlaced shots I happen to insert into that project.

With a project that is a mix of progressive and interlaced footage, this makes a "knock you over difference" in the apparent quality of the final render. It isn't a subtle difference. It is big. Not on the interlaced sections (which look the same), but in the progressive parts which benefit from the non-field-separated resize.

Edit:

I just wanted to add that this won't help you much if you are shooting 24p. Where it helps is if you are shooting 30p and mixing in 60i (or 25p and mixing in 50i). In my case, I've started shooting most things at 30p since I got my Z7. I still have quite a bit of old footage at 60i though, and my secondary camera (a Sony HVR-A1) only shoots at 60i. Mixing 60i and 30p footage is something I have to do quite regularly.
NickHope wrote on 9/1/2009, 11:38 PM
Dumb question:

Why would someone want to reverse field order?
Marco. wrote on 9/2/2009, 12:51 AM
Mike Crash's Smart Deinterlacer is just an adaption of VirtualDub's one. I get very good results on interlaced footage when using Mike Crash's Smart Deinterlacer if in Vegas' Project Properties I select Deinterlace Method "None" (in this very case for interlaced footage - yes).

Marco
farss wrote on 9/2/2009, 3:28 AM
If it's wrong or if it doesn't match the field order you need to output.

Bob.
Dawdle wrote on 9/2/2009, 4:55 AM
I've updated the plugin to version 1.03.

I've added the option for selecting the interpolation method and added cubic interpolation which produces sharper results.

Download:
Interlace Control 1.03


Dawdle
Laurence wrote on 9/2/2009, 9:31 AM
Thanks. What would it take to make it 64bit compatible?
Dawdle wrote on 9/2/2009, 11:10 AM
I've not done any 64bit development so I can't answer your question.

I don't know if Sony's plugin SDK supports 64bit plugins. If it doesn't then a 64bit version is not possible.
Himanshu wrote on 9/2/2009, 11:37 AM
Dawdle,

Send me an email off-line (via my profile) and I'll help you through generating a 64-bit version of your plug-in. There is only one SDK (v1.0b), and it works for both 32- and 64-bit development.

Hope you're using MS Visual Studio 2008 to develop the plug-in?
Dawdle wrote on 9/2/2009, 1:24 PM
Thanks for the offer Himanshu

I'm not using Visual Studio 2008 and I don't have a 64bit CPU so I wouldn't be able to test anything even if I could build a 64bit version.
Laurence wrote on 9/2/2009, 1:27 PM
OK, I've found out a pretty major limitation with this program. That is that if you are resizing the footage at all it screws up the deinterlace. This is the same problem I have with the Mike Crash deinterlacer.

Let's say you have some interlaced 1440x1080 footage and you pan and crop to zoom in on the footage, then run this deinterlacer. What will happen is that the comb effect at the edges of motion will be resized and no longer match up to being every even and odd line. As this deinterlacer tries to work with even and odd lines, they are already screwed up and the deinterlacer will just mess things up even more.

Another scenario is where you have 1440x1080x60i footage and you try a 1280x720x30p render. As Vegas renders it will temporarily set the project size to 1280x720 and again it will resize the interlace comb so that it no longer matches even and odd lines. Again the deinterlace plugin will screw things up even further.

If however you have straight 1080i footage and you render to 1080p, everything works as it should.

If on the other hand, you select a deinterlace method in the project properties, Vegas automatically unfolds resizes and refolds alternate even and odd lines every time you resize. If you render to interlaced at a new size, the new image will still be interlaced but at the new resolution with even and odd fields still representing the motion captured a sixtieth of a second apart. If you render to progressive at a new size, the image will be deinterlaced, but after even/odd field separation and recombining.

I am not at all sure that deinterlacing and resizing is even possible from a plugin. In order for this to work the plugin would have to have access to the unresized image, deinterlace, and pass it back to Vegas before it was resized.

As things stand, this plugin is great for resizing interlaced footage from 1080i to 1080p, but not good if there is any resizing or zoom and crop going on.
Dawdle wrote on 9/2/2009, 1:51 PM
If you're deinterlacing then it must be applied before any scaling or any other effect otherwise the deinterlacing cannot work. For this reason it is best to apply the deinterlace plugin as a Media FX. Doing this will also deinterlace at the video's resolution and not at the project's resolution and so you can happily work with different resolutions without it turning into a mess.
Laurence wrote on 9/2/2009, 3:00 PM
Wow you're right! I never even knew about putting plugins in as Media FX. I thought I was doing that when I put the effect on the clip on the timeline.

For anyone who is as confused as I was, there are two different options for adding FX to a clip: "Media FX" and "Event FX". "Event FX" is the one that has an icon in the bottom right hand corner of each clip and works at the project resolution. You can get to "Media FX" by right clicking and selecting it instead of "Event FX". This adds the effect at the clip resolution rather than the project resolution which is really important when you are doing something like deinterlacing.

Does everyone else know about "Media FX"? I can't believe I was so in the dark as to not even realize it was there. Yeah that fixes it.
Laurence wrote on 9/2/2009, 3:27 PM
Just to clarify in my head then, the way to use this deinterlace plugin would be to set your project properties to not deinterlace by not selecting a deinterlace method, then putting this effect on all the clips you wanted to use it on by adding it as "Media FX" rather than "Event FX". That is not as obvious as it would seem is it?
farss wrote on 9/2/2009, 3:49 PM
"Does everyone else know about "Media FX"? I can't believe I was so in the dark there"

Yes, I did know about the media FX.
Do you know about The Yellow Triangle?
I think it's not yellow in V9 though.


You have just hit a problem that I've been complaining about for a long time with Vegas. None of this is documented!


Bob.

Marco. wrote on 9/2/2009, 3:56 PM
It's all in the Vegas internal help menu.

Marco
Laurence wrote on 9/2/2009, 4:23 PM
I have no idea what the "yellow triangle" is. I would love to learn this, even if it isn't yellow anymore.
farss wrote on 9/2/2009, 10:28 PM
"I have no idea what the "yellow triangle" is. I would love to learn this, even if it isn't yellow anymore"

In the OnlIne help search for "Applying video effects"

Under that topic look through:

1) Apply video event effects before or after panning or cropping.

2) Apply track video effects before or after track compositing.


If you felt you've got a good understanding of precisely how all that works please tell the rest of us because in practice I'm far from certain I've got a good handle on it.

Graphically I have a chain of effects, the output of one feeds the input of another, I can shuffle the order of those events. I can make them pre or post. The latter is where I get lost.

If I've got a CHAIN of FXs then that chain must all be pre or post logically. What I think happens is all the pre FXs are applied and then pan/crop and then all the post FX. I note that as I switch the pre/post toggle the FX order changes in the chain, I hink all the pre FXs get shuffled to the start of the chain.

To further muddy the waters the pre/post toggle also changes if the FX is applied before or after project scaling e.g. when rendering from HD to SD. The importance of getting certain FXs applied at the correct point in that process is significant.


Seeing as how SCS now have a YouTube channel I'd love to see an indepth tutorial on all of this. To be honest at times I find After Effects simpler to fathom than Vegas. I suspect the problem arises because how this works in Vegas was set in stone before the ability to nest was added. If you ignore all of this in Vegas and use nested sequences / projects it all at first looks complex but is ultimately simpler to comprehend as everything is done at the project / sequence settings.

Bob.

Marco. wrote on 9/2/2009, 11:36 PM
One example:

Put a Media Generator on track one - a Color Gradient. Apply Color Corrector Secondary as Track FX on it and totally desaturate the red color to gray.
Now apply Pan/Crop to the Gradient Event, use the Mask tool and cut out a section so that you still can see the desaturated part of the Event.

On a second, lower track put another Media Generator - Red as Solid Color.

You can now see the Mask with the desaturated part lying over a red background.

Open the Track FX of the upper track and toggle the Color Corrector Secondary FX using the triangle.

Once toggled to work AFTER the composition Color Corrector Secondary not only desaturates the red of the Gradient Event of the upper track but also the red background of the lower track because that red background belongs to the Mask composition.

---------

There are smart modifications possible using FX toggling inside a composition, for example you can use it to control how blured edges of Cookie Cutter behaves.

---------

Now if you have not only one but several FX applied and - for example - you toggle the first FX only, it must be placed away from its first place down to the last place inside the FX Chain. It can't work on the whole composition if it's applied as first FX. Vegas automates the FX priority inside the FX chain when toggling is used.

Marco
altarvic wrote on 9/2/2009, 11:49 PM
Look at the "Signal Flow Diagram" topic in the Vegas's Help