View Full Version : Chroma Problem with Inverse Telecine filter (IVTC)
Dwedit
19th October 2020, 00:03
I am seeing an issue with the Inverse Telecine filter.
Original clip (mpeg-2 in MKV file, 10 frames long, ~300K) (https://www.dwedit.org/files/.doom9/VTS_02_1b.mkv)
I have loaded the clip, added one Filter: IVTC
Field assembly mode: Reduce Frame Rate
Field mode: Autodetect
Pattern phase: Adaptive
When I go to Frame 6, I get this:
Input frame:
https://i.imgur.com/0E32FUR.jpg
Output frame:
https://i.imgur.com/vNqdPvy.jpg
Supposed to be this:
https://i.imgur.com/rOZoxzL.jpg
I'm getting clean field-matched Luma, but getting the Chroma from a combed frame instead.
poisondeathray
19th October 2020, 02:34
This occurs because vdub/vdub2's IVTC filter works in 422 . The 420 => 422 chroma upsampling is performed in a progressive fashion, not interlaced aware. That produces those chroma artifacts
I don' t know of any internal vdub2 workaround. The alias format, convert, and decode options don't have interlace aware options. You need something equivalent to avisynth's ConvertToYUY2(interlaced=true) , or ConvertToYV16(interlaced=true). Or vdub2's IVTC filter needs to be reworked to support 4:2:0, or some proper intermediate conversion routine needs to be added
If you feed an avs script to vdub2 (with ConvertToYUY2(interlaced=true) ) it will work . (But if you were using avisynth, you might as well IVTC in the original YV12 in avisynth and skip vdub2 altogether in the first place)
Dwedit
19th October 2020, 02:45
I've been hunting around for a good inverse telecine engine, because this DVD doesn't have a consistent 3-2 pattern throughout the whole episode, it changes many times.
I just tried changing the color space to RGB888, but it still does the same thing with chroma.
poisondeathray
19th October 2020, 02:54
I've been hunting around for a good inverse telecine engine, because this DVD doesn't have a consistent 3-2 pattern throughout the whole episode, it changes many times.
avisynth - TIVTC is an adaptive field matcher , and has many options, overrides
I just tried changing the color space to RGB888, but it still does the same thing with chroma.
If you use "show image formats" checked, you will see the filter works in 422 , but you're sending it 420 (all DVD's are 420) . That's the problem.
If you upsample it correctly (ie. resize the chroma planes in an interlaced aware fashion), it will work in vdub2 IVTC without the chroma artifacts. I don't know of a workaround in internal vdub2 only
There is no need to upsampling in avisynth, because TIVTC can work with the original 420 format
Dwedit
19th October 2020, 03:14
I tried TIVTC, but I was getting some artifacts. Some frames had a single field enlarged to fill the whole frame, at half vertical resolution.
It appears that LibAVFilter's "Pullup" filter (Handbrake uses this) works really well, and I'm not sure if that's available in Avisynth or not.
poisondeathray
19th October 2020, 03:51
I tried TIVTC, but I was getting some artifacts. Some frames had a single field enlarged to fill the whole frame, at half vertical resolution.
Did you use a frame accurate source filter ?
Was there a good match available, or was it an "orphaned" field to begin with ?
If it's the case where you only have top or bottom field from edits, orphaned fields (You only have half resolution to begin with) or residual combing (various reasons, frame warping etc..) - you specify TFM clip2 parameter using a better deinterlacer such as QTGMC instead of the default cubic resize (this just interpolates the missing field using cubic interpolation). QTGMC clip2 interpolation for the missing field will almost always give better results than pullup or handbrake, or ffmpeg pullup or fieldmatch (with any deint pp) in that frame's interpolated missing field. There is no comparison in terms of quality
If there was a good field match available that TFM missed, it might have been not ideal settings used, or a non frame accurate source filter
It appears that LibAVFilter's "Pullup" filter (Handbrake uses this) works really well, and I'm not sure if that's available in Avisynth or not.
Not the same filter exactly.
People frequently complain about pullup results . Maybe it works ok in your case, or maybe you didn't use ideal TIVTC settings
But use whatever works best. I'd be very surprised if handbrake achieved better IVTC results
Dwedit
19th October 2020, 06:09
I'm using TFM in two-pass mode.
tfm(d2v=d2vPath,output=tfmPath)
tdecimate(mode=4,output=decimatePath)
These are using the default settings.
My second pass:
tfm(d2v=d2vPath,input=tfmPath)
tdecimate(mode=5,hybrid=2,input=decimatePath,tfmIn=tfmPath,mkvOut=timecodesPath)
I have also tried other TFM settings, and can't find anything that works.
I'm getting bad artifacts on EASY frames.
Comb Guy (Bad)
https://i.imgur.com/4RvW9WN.jpg
Comb Guy (Good)
https://i.imgur.com/U5pwJQM.jpg
Comb Guy is in the middle of some easy frames. Immediately before it is 3 fields, 2 fields, 3 fields, 2 fields, repeating for a while. Comb guy's frame is 2 fields, then 3, 2, 3, 2, 3.... Very easy sequence here.
Train Guy (Bad)
https://i.imgur.com/4X4VVdZ.jpg
Train Guy (Good)
https://i.imgur.com/1tz9OSO.jpg
Train Guy's frame is 3 fields. Before it is 2, 3, 2, 3.... After it is 2,3,2,3.... Very easy sequence.
Mouth Guy (Bad)
https://i.imgur.com/99m6IiA.jpg
Mouth Guy (Good)
https://i.imgur.com/m689cSk.jpg
Mouth Guy's frame is 2 fields long. Before it is 3 fields, 2 fields... After it is 3 fields, then a 5 field (2+3) frame.
Mouth Guy happens to be behind a 60FPS credits overlay, so I could give that one a pass.
poisondeathray
19th October 2020, 06:25
I'm getting bad artifacts on EASY frames.
Comb Guy is in the middle of some easy frames. Immediately before it is 3 fields, 2 fields, 3 fields, 2 fields, repeating for a while. Comb guy's frame is 2 fields, then 3, 2, 3, 2, 3.... Very easy sequence here.
If it's deinterlacing frames it shouldn't be, the cthresh is possibly too low for that source (false positives), you can try increasing the value
Use the TFM debug overlay (display=true) to help guide you in adjusting the settings for that source
Even if combing is detected (right or wrong) , it's still a good idea to use clip2 with QTGMC for better quality post processing. It's only applied when combing is detected
Mouth Guy happens to be behind a 60FPS credits overlay, so I could give that one a pass.
You can specify an incluson/exclusion area if you have overlays /credits (or any areas that might distort the analysis , and therefore results) . For TFM there is a y0/y1 exclusion band ; for TDecimate , clip2 can be full frames but clip1 can be an altered input clip to use for detection purposes (e.g. a cropped clip)
If you are using VFR, you have to decide what base rate you want for each section; if the underlying content is 23.976, you're going to have duplicates if you keep the overlays/credits at 59.94
If you need more help, post in the avisynth subforum, with a sample of the source. (It's not really a vdub IVTC issue)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.