Log in

View Full Version : Interlacing from hell


Comatose
7th April 2008, 16:29
I have no idea how to handle this thing. Everything I've used so far fails (horribly).

Examples (post deinterlacing - the second screen is the frame after the first)
http://xs126.xs.to/xs126/08151/evil1360.jpg
http://xs126.xs.to/xs126/08151/evil2821.jpg

Interp = nnedi(field=-1)
deint = TDeint(mode=0,order=-1,type=1,AP=55,edeint=interp,slow=2)
tfm(d2v=d2v,clip2=deint,order=-1,Mode=5, slow=2).TDecimate(mode=1, denoise=true)
Default settings (just TFM()) doesn't work. yadifmod as a deinterlacer doesn't work.

I uploaded a 11MB sample - it's not from the same scene as the two screens, but this kind of thing happens all over the video.
http://www.mediafire.com/?9lya4cygyim
Don't stop at the start of the sample... there are other evil beings lurking past the start =[


Any help will be greatly appreciated (even if you just point me in the right direction) :)

DarkT
7th April 2008, 16:49
reducing the MI and the Cthresh parameters somewhat helped, though not everywhere... /me guesses manual overrides would do a much better job... But from what I tried it didn't go so well in every instance, anyway, here's the line I used with some improvement:

Interp = nnedi(field=-1)
deint = TDeint(mode=0,Order=-1,field=-1,type=1,AP=55,APType=2,edeint=interp,slow=2,emask=TMM(mode=0,order=-1,field=-1))
tfm(d2v=d2vpath,clip2=deint,order=-1,Mode=5, pp=7, field=-1, slow=2,cthresh=3,MI=50).TDecimate(mode=1, denoise=true)

Comatose
7th April 2008, 16:55
Manual overrides aren't really an option since this happens all over the episode and it'll take me years to do overrides for 34k frames :/

Anyway, I'll play with this :p Thanks :D

Comatose
7th April 2008, 20:16
Well, yours was horrible (for the screenshots at the top, at least). It made huge, ugly aliasing.

I got it looking half decent by switching TFM with Telecide, since TFM didn't want to cooperate no matter what settings I used.

Telecide, most of the time, looks better. The problem is that every so often TFM will do better. (by the way, both aren't 100% good)

I don't know what to do to make this better >.>
I tried playing with Telecide settings on problematic frames, but setting the thresholds to both lowest and highest had no change at all.

Here are two examples, one where Telecide does much better, and one where TFM does much better.

The scene where telecide does better: (this scene in m2v (http://www.mediafire.com/?gjgjztotkdm))
Telecide (http://xs226.xs.to/xs226/08151/thedevil-telecide516.jpg)
TFM (http://xs226.xs.to/xs226/08151/thedevil-tfm634.jpg)

The scene where TFM does better (this scene in m2v (http://www.mediafire.com/?9lya4cygyim) (same as the link in the OP)):
Telecide (http://xs226.xs.to/xs226/08151/blah-telecide349.jpg)
TFM (http://xs226.xs.to/xs226/08151/blah-tfm725.jpg)

My current script is this:
orig=last
interp=nnedi()
Telecide(guide=1,post=0,nt=0,hints=true)
#~ TFM(pp=1,mode=5,slow=2)
TDeint(mode=0,type=1,AP=55,APType=2,edeint=interp,slow=2,clip2=orig)
TDecimate(mode=1, denoise=true)
crop(2,0,-4,-2)
lanczosresize(1280,720)
The only thing that changed between the screenshots is Telecide/TFM being (un)commented.

Thank you for any help!

thetoof
7th April 2008, 22:46
I used :

mpeg2source()
tdeint(mode=2)
dfttest(sigma=7,smode=0,sbsize=5,tbsize=5)
dup()

and it removed pretty much everything for the first clip. Still a bit of combing... but it's a LOT better. The denoiser is to help dup and I must admit that the values are totally random... I just thought a denoiser would help the dup and used copy-paste from another script. Feel free to ajust it. Also, you can use another duplicate function and tweak the settings (I didn't spend time on that because it already gave me very good results and I don't have the rest of the clip to test on different scenes, so it'd be a complete waste of time).

Have fun!

Almost forgot: Telecide and TFM are meant for IVTC... but your source doesn't seem to have any kind of pattern, so that's why I used Tdeint (looks like pure video... what does DGIndex tells you?)

Comatose
8th April 2008, 10:03
Indeed, a Japanese capper friend also suggested (after I posted) the following script that is composed of only TDeint and TDecimate.
TDeint(mode=2,order=1,field=1,type=1,mtnmode=3,full=false,chroma=false,tryweave=true,link=1,slow=2)
TDecimate(mode=1,hybrid=0,dupThresh=0.7,blockx=8,blocky=8,chroma=true)
This gave me really good results. There were some scenes that still have leftover deinterlacing artifacts (some of the fields are leftover after a scene change) but they're a LOT less - I can create overrides for these.

DGIndex says Interlaced, but it also said this for stuff that I've done IVTC on before.

I guess the only way to really check is to try IVTC first, and if you're "greeted" by something like this, try pure deinterlacing.

:thanks:

2Bdecided
8th April 2008, 11:21
Thank you for sharing your challenge Comatose!

The problem is that even the individual fields have "interlacing" in them - it looks like someone has taken an interlaced source, and resized it as-is - so you have something like looks like interlacing, but is broken.

It also looks like there's some blending, some parts with movement every few frames, and some parts with movement every single field.

Bizarrely, if you do a pointresize(720,360) you get something with "correct" interlacing that can be deinterlaced in the normal way (bob, or yadif, etc). It's not "correct" though because it ends up blending the content. If you crop it by 1 to make it pick different lines in a non-intelligent way, you can lose some fields completely! If you could pick the correct lines to restore the original interlacing, you wouldn't get either problem. That's a holy grail though! No one has reversed interlaced resizing properly yet AFAIK.

What you want at that point is a deinterlacer which will keep the progressive frames as-is (even when they're field-shifted), but pass through the every-field movement as 60p. I couldn't find that. yadif wasn't bad though - but not good enough.

I doubt you'll want to go down this route because the resolution is so low - but the fact that a point resize down to a height of 360 gives you "working" interlacing is quite bizarre.

Cheers,
David.

[P]ako
8th April 2008, 16:46
...a Japanese capper friend...

I find the thread interesting, but, and there is no polite way to say this, given the source, it smells like a rule #6 violation.

Comatose
8th April 2008, 18:45
Just because I have a Japanese friend who is also a capper doesn't mean I didn't obtain my source legitimately.

You could say the same for threads concerning DVDs since if you try hard enough, you can find ISOs online.
Just because it could happen doesn't mean you need to assault my thread going all "OMG!! THIS PERSON COULD HAVE DOWNLOADED THIS!!11 LOCK THIS THREAD NOW!!"

It's generally accepted that having a raw source is proof enough.

It's reasonable to say this sort of thing in threads concerning deinterlaced material, but posting this here is just being annoying.

edit: I could've sworn I replied to you, 2Bdecided, but it seems my post is gone... in any case, since this is anime and they're shooting on twos, I could fix the interlacing artifacts on the first frame of a new scene with FreezeFrame, since the first two frames were identical.

In fast action scenes they weren't identical (shooting on ones) but luckily the artifacts are not noticeable when everything moves quickly.

[P]ako
8th April 2008, 21:52
True. I cannot say whether you are in Japan, where you can get a transport stream of that series. The video is of a new series titled "Special A", its broadcasting has started in Japan about two days ago and as far as I know, you cannot get your hands on a TS source outside Japan if it weren't for P2P networks. That's why I said "it smells like a rule #6 violation."

sh0dan
9th April 2008, 07:53
@[P]ako: Don't hijack/derail the thread with your assumptions. If you have a problem, there is a "Report Post" button, and leave the moderation to the administrators.

smok3
9th April 2008, 08:35
it seems like blowup to me, downscaling to 704x400 (lanczos3) seems good enough, before/(or after maybe?) you would have to do some sort of ivtc.

[P]ako
9th April 2008, 16:19
@[P]ako: Don't hijack/derail the thread with your assumptions. If you have a problem, there is a "Report Post" button, and leave the moderation to the administrators.

I apologize for the trolling. I will report the post next time.

Comatose
14th April 2008, 15:59
I'm back. This time (episode 2!), they didn't mess up, but there's blech aliasing at some spots (in the source).

The thing is that these frames are usually followed by an identical frame minus the crappy stuff. Is there a way to make TFM or some other filter autodetect this and use the good frame?

I'd really hate to have to manually create an overrides file or freezeframe the deinterlaced frames.

Deinterlaced frames:
19136 (bad) (http://xs226.xs.to/xs226/08161/bad289.jpg)
19137 (good) (http://xs226.xs.to/xs226/08161/good747.jpg)

The two interlaced frames are nearly identical, so I don't know if TFM/TDeint actually did anything.

I assume this is combing, so I tried to play with the relevant settings in TFM, namely cthreshold, blockx, blocky and MI (and also scthreshold, since this only happens after drastic changes in the image), but I didn't achieve anything.

Simply deinterlacing (using the script suggested by the Japanese capper) is significantly better, but the artifacts are still there.

The script I (tried) using is the same as the one in OP, as I've had no success tweaking it.

Also, I'm not 100% sure whether they messed up again or not, but it's definitely better. I can't figure out how to find one of the fields of the frame I was currently viewing =/

I'll be very grateful for help :)

2Bdecided
14th April 2008, 16:10
Can't you capture the SD version? It does look obviously upscaled, and that's probably where all the problems were added.

Cheers,
David.

Comatose
14th April 2008, 16:34
Japan has moved to digital TV, so everything is broadcasted as 1440*1080 20Mbps MPEG-2 with AAC audio.

It's upscaled, yes, but most upscaled anime don't have this kind of problems. With most of them, it "just works".

This one is problematic, but isn't there some way to get TFM to use one of the fields from the next frame (there's probably a pattern) when it detects something like this? (is there even a way to detect this?)

thetoof
14th April 2008, 19:51
isn't there some way to get TFM to use one of the fields from the next frame (there's probably a pattern) when it detects something like this? (is there even a way to detect this?)

I talked about what I used in this post:
mpeg2source()
tdeint(mode=2)
dfttest(sigma=7,smode=0,sbsize=5,tbsize=5)
dup()

It removed pretty much everything for the first clip. Still a bit of combing... but it's a LOT better. The denoiser is to help dup and I must admit that the values are totally random... I just thought a denoiser would help the dup and used copy-paste from another script. Feel free to ajust it. Also, you can use another duplicate function and tweak the settings (I didn't spend time on that because it already gave me very good results and I don't have the rest of the clip to test on different scenes, so it'd be a complete waste of time).

The dup() or dupped() function does an automatic freeze frames on the duplicates, so it helps removing the badly deinterlaced. It's not perfect, but it's still very good.

Comatose
15th April 2008, 11:33
What scared me in that snippet is dfttest with that huge sigma of doom.

Also, I did try dup on another anime (namely Nabari no Ou), and while it did remove the duplicates, it also duplicated frames which had very small motion, such as a character shaking on the floor.

Lowering the % difference needed made it too sensitive to noise, though.

If only there was a way to feed it a denoised clip on which it would do the checks... *hint neuron2 hint*

Also, I don't think that Dup will help in this case, as the aliasing is quite prominent and that frame won't be detected as a dupe.
I guess my only hope is to try and tweak Dup to detect the minor, post scene change ghosting and freezeframe the bad stuff manually.

Terka
15th April 2008, 14:56
have you tried mvbobmod as deinterlacer?

foxyshadis
15th April 2008, 19:06
Also try vinverse as a way of calming the worst combing before further processing.

martino
16th April 2008, 15:36
Japan has moved to digital TV, so everything is broadcasted as 1440*1080 20Mbps MPEG-2 with AAC audio.
They do 480i broadcast too FYI, and there are quite many of those too.

It's upscaled, yes, but most upscaled anime don't have this kind of problems. With most of them, it "just works".
You probably need to see more transport streams (NOT encoded raws) first before making a general announcement like this.

Sorry for being off-topic but personally I found those two statements to be technically incorrect.

thehug
18th April 2008, 11:43
I might be wrong, but with that episode 1 clip, it kinda looks like they've taken an interlaced (top field first) SD source and upscaled it without deinterlacing first.

Then they've applied a telecine to take the frame rate from 24 to 29fps, but the interlacing applied on the telecine is bottom field first.

thehug
18th April 2008, 12:25
that may be completely wrong though :)
just seems weird, once you scale it back to 720 x 360 and bob the clip, there's some jumping around that you'd normally get when the field order is wrong... it does this regardless of the field order settings though.

i've got a load of Sailor Moon DVDs that have similar interlacing issues as this.