Log in

View Full Version : What is Post/Pre-processing? A few more questions inside...


n0an
14th November 2009, 13:19
Hello,

I have a few questions which Google didn't answer:

1. What is post/pre-processing? How does it help in encoding?

2. How to use Adaptive Deinterlacing and Motion compensation methods? I read about it here (http://www.tv-cards.com/messageboard/viewtopic.php?id=14899), but doesn't really explain it.


#AssumeTFF().Bob().Srestore(frate=23.976) # Try 1
#Yadif(order=1, mode=1).SelectOdd() # Try 2

I am not good with de-interlacing, so please explain in detail :thanks:.

3. How to remove brightness and motion interlacing artifacts?

http://i36.tinypic.com/jl5hg5.png
Will this be better with motion compensation de-interlacing?


Will ask a few more soon :).

Thanks!

thewebchat
15th November 2009, 17:54
Well, aside from the fact that the post you quoted is drawing from 100fps.com, which is outdated and generally wrong, here are some answers that you could have quickly found on Google or the forum search:

1)
Preprocessing: Anything you do before you encode.
Postprocessing: Anything you do after you encode.

2)
Some motion-adaptive deinterlacers:
SmartBob
TDeint
Yadif/Yadifmod

Some motion-compensated deinterlacers:
MCBob
MVBob
TempGaussMC
TomsMoComp

3) There are no artifacts on that image. It will certainly not look better after deinterlacing.

n0an
16th November 2009, 03:23
Oh really? I ended up using EEDI2(field=2) and it did a better job than Yadif in terms of those bright lines. EEDI2 wasn't a better choice really as it restored at 25.000 and field ghosting. One the other had, Yadif had those bright lines, but at 23.976 there were no real artifacts. Do you know if EEDI2() can restore to 23.976? Or any other Yadif alternative for that matter.

thewebchat
16th November 2009, 05:35
What the hell are you talking about? Your screenshot is not interlaced (unless there's some secret picture you're not sharing), therefore you shouldn't deinterlace it. Also, I see no "bright lines," or any other kind of artifact for that matter, in your screenshot.

As for your other question, EEDI2 does not create "field ghosting." It does no such thing. It only resizes fields 2x in the vertical direction (blind deinterlacing). All deinterlacers have only two possible modes: half-rate and full-rate. They can only output framerates that are either the same or double that of the original "frame" rate. For PAL, this means that deinterlacers can only operate in 25 fps or 50 fps. For NTSC, the rates are 30 fps and 60 fps. No deinterlacer will return 23.976 fps (unless you use it on 11.988 or 23.976 fps content).

Guest
16th November 2009, 05:40
@n0an

To avoid possible confusion and ambiguity, please post a link to an unprocessed source stream sample.

n0an
16th November 2009, 09:19
Ok, I understand the concept now. Oh my bad again; I am talking about de-interlacing artifacts, and I also confused between screens from Yadif and EEDI2(). Yadif produced this in some frames:



EEDI2() does better:

(color correction done in the lower one)

Here's the sample VOB. What will be the best way to deal with it?

http://www.sendspace.com/file/j3vrsj

One more thing, besides analyzing with meGUI, what's the best way to know the type of de-interlacing a video requires?

osgZach
16th November 2009, 17:47
I try not to rely on analysis utilities too much.. Some people swear by MeGUI some swear it off, I'd just rather not trust them if it can be helped.

Good old fashioned frame stepping is the best way to tell what needs to be done. I don't have a lot of experience with that though. I just go look for a guide that explains different patterns and how to identify them.

Like a 3:2 pattern (telecine). If I recall its supposed to be 3 Progressive frames followed by 2 interlaced frames, and ideally the pattern will repeat throughout the file. So its easy to pick up when looking at 5 frame sections at a time.

There are other patterns out there too, and sometimes its just hard to even identify one if you don't know what you're looking for. Some videos I'm currently working with are really whack and have no pattern that I can personally Identify in a lot of them.

I think its one of those things you just have to learn as you go. But folks here are pretty helpful so if you ever get stuck, just upload a 30 second clip and someone will likely be able to help you figure out what needs to be done with it.

Of course you can also experiment too if that's your thing. Just pick a short section to encode and experiment with different filters and settings. See what comes out best.

Experience is gonna be the best teacher here.

thewebchat
17th November 2009, 02:48
Just look at it using SeparateFields(). In your case, you can see the clear presence of field-level blending. The correct approach is to use SRestore on a bobbed clip.

n0an
17th November 2009, 02:53
osgZach: Yea, I am experimenting with various DVDs and filters.

thewebchat: It is TFF, so Yadif with Srestore should do, but then it creates those bright horizontal lines in some scenes. How to tackle that?

thewebchat
17th November 2009, 03:24
The horizontal lines are present in the individual fields. Heaven only knows why they are there. You see them after SRestore, because sometimes it fails to identify which frames are blended and produces an incorrect decimation. Further, SRestore is guaranteed to give you incorrect results unless you access the video linearly, i.e. you go strictly from one frame to the next. I can not give you any information about your screenshot from earlier, because I was unable to locate any similar scene in your sample.

http://img198.imageshack.us/img198/5209/artifacts.png

n0an
17th November 2009, 03:42
So is there a possible solution for that or is it an authoring fault? I will try out other bobbers and report back.

osgZach
17th November 2009, 16:20
Your second (the color corrected one) example looks pretty passable tbh.

A good but extremely slow bobber would be mcBob. It gives pretty good results.

I was given a piece of code that worked pretty nicely a few days ago, so you might want to try it and see, or at least use it as a basis for swapping out different bobbers/deinterlacers


EDI=NNEDI2(Field=-2)
YadifMod(EDeint=EDI, Mode=1)
SRestore(FRate=23.976)


Obviously this was given to me for my specific case, but its something to build a solution off of, I bet. Just replace the deinterlacer on line 1 (be sure to keep the EDI= part), and try out whatever you want.

Didée
18th November 2009, 13:09
A good but extremely slow bobber would be mcBob. It gives pretty good results.
How many times again? Do not use MCBob on fieldblended sources. It's just an extremly slow way to get a bad result. Or at least suboptimal.

If it were possible to detect fieldblending programatically, I would make MCBob refuse to work on such input. :rolleyes:

osgZach
18th November 2009, 16:10
He mentioned he was gonna try some bobbers, so I told him what I thought was the best one to use.

I never claimed to have analyzed his source, or that mcBob would work on his source. That's why I gave him the code snippet to try as well, and told try different deinterlacers if he wants to experiment. It's one of the best ways to learn without constantly bugging people for easy answers.

"His source is fieldblended, mcBob won't work on that and the result will be junk. Please don't use bobbers on fieldblended sources. See this FAQ (if applicable) " will result in a lot more ingratiated new folks than the "ugh, n00bz AGAIN!", kind of comments - Much less in a forum for Newbies.

Some of us just don't have time to read a zillion threads and stickies with tens of pages. So be a little gentler if you have to scold or correct someone. You'll find they're much more appreciative.

And I do appreciate that advice, because I did not know that.

n0an
18th November 2009, 23:30
Thanks Didee for the correction, but don't scold Osg for it. I mentioned bobbing in my previous post. So, if a source has fieldblending do I use a Fieldblending removal filter like DeBlend() or UnBlend()?

@osg: When I use the following:
EDI=NNEDI2(Field=1)
YadifMod(EDeint=EDI, Mode=1)
SRestore(FRate=23.976)

It highlights "YadifMod(EDeint=EDI, Mode=1)" and prompts, "edeint clip's number of frames doesn't match".

If I put it this way:

EDI=NNEDI2(Field=1).Yadifmod(mode=1, order=1).Srestore(frate=23.976)

It prompts, "arg 0 and 4 must be clips". What does that mean?

Gavino
19th November 2009, 10:04
When I use the following:
EDI=NNEDI2(Field=1)
YadifMod(EDeint=EDI, Mode=1)
SRestore(FRate=23.976)
It highlights "YadifMod(EDeint=EDI, Mode=1)" and prompts, "edeint clip's number of frames doesn't match".
You need to use NNEDI2(field=-2), which is what osgZach actually posted.
If I put it this way:
EDI=NNEDI2(Field=1).Yadifmod(mode=1, order=1).Srestore(frate=23.976)
It prompts, "arg 0 and 4 must be clips". What does that mean?
I can only assume this message comes from a later line, as there's nothing here that would produce it. However, this line makes no sense as it is applying Yadifmod to the result of nnedi2, rather than to the source clip.

osgZach
19th November 2009, 15:59
Not to misrepresent my actual knowledge either, I've only got it to work in that combination with the "=-2" flag, which IIRC tells it to deffer to Avisynth for the field order.

I tried fussing around with it like you did to, to try and get a current project video to work, and got the same error - although I don't understand why its producing that, based on the documenting of what the various flags do.

I have no idea about the second line, as I'm not experienced with using that particular command structure

n0an
19th November 2009, 17:22
Okay, so that script works great on this video, Osg. It's a nice piece of code worth saving ;). Can you point me to the latest documentation of Yadifmod? I cannot find it via. Google.

Thanks!

osgZach
19th November 2009, 19:16
http://bengal.missouri.edu/~kes25c/

I think the most current version is linked on that page. Documentation is in the zip

Gavino
19th November 2009, 19:25
Not to misrepresent my actual knowledge either, I've only got it to work in that combination with the "=-2" flag, which IIRC tells it to deffer to Avisynth for the field order.
The important thing is that the operation mode (same/double rate, field order) of nnedi2 must match that of yadifmod. With SRestore, double rate (bob) is required so the possibilities, depending on field order are:
Order NNEDI Yadifmod(mode=1)
TFF: field=3 order=1
BFF: field=2 order=0
from Avisynth: field=-2 order=-1 (default)

osgZach
19th November 2009, 23:39
Thanks for that Gavino, that's definitely a lot more clear than what I was able to distill from the docs.

I shall try to put those combos to use and see, currently waiting for what others have to say about my source (See AnimeIVTC thread), as I have totally confused myself by multiple attempts ad identifying the field order, plus any patterns in the source...heh