View Full Version : Deinterlacing issue, suggestions?
Ikasu
1st March 2008, 17:27
Alright, my situation is a bit complicated. I have around 22 of my dvd's ripped for a editing project. Two anime series (2nd is a sequel), the first is a progressive 29.97 source video. The second is a 29.97 that is teleclined, so I IVTC'ed it down to a smooth 23.97...but of course I need them both to be the same frame rate for editing in premiere, so I really have no choice. I'm making two versions of the second source, one IVTC'ed with assumefps deinterlaced (speeds up clip), and the other just as is 29.97 at the default teleclined 29.97 deinterlaced.
But here's the issue, the first series is flawless 29,97 progressive, the second has issues with deinterlacing. Whatever method I've tried, I end up with a after image with any deinterlacing I try, a faded blue/purple area of a prior frame, here's an example...
Deinterlaced
http://i62.photobucket.com/albums/h113/kamr00z/sig/deinterlaced.jpg
Source
http://i62.photobucket.com/albums/h113/kamr00z/sig/interlaced.jpg
As you can see, it's doing something REALLY funky. I've tried telecide, as well as using Tdeint with various different settings. I'm just not experienced enough when it comes to AVISynth, learning the ropes, but it takes time obviously =P...Any idea's on what settings I should be trying? I'm basically trying to get it just to look flush, or is this the results of deinterlacing?...and will I be always left with this type of effect?...I'm going to upload a small 5 second portion of this clip if anyone wants to give it a go to see if it can be deinterlaced properly, could really use your help =(. Also, to note, using virtual dub to go frame by frame to find this, if you just play this m2v as is, you might not notice the interlacing ...but I really do need to get this resolved if possible.
Here's the demuxed m2v stream from the vob.
http://www.sendspace.com/file/5lo0ez
Looking forward to your responses, this clip doesn't have much deinterlacing to the naked eye, but the entire 2nd series is filled with it, but this was a good way of showing an example =P..Thanks for your time guys.
Comatose
1st March 2008, 17:49
and the other just as is 29.97 at the default teleclined 29.97 deinterlaced.
You have to decimate (try TDecimate()) or else you will get stuff like this.
The telecined frame is a combination of two frames, so when you IVTC and don't decimate (these kind of frames get decimated), you end up with this.
You can either, as you said, assumefps, or just duplicate frames to bring it up to 29.97.
To duplicate frames, you can use changefps(30000,1001) and check to see if it makes the video choppy or something.
There are probably better, higher quality ways to do this (like with MVflowfps[2] (http://avisynth.org.ru/mvtools/mvtools.html)) but I've never had to do anything like this and never tried using MVflowfps, so I wouldn't be able to give you good advice.
Here's to hoping somebody who does have experience with increasing anime fps replies.
Ikasu
1st March 2008, 17:53
Thanks for the response..I forgot to mention that I ran dgindex (which stated my source as film) with forced film for 23.97...The difference between the 29.97 and 23.97 are much smoother in the 23.97 forced film d2v. But the footage is still interlaced even at 23.97...So basically a IVTC'ed footage via dgindex that still has interlacing...The footage is indeed 23.97 native..it's much smoother then leaving the footage at 29.97 which jumps via panning shots, while the 23.97 doesn't.
Any idea's? I'll give you thoughts a go, but I'm not that experienced with avisynth as I said, so it'll be trial and error...Hopefully the info above can help find a solution.
scharfis_brain
1st March 2008, 17:53
@Comatose: you are wrong. The video itself is b0rked.
The Chroma was downsampled to YV12 progressively, thus effectively blending two fields of motion together evertime a Frame is combed.
This could be undone, with some clever pattern matching tricks. But I am to lazy to do it right now.
Ikasu
1st March 2008, 17:55
Scharfis: I had a feeling the video was botched...The original R2 japanese sources are INCREDIBLY clean and crisp. I don't understand why they took the r2 sources and botched them up so much with re-encoding for a domestic release..talk about idiotic in regards to the issues/quality loss. Do you think you could help me out with it once you're not lazy? =P...lol
This issue happens regardless of just running deinterlacing on a honor pulled down d2v avs setup with tdeint, or with a forced film IVTC'ed method, I still have to deinterlace regardless if I IVTC it also..o_O..
Comatose
1st March 2008, 18:07
@Comatose: you are wrong. The video itself is b0rked.
The Chroma was downsampled to YV12 progressively, thus effectively blending two fields of motion together evertime a Frame is combed.
This could be undone, with some clever pattern matching tricks. But I am to lazy to do it right now.
My bad >.> It's just that I've had something that looks exactly like that happen to me because I forgot to decimate.
edit: So wait, it looks this way when you watch it on a DVD player and a TV?
Guest
1st March 2008, 18:30
My bad >.> It's just that I've had something that looks exactly like that happen to me because I forgot to decimate. That's wrong too. Failing to decimate cannot cause blending.
edit: So wait, it looks this way when you watch it on a DVD player and a TV?
If you do SeparateFields and inspect the fields, you'll see that the blending is there in the fields.
Comatose
1st March 2008, 18:43
Okay, you win. me < interlacing
Maybe in a month...
Guest
1st March 2008, 19:02
It's not a matter of winning or losing; that's a juvenile way of looking at things. At Doom9 we are interested in disseminating correct technical analyses and information. That is all.
Ikasu
2nd March 2008, 09:32
Bump....no possible route of fixing this? =(....
Guest
2nd March 2008, 14:22
I can't think of any way to fix that. It's ruined in the source. Just out of curiosity, since I never saw this on a commercial DVD, what DVD did you rip this from?
Leak
2nd March 2008, 14:28
I can't think of any way to fix that. It's ruined in the source. Just out of curiosity, since I never saw this on a commercial DVD, what DVD did you rip this from?
Heh... the US DVD of the first volume of "Ghost In The Shell: Stand Alone Complex" has such color problems at the end of the second episode, where the Major is going after the out-of-control tank in the streets - the CGId tachikomas have their chroma lagging a frame behind their luma... :(
Then again, it's hardly noticeable when you watch it, it's much more visible when you go through it frame by frame...
np: The Orb - The Truth Is... (The Dream)
Ikasu
2nd March 2008, 16:55
I'm making a gundam seed AMV....Using Gundam Seed and Gundam Seed Destiny. Gundam Seed is flatout flawless...I use to have the R2's which were even better...But the domestic release of gundam seed is almost just as good. But for Gundam Seed Destiny..The sources on the domestic dvd is flat out atrocious. Their is massive amounts of grain, and this issue...The entire series is like this. 29.97 interlaced teleclined. If you IVTC, it's still interlaced at 23.97...although the video is smoother cause this is the actual native frame rate...after interlacing, this issue arises....Whether I just deinterlace the 29.97 source or the IVTC'ed source. Talk about whack! =(...Guess I will have to live with it.
Leak
2nd March 2008, 17:31
The entire series is like this. 29.97 interlaced teleclined. If you IVTC, it's still interlaced at 23.97...although the video is smoother cause this is the actual native frame rate...after interlacing, this issue arises....Whether I just deinterlace the 29.97 source or the IVTC'ed source.
I really doubt that, as noone would go as far as animating stuff in fields instead of whole frames.
From looking at your sample, it looks like some dumbnut blended the chroma at the transition between two frames. I guess you could cook up a filter that analyzes whether the chroma of a field is a 50/50 blend between one of the two previous fields with one of the two next fields and if so replace it with the full chroma of one of them by analyzing which accompanying luma field matches better, since the luma isn't blended.
(You'll find that a
Grayscale()
TFM()
TDecimate()
shows no residual combing...)
np: The Orb - Vuja De (The Dream)
Ikasu
2nd March 2008, 17:57
That is pretty interesting Leak...Thanks for the info. But unfortunately I'm no where near experienced enough to follow what you said =P...lol. You think there's any chance you could give me the code for something of that nature? If not it's cool, I don't mean to be a burden..>_<...I really would appreciate it. But once again, if you don't have the time that's totally fine.
20-40
2nd March 2008, 20:05
Same problem as I have with few inputs. I've freaked out with different de-interlacers in/for Avisynth (I believe I tried all what I can find), and after few days, I decided to use old VirtualDub (or VirtualDubMPEG2 directly) deinterlace filter in Blend 2 fields mode.
You can load this filter in Avisynth after ConvertToRGB32() and try it out. //or use VDMPEG-2 as I have//
This is what I get from your clip:
INPUT:
http://free-kr.t-com.hr/zeman/input.jpg
OUTPUT (filtered):
http://free-kr.t-com.hr/zeman/output.jpg
Leak
2nd March 2008, 23:08
Same problem as I have with few inputs. I've freaked out with different de-interlacers in/for Avisynth (I believe I tried all what I can find), and after few days, I decided to use old VirtualDub (or VirtualDubMPEG2 directly) deinterlace filter in Blend 2 fields mode.
Correct me if I'm wrong, but I thought the plan here was to get rid of the chroma blends, not to add extra luma blends into the mix...
np: The Orb - Hell's Kitchen (Bicycles & Tricycles)
Didée
3rd March 2008, 00:13
One thing that could be tried quickly: First do some shame-on-you damage on purpose, then call the fixing tool:
Blur(0,1)
FixBlendIVTC()
Apart from that, the method Leak described in post#14 sounds like the most promising way to a "general" solution.
Jawed
3rd March 2008, 02:45
What about:
conditionalfilter(last,last,last.trim(1,0),"iscombed()", "=", "0")
tdecimate()
It's a shame that the clip is so short and doesn't contain much movement - hard to test. e.g. there's a risk that what I've proposed will produce jerky movement (e.g. in the gait of a character walking).
At the same time I'm assuming (I'm a noob at anime) that there's so many video frames per animation frame that this kind of brutality works.
Jawed
Jawed
3rd March 2008, 02:57
As an afterthought, you can see what's happening with:
a=last
b=conditionalfilter(last,last,last.trim(1,0),"iscombed()", "=", "0",show=false)
stackvertical(a,b)
I've removed tdecimate() to keep things in step.
Jawed
Jawed
3rd March 2008, 03:12
This is another way to produce the same result:
evens=tfm(mode=5,field=1).separatefields().selecteven()
odds=tfm(mode=5,field=0).separatefields().selectodd()
interleave(evens,odds)
weave()
tfm(pp=0)
Well, it's the same for this clip. Strictly speaking, that's not true, as this code produces true duplicate frames instead of near duplicates (consecutive uncombed frames that are nominal duplicates) that the previous code produces.
Movement is different with interleave(odds,evens) instead. Note how the pair of frames 40+41 differs in behaviour from the pair 42+43 and 62+63.
---
Going one step further:
source=last
evens=source.tfm(mode=5,field=1).separatefields().selecteven()
odds=source.tfm(mode=5,field=0).separatefields().selectodd()
normal=interleave(odds,evens).weave().tfm(pp=0)
forwardevens=source.trim(1,0).tfm(mode=5,field=1).separatefields().selecteven()
forwardodds=source.trim(1,0).tfm(mode=5,field=0).separatefields().selectodd()
forward=interleave(forwardodds,forwardevens).weave().tfm(pp=0)
interleave(normal.selectodd(),forward.selecteven())
When I apply tdecimate() to produce 23.976fps video, I don't get pairs of video frames per animation frame, so movement will still look jerky :(
Where I've used tfm(mode=5) I suspect mode=0 will be fine.
Off to bed...
Jawed
Ikasu
3rd March 2008, 09:19
Jawed: The first one worked wonders, the second one actually reproduced the issue to a strong effect. Although, dropping telecide on the first one didn't cause any issues since I am still going to be using Tdeint. On certain segments though, the first one shows jagged lines with extreme movement, and rarely the after image. The second one fixes these jagged edges but reproduces the after image to a stronger effect. Any way I can incorporate the smoothness of the second one into the first?
20-40
3rd March 2008, 09:46
Correct me if I'm wrong, but I thought the plan here was to get rid of the chroma blends, not to add extra luma blends into the mix..
I'am not sure, and I DO NOT get any faded blue/purple area of a prior frame, here's an example...
using the sample OP has provided, using simple script:
MPEG2Source("G:\sample.demuxed.d2v")
#FieldDeinterlace()
Decimate(cycle=5)
doing just decimate within .avs. Deinterlacing has been done as I have described, have not produced ANY artifacts, there were no faded blue or purplish areas, clip WAS decimated at 23.976, and clip WAS de-interlaced. I couldn't ask for more.
This morning, I added plain FieldDeinterlace() in .avs, and, to my surprise, result was absolutely the same - perfect as can be! Same was with
MPEG2Source("G:\sample.demuxed.d2v")
#FieldDeinterlace()
SmoothDeinterlace(tff=true, doublerate=false, blend=true)
Decimate(cycle=5)
I've been able to reproduce such "bad" (the one that OP has presented) behaviour by use of different de-interlacer,
http://free-kr.t-com.hr/zeman/DeinterlaceMAP.jpg
when I got
http://free-kr.t-com.hr/zeman/shifted.jpg
and I think that some deinterlacers both for Avisynth and VD introduce a shift in luma/chroma values. That's why I suggested blend (which I do not use 'cause of blur), and I've said that from experience and with good intentions.
Well, I humbly think that there might be a problem with stubbornness.
Eitherway, I have said what I have.
Jawed
3rd March 2008, 13:34
Jawed: The first one worked wonders, the second one actually reproduced the issue to a strong effect. Although, dropping telecide on the first one didn't cause any issues since I am still going to be using Tdeint. On certain segments though, the first one shows jagged lines with extreme movement, and rarely the after image. The second one fixes these jagged edges but reproduces the after image to a stronger effect. Any way I can incorporate the smoothness of the second one into the first?
I'm not sure, based on what you've written, whether you tried the code I suggested without any other processing. That's how I used it - but it could be just a fluke that it works on the sample clip.
Anyway, I'm sure movement will be jerky, so this type of approach is not a solution.
Jawed
Guest
3rd March 2008, 14:50
I've used Avisynth 2.6 and DVD2AVI 1.77.3dg1.0.0RC2 with DGdecode.dll 1.4.8.0 & MPEG2Dec3dg.dll 1.0.1.0. That adequately demonstrates that you are uninformed.
Your methods are producing blended frames. The problem here is to recover unblended progressive frames without the mentioned artifacts.
I forgot to mention that I ran dgindex (which stated my source as film) with forced film for 23.97
You have to use Honor Pulldown Flags in DGIndex. You *cannot use Force Film* because there are no RFF flags. I did note that a simple Telecide(post=0) applied to the source clip eliminates the artifact shown on the first post. But it could be just a lucky field match for that frame. It's worth trying this on the entire source.
Where did DGIndex state that it is film? I don't see that anywhere.
Ikasu
3rd March 2008, 20:19
That adequately demonstrates that you are uninformed.
Your methods are producing blended frames. The problem here is to recover unblended progressive frames without the mentioned artifacts.
The frames aren't blended. I've made two versions of the 12 dvd's. One with honor pull down and the other forced film. While I saved the first 12 d2v's via honor pull down, it was stating the source was film based on the progress bar. So I finished the 12, and ran an additional process again on the dvd's with forced film. I compared both of them..the honor pull down 29.97 version was jerky on panning shots. The 23.97 forced film version was completely smooth. So the source native frame rate is indeed 23.97
You have to use Honor Pulldown Flags in DGIndex. You *cannot use Force Film* because there are no RFF flags. I did note that a simple Telecide(post=0) applied to the source clip eliminates the artifact shown on the first post. But it could be just a lucky field match for that frame. It's worth trying this on the entire source.
Where did DGIndex state that it is film? I don't see that anywhere.
I used both to make two different versions, the first series (Gundam Seed) is a progressive source 29.97 as stated in the other thread. The second series (Gundam Seed Destiny) needed to be IVTC'ed to 23.97. When you save via dgindex, it states what the source file is as it saves and generates the d2v. So I ran two for each dvd, one honor pull down, and one forced film. Forced film was smoother...the 29.97 honor pull down would jerk repeatedly...so their was obviously duplicated frames.
Guest
3rd March 2008, 20:22
The frames aren't blended. I was talking about the "solution" that 20-40 presented.
I've made two versions of the 12 dvd's. One with honor pull down and the other forced film. While I saved the first 12 d2v's via honor pull down, it was stating the source was film based on the progress bar. So I finished the 12, and ran an additional process again on the dvd's with forced film. I compared both of them..the honor pull down 29.97 version was jerky on panning shots. The 23.97 forced film version was completely smooth. So the source native frame rate is indeed 23.97 I was talking about the clip you posted. It does not have soft pulldown, yet you claimed that DGIndex said it was film. That cannot be correct.
I compared both of them..the honor pull down 29.97 version was jerky on panning shots. That's because if you have 3:2 pulldown and you don't do IVTC via Force Film, you have to do it with Avisynth filters (e.g., Telecide/Decimate or TFM/TDecimate). Note that as I said, you can do IVTC via Force Film only when you have soft telecining (RFF flags present as shown by incrementing field repeats in the Info dialog).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.