Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd December 2007, 08:15   #1  |  Link
medp7060
Registered User
 
Join Date: Jan 2005
Posts: 158
Help to improve quality aftetr deinterlaced

I have a interlaced MPEG-2 clips (720x576, 4:3, top field first) recorded by Sony Video Camera and I want to convert it to Xvid (704x528) using a script like this:

Code:
Mpeg2Source("sony.d2v")# at 720x576
#The option that surprided me
AssumeTFF().SeparateFields().selectodd

#or (The option that surprided me)
#AssumeTFF().SeparateFields().selecteven

#or (The one I used to use)
#AssumeTFF().FieldDeinterlace()

BicubicResize(704,528)
here is what I got (croped Frame 40 for each option above):


My question is why I got better picture when I separated the fields and discarded half of them compared with the one with FieldDeinterlace()?

Last edited by medp7060; 3rd December 2007 at 08:24.
medp7060 is offline   Reply With Quote
Old 3rd December 2007, 08:17   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by medp7060 View Post
My question is why I got better picture when I separated the fields and discarded half of them compared with the one with FieldDeinterlace()?
Because you didn't read the FAQ that comes with Decomb!

Try this:

FieldDeinterlace(blend=false)
Guest is offline   Reply With Quote
Old 3rd December 2007, 09:10   #3  |  Link
medp7060
Registered User
 
Join Date: Jan 2005
Posts: 158
Thanks, neuron2. I see.

Quote:
blend (true/false) will indicate whether interlaced frames will be blended (smoother image and better motion but slight ghosting) or interpolated (sharper, but a little jumpier). The default is blend=true and normally gives better results.
Acually I did, but I believed that "The default is blend=true and normally gives better results". that was why I always use the default. I happened to find this when I was trying to see what SeparateFields() does then restore the frame rate by selecting even/odd frame.

blend (true/false) will indicate whether interlaced frames will be blended (smoother image and better motion but slight ghosting) or interpolated (sharper, but a little jumpier). The default is blend=true and normally gives better results.[/QUOTE]

So the default is not good in this case.
medp7060 is offline   Reply With Quote
Old 3rd December 2007, 09:18   #4  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
If you want better quality, use a better deinterlacer.

Fast: Yadif()
Slow: MVBob()
Insanely slow: MCBob()

(all require external plugin(s))
Dark Shikari is offline   Reply With Quote
Old 3rd December 2007, 10:05   #5  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Another option for deinterlacing would be TDeint+TMM+NNEDI, which probably would be in a similar league to MVBob regarding speed and quality.
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 3rd December 2007, 10:32   #6  |  Link
medp7060
Registered User
 
Join Date: Jan 2005
Posts: 158
It seems there are better options. however, decomb is the easist one for me.

I am learning MCbob now. Unfortunately this link is dead:
Code:
http://home.arcor.de/dhanselmann/_stuff/MCBob_v03c.avs
But why they are better? If I just want the clip deinterlaced to avoid combing?

Edited: I found the avs, but I got an error: no function named "MT_LUT", although I have loaded all the plugins required:

Code:
Import("MCBob v0.3.avs")
LoadPlugin("EEDI2.dll")
LoadPlugin("medianblur.dll")
LoadPlugin("mvtools.dll")
LoadPlugin("ReduceFlickerSSE2.dll")
LoadPlugin("MaskTools.dll")
LoadPlugin("RemoveGrainSSE2.dll")

MCBob().SelectEven() # Does it lose half resolution?

Last edited by medp7060; 3rd December 2007 at 11:08.
medp7060 is offline   Reply With Quote
Old 3rd December 2007, 12:55   #7  |  Link
ajk
Registered User
 
Join Date: Jan 2006
Location: Finland
Posts: 134
Quote:
But why they are better? If I just want the clip deinterlaced to avoid combing?
They simply involve a more complicated process that better squeezes out all the detail, at the cost of CPU power. But you could try a faster filter than mv/mcbob at first, like yadif() as was already suggested. Usually it does a good job and is at least close to real time. You can find the plugin here.
ajk is offline   Reply With Quote
Old 3rd December 2007, 18:07   #8  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
The reason getting rid of interlacing is "hard" is because of the temporal issue:

Normal video (frames), at 30 FPS:

F_F_F_F_F_F_F_F_F_F_F

Each character is 1/60th of a second; each frame is taken at a 1/30th of a second interval.

Interlaced video:

FFFFFFFFFFFFFFFFFFFF

Each field is taken at a 1/60th second interval--so every other field won't match up with a corresponding frame.

Common approaches include simple concepts like blending, to extremely complicated methods like motion compensation. Others simply toss out some of the information; get every other field and resize it, for example.
Dark Shikari is offline   Reply With Quote
Old 3rd December 2007, 23:59   #9  |  Link
medp7060
Registered User
 
Join Date: Jan 2005
Posts: 158
So having a photo-quality like frame does not necessarily meant a good quality of a video clip.

the theory sounds too complete for me. Please advise on this:

1) does FieldDeinterlace() discard half field of each frame?
2) I tried MCBob().SelectEven(), which meant that I lose half of the frame (the odd filed), e.g. from 576 to 288. then how MCBob() or yadif() secure a better quality if half information have to throw away in order to keep the original frame rate (25 fps)?
medp7060 is offline   Reply With Quote
Old 4th December 2007, 00:20   #10  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
FieldDeinterlace() uses a heuristic to determine where in the frame combing occurs. For those areas only of the picture, interpolation is used to throw away one field's data and recreate the missing data from the retained field. So, static or barely changing areas are not affected. That is the basic idea of all the adaptive deinterlacers -- change only the areas of the picture that are combed.

There are various heuristics for deciding which areas are combed. There are also various ways of recreating the data. The better ways take more processing and thus time. FieldDeinterlace() was designed to be simple and fast, because it was intended as a postprocessor to catch rare combed frames after IVTC. For real interlaced content, one would probably choose a better, but slower, filter.

Motion compensation takes things to another level entirely. I'll leave it to you to read up on that as it is quite involved to describe.

Last edited by Guest; 4th December 2007 at 00:23.
Guest is offline   Reply With Quote
Old 4th December 2007, 00:36   #11  |  Link
medp7060
Registered User
 
Join Date: Jan 2005
Posts: 158
So I was not correct in the sense that FieldDeinterlace() keeps the info from both top and bottom filed of a real interlaced source. In another word, it still "throws away" half of the frame and fills-in the missing data in order to decomb it.

therefore, for a real interlaced content, it is impossible to decomb without throwing-away half of the frame (selecteven/odd). that where MCBob or similar comes from? Am I right?
medp7060 is offline   Reply With Quote
Old 4th December 2007, 01:20   #12  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by medp7060 View Post
therefore, for a real interlaced content, it is impossible to decomb without throwing-away half of the frame (selecteven/odd). that where MCBob or similar comes from? Am I right?
No. The point of MCBob and similar is to use the extra information to create a frame with no combing, but without throwing out any information. Thus, it retains the maximum detail, since you're throwing out the least information.

Yadif() and similar are much more practical than MCBob in most cases, simply due to raw speed.
Dark Shikari is offline   Reply With Quote
Old 4th December 2007, 04:43   #13  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by medp7060 View Post
So I was not correct in the sense that FieldDeinterlace() keeps the info from both top and bottom filed of a real interlaced source. In another word, it still "throws away" half of the frame and fills-in the missing data in order to decomb it.
You didn't listen carefully. In a typical interlaced frame, the motion is confined to a subset of the whole frame, e.g., a car moving across a background. The background is static and will keep the information from both fields. The moving car, however, gets interpolated. Thus it is incorrect to say that half the frame is thrown away. And as our perception of resolution is less acute for moving things, the idea works out nicely.

Be aware that motion compensation works only for simple translation. But combing can be caused by other things, such as covering/uncovering, zooming, fades, rotations, bad edits, pulldown, etc. So even motion compensated deinterlacing needs a postprocessing phase that is similar to FieldDeinterlace(). The hope is that at least some of the information that would otherwise be lost can be retained.

Last edited by Guest; 4th December 2007 at 04:47.
Guest is offline   Reply With Quote
Old 4th December 2007, 09:05   #14  |  Link
medp7060
Registered User
 
Join Date: Jan 2005
Posts: 158
The truth is that I have been using FieldDeinterlace() to convert my MPEG-2 capture from VHS for a long time. The results, either as Xvid or as DVD, look not bad at all. the reason was that I did (do) not know enough theory about how it works. Although there are many other ways to deinterlace my source, I have not tried yet. I am just trying MCbob() and the speed is very slow and I cannot see any difference compared with FieldDeinterlace(blend=false) in terms of each frame.

I would say FieldDeinterlace(blend=false) only makes the individual frame look better (sharper), when played to TV or computer screen, FieldDeinterlace() and FieldDeinterlace(blend=false) look almost the same to my eyes.
medp7060 is offline   Reply With Quote
Old 4th December 2007, 10:18   #15  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Well, the whole point of these procedures and the plethora of option is to find whatever pleases you the most and is more convenient to you.
With that in mind, if you wanted simple, fast and good results, Yadif could have been a good option as it seems to be the default recommendation here for fast and good deinterlacing.
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 4th December 2007, 11:08   #16  |  Link
medp7060
Registered User
 
Join Date: Jan 2005
Posts: 158
You are right, Chainmax. I just finish reading all the six pages from here http://forum.doom9.org/showthread.php?t=124284. I tested Yadif(). It is as fast as FieldDeinterlace(). It has been widely suggested. I have no say at the moment, will see if I can make it my first choice for my real interlaced source.
Code:
Mpeg2Source("sony.d2v")
Yadif (order=1)
medp7060 is offline   Reply With Quote
Old 4th December 2007, 18:22   #17  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
I'd go so far as to say that despite rule 12, Yadif is the best avisynth deinterlacer to start off with all the time. It's about as fast and ranges from at least as good to better than all the other fast ones, plus it works much better than mv/mcbob on messed up sources. Going straight to mcbob is very, very much not recommended in all cases because of strong artifacting.

If you can't recognize a deinterlacer's failings, there were some threads with close-up comparisons, but it really just doesn't matter what you use. Plus I have no idea how you're comparing, but you do need to compare a whole clip at a time, not just one frame.
foxyshadis is offline   Reply With Quote
Old 4th December 2007, 19:04   #18  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
yadif itself is pretty fast and stable for general usage.
But tdeint with tmm and nnedi delivers MUCH better quality,
cause it has even more less motion artifacts and a much better interpolation due to nnedi.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 5th December 2007, 04:36   #19  |  Link
medp7060
Registered User
 
Join Date: Jan 2005
Posts: 158
Practically it is not possible to do an eaxct comaprison among the filters around. When pushed to high ends, all look similar. For me, a simple FieldDeinterlace() already works. Now most people recommand Yadif or Yadifmod. The speed and quality are very good for general use.

TDeint+TMM+NNEDI was also mentioned by Chainmax. I have seached and failed to find any good guides on them.

(Edited: The following is NOT TRUE as point out by Didée below)

By the way, the documentation in MCBob.avs says it is not for real interlaced materials!

Last edited by medp7060; 5th December 2007 at 09:12.
medp7060 is offline   Reply With Quote
Old 5th December 2007, 05:06   #20  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
Quote:
Originally Posted by foxyshadis View Post
Going straight to mcbob is very, very much not recommended in all cases because of strong artifacting.
Is this a bug report? (Could be the english area of my brain is asleep, but it sounds like "MCBob = produces always strong artefacts => never use it")


Quote:
Originally Posted by medp7060 View Post
By the way, the documentation in MCBob.avs says it is not for real interlaced materials!
Where did you get THAT from? MCBob is ONLY for "real" interlaced sources! (opposed to telecine, fieldshift, blendedfields, or whatelse)
The versions of MCBob that were put online by me do not contain any such comment. For versions not published by me, I'm not liable.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.