Log in

View Full Version : Filter for removing fieldshifted blendings


mbcd
27th August 2011, 12:23
Hello,

I am not a profi in deinterlacing, so I need some help. I figured out that I have following problem.

After bobbing a Progressive/Deinterlaced 25i to 50p I have still some blendings in the deinterlaced pictures.

These blendings have no pattern and occur only in some scenes, not overall.

My problem is the fieldshifting of these blendings. That means:

I have two diffent scenes on the Movie.

Using SelectEven() on 50p gives me correct frames in scene 1, but still blendings in scene 2

Using SelectOdd() on 50p gives me blended frames in scene 1 but correct frames in scene 2.

So I need to switch between SelectEven() and SelectOdd().

So my final question is:
Which filter is able to decimate from 50p to 25p but still using the unblended pictures (SelectOdd / SelectEven).
I do not need anymore deinterlacing, but right decimating which recognizes blendings left behind.

manono
28th August 2011, 07:12
Post a link to an untouched sample, 10 seconds or so with steady movement.
.

mbcd
28th August 2011, 15:24
So, took sometimes with my 2-3KB/s upload over UMTS :(

Its a 17mb Package.
Sample is 30 frames long with good motion and depends on jpegs.

Thats because it is an very old capture with one of the first digital recorders that were developed and the recordings were saved as single-jpeg-files. The quality is very good for that, but I dont get rid of those blendings in there.

Script "original" is the original 25fps capture.
Script "deinterlaced" is my "repaired" goal, but still with these blendings. Playing that gives an unwanted "slowmotion"-Effect.

If you use "ViewFields" on the original source you will see that you get with this scene a clean picture in the bottonfield. Other scenes have the clean picture in the topfield, so it changes from scene to scene.

As I said, the records have a mix of Progressive, Interlaced and Interlaced with blendings.

It would befine to get a solution with my deinterlaced material, because of the quality of deinterlacing. Please respect that :thanks:
If you look at the deinterlaced source you will mention that you have one clean frame and one blended (if there is no scenechange in there). For me it would be enough to find out if a frame has blendings in it. If it has it would be the best to look is there is exactly the same frame without blendings (one frame forward and one frame backward would be enough). And then replace the blended frame with the nonblended.

That would be fine for my solution ...

Meanwhile Ive tried out 2 days on that problem, but I dont get an acceptable result. I hope someone could help me out. I dont think that its impossible to do in an quick / short way, but as I said, Im not an Avisynth-Profi an a look into the scriptlanguage of Avisynth was enough to know that I will not learn it in less than a hole month :stupid:

The link to the 17MB source:
http://www.sendspace.com/file/x7dsay

Didée
28th August 2011, 15:52
Seems like a "standard" case of fieldblended NTSC->PAL normconversion.

LoadPlugin("mt_masktools-25.dll")

Import("Srestore.avsi")

ImageSource("your\path\to\fsb%02d.jpeg", 0, 29, 25.000)

assumetff()
converttoyv12(interlaced=true)

bob(0,0.5)
Srestore(frate=23.976,speed=-1)

mbcd
28th August 2011, 21:10
:goodpost: Yes, it seems so, but only on this some few parts.

I got now realy good results, but there ist still one Problem:

srestore of cause damages the pure progressive frames. That means it puts dubs in or deletes frames sereval times, and that is wrong, because the video is mostly pure 25p and the progressive parts dont have any conversions, only the interlaced parts can have blends sometimes. With srestore the film begins to stuck very often.


My idea was to check if the actual frame is interlaced or not. If the actual frame is interlaces use a frame from srestore, otherwise not.

That maybe not the fine way, but I think it will give less dropped or doubled frames. I`ve tried different settings on srestore, but I only get more damages than without it.

Is there another way to handle those ? Maybee with a second clip for analysing?

Didée
28th August 2011, 21:36
Ah, then you're probably dealing with a "DEFT" conversion (basically an on-the-fly IVTC, and when the conversion box is unsure that the fields can be weaved, it falls back to fieldblended conversion). I have no experience with those. Normal fieldblended conversions I've seen plenty enough, DEFTs only one or two, and that was long long time ago.
... though I remember that years ago, scharfis_brain and MOmonster (creator of Srestore) did some braincracking about DEFT processing.

I'm not even sure if, in case of DEFT, the fieldblended sections are based on 23.976 or on 25fps. (You sample is a little too short to make sure, either.)


Maybe yo ucan get away with something like this, give it a try:

tdeint(mode=1,tryweave=true)
Srestore(frate=25.000,speed=-1)

_____

Doing things like "reckognizing if a frame is interlaced" are of course possible, but that's not quite as trivial as it sounds - rather a "can of worms". In particular if the fieldblended sections are really based on 23.976 .... how would you mix the 25fps progressive parts with the 24fps blended parts? Problem!

mbcd
28th August 2011, 21:51
I'm not even sure if, in case of DEFT, the fieldblended sections are based on 23.976 or on 25fps. (You sample is a little too short to make sure, either.)

Thanks for the answer Didée.

That is "no" problem, I can upload a longer one, but I think it will take up to 5 Hours if it the internet connection does not fall out several times (damn UMTS).

I will look if I can find 3 scenes with all combinations. As I said (mostly progressive and interlaced, ans only few scenes with interlaced blends (but there only in one field, but field differ from fall to fall).

mbcd
29th August 2011, 00:18
After a lot of search I found this thread here:

http://forum.doom9.org/showthread.php?p=780119#post780119

I tried the "unDEFTmatchermod"-script from MOmonster and it works nearly like a charm. No stuttering and only less artifacts from blending. That result is acceptable.

Only scenechanges are very problematic, they produce 3-4 bad frames, but I think that happens only if the scenechange is inside one single frame, so that those both different halfframes make such problems.

Would be nice if someone maybee could optimize that, because those script could be very helpful.

mbcd
3rd September 2011, 18:44
:mad::scared::(

No it was a fault ... My last post was an mistake, the script made several other errors.

So I tried the last two days to get rid again, but I failed.

I found out that it is possible to get a smooth motion, so there are no frames missing as I think.

Try with these script:
ImageSource("ORIGINAL\FSB%03d.jpeg",00,779,25)
ConvertToYV12()
tfm(order=1, mode=6, pp=7, field=1, slow=2, display=true, cthresh=4, mchroma=true, chroma=true)

Viewing the Fields is much helpful.
Problem here is:
- Sometimes you "only" have to recreate a doubleblended Frame.
- Sometimes you have to take only one Field and deinterlace the opposite Field.

I uploaded more sourcematerial (~140MB with 800 frames):
http://www.sendspace.com/file/mx5c5a


Watch the scene with the stairs:
Take every second picture and you get fullframes with less blendings (but they are very acceptable), The Frame between is doubleblended and has to be recreated.

In the scene with the lady wearing a red jacket:
Take every bf (bottomField) of every Frame and deinterlace it to get a very clen result. But as I said, here it could be that you need in other scenes to take tf (topField) instead of bf for deinterlacing.

I dont have any idea of getting rid of this, and everything I tried ended in dupped or missing frames.
Little artifacts in some frames are no problem, but jumps are "not nice".