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. |
22nd March 2014, 16:13 | #1 | Link |
Registered User
Join Date: Jun 2012
Posts: 44
|
Help with bizzarre interlacing
Hi,
I have a problem with the interlacing of something i'm trying to encode, and i think i need some help with the deinterlacing on this. The source seems to be interlaced AAABBABBAAABBAAABBAAABBABBBBBABBA Note that the above is probably wrong, it just seems too bizzarre, the souce seems like a mix of interlacing and the animator drawing a clear picture with a weaker picture on top to better animate movements, but i'm not sure. After deinterlacing it with this script: Code:
DGDecode_mpeg2source("C:\VTS_05_1.d2v", info=3, cpu=6) crop( 4, 58, -4, -58) tfm(order=0).tdecimate(hybrid=1) ColorMatrix(interlaced=true) ConvertToYV12() I also found this (Not included in the clip of the source under), so there is definitely something wrong: Here is a clip of the source: https://mega.co.nz/#!WdUjhRjS!veAKis...LPUuYKrjBz39ZA Is anyone able to find out how it's interlaced and possibly a solution to it? |
22nd March 2014, 17:10 | #3 | Link |
Registered User
Join Date: Jun 2012
Posts: 44
|
It seems it already is YUV 4:2:0, so i shouldn't be using ConvertToYV12 at all, though that doesn't really change anything on the encode visual-wise.
Edit: When deinterlacing with (This was just an experiment, i know it's probably not best to deinterlace with this): Code:
tdeint() AssumeTFF() Telecide(guide=1,chroma=true) Instead of what i'd get with the script in the first post: Last edited by eriler; 22nd March 2014 at 17:24. |
22nd March 2014, 17:38 | #5 | Link | |
Registered User
Join Date: Jun 2012
Posts: 44
|
Quote:
|
|
22nd March 2014, 21:34 | #7 | Link |
Registered User
Join Date: Jun 2012
Posts: 44
|
The first sample contains the first frame i posted an image of, which does show the problem, but i've cut out another sample for you which shows the frames where the girl with the frog is (At about 30 seconds in), this doesn't have any dots, so it should be easier to analyze. The first few frames in the sample seems to have been slightly corrupted by the video cutting software i used, so disregard them, but everything else should be proper.
https://mega.co.nz/#!zAEDQDrb!ijAIuB...7UNpTk0pULu2Ho |
22nd March 2014, 22:13 | #8 | Link |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
your source is anime, so 99% of the time you will need ivtc, not deinterlace. And you should not crop the video before ivtc.
I ran the common ivtc and it looks perfect to me, I didn't see any chroma blend in the sample Code:
mpeg2source("abc.d2v") tfm().tdecimate() |
23rd March 2014, 08:21 | #9 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Sorry, I was completely outta my tree, just ignore what I said before, u converted ur clip to yv12 after tfm and there's nothing wrong with it, so what u really need is deblend and do remove interlaced=true from color matrix cuz ur clip ain't interlaced any more after tfm
Last edited by feisty2; 23rd March 2014 at 08:27. |
23rd March 2014, 08:48 | #10 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
replace tfm.tdecimate with the script below
Code:
luma = tfm(pp=0, slow=2) chroma = vinverse().Srestore(omode="PP3", cache=10) # manual sync: figure out which frame (previous,current aka p,c) of 'chroma' clip is most similar to current frame of 'luma' clip # 46*log(|x-y|+1) uses the full [0,255]-range and scales little differences better than |x-y|*2 diffp = mt_lutxy(luma,chroma.selectevery(1,-1),"x y - abs 1 + log 46 *") diffc = mt_lutxy(luma,chroma, "x y - abs 1 + log 46 *") # average difference between compared frames mp = mt_lutf(diffp,diffp,"avg",expr="x") mc = mt_lutf(diffc,diffc,"avg",expr="x") # build conditional masks based on the caculated comparisons maskp = mt_lutxy(mp,mc,"x y < 255 0 ?") # finally merge the luma of the tfm with the chroma of the srestore clip accordingly to the binary mask MergeChroma(luma,chroma).mt_merge(chroma.selectevery(1,-1),maskp,luma=true,Y=2,U=3,V=3) Last edited by feisty2; 23rd March 2014 at 08:51. |
23rd March 2014, 10:58 | #11 | Link | ||
Registered User
Join Date: Jun 2012
Posts: 44
|
Quote:
So it still seems to be telecined some places. Quote:
Code:
LoadPlugin("C:\AviSynth\plugins\RemoveGrain.dll") LoadPlugin("C:\AviSynth\plugins\TIVTC.dll") import("C:\AviSynth\plugins\srestore.avs") loadplugin("C:\AviSynth\plugins\average-codeblock\src\Release\Average.dll") loadplugin("C:\AviSynth\plugins\GRunT.dll") loadplugin("C:\AviSynth\plugins\masktools-v2.0a48\mt_masktools-26.dll") loadplugin("C:\AviSynth\plugins\colormatrix.dll") Import("C:\AviSynth\plugins\Vinverse.avsi") LoadPlugin("C:\dgindex\DGDecode.dll") DGDecode_mpeg2source("C:\VIDEO_TS\VTS_05_1.d2v", info=3, cpu=6) luma = tfm(pp=0, slow=2) chroma = vinverse().Srestore(omode="PP3", cache=10) # manual sync: figure out which frame (previous,current aka p,c) of 'chroma' clip is most similar to current frame of 'luma' clip # 46*log(|x-y|+1) uses the full [0,255]-range and scales little differences better than |x-y|*2 diffp = mt_lutxy(luma,chroma.selectevery(1,-1),"x y - abs 1 + log 46 *") diffc = mt_lutxy(luma,chroma, "x y - abs 1 + log 46 *") # average difference between compared frames mp = mt_lutf(diffp,diffp,"avg",expr="x") mc = mt_lutf(diffc,diffc,"avg",expr="x") # build conditional masks based on the caculated comparisons maskp = mt_lutxy(mp,mc,"x y < 255 0 ?") # finally merge the luma of the tfm with the chroma of the srestore clip accordingly to the binary mask MergeChroma(luma,chroma).mt_merge(chroma.selectevery(1,-1),maskp,luma=true,Y=2,U=3,V=3) crop( 4, 58, -4, -58) ColorMatrix() |
||
23rd March 2014, 13:30 | #14 | Link |
Registered User
Join Date: Jun 2012
Posts: 44
|
I finished the encode with the script i posted above in post #11 and it isn't IVTC'ed, and the chroma blend still remains. Though oddly the girl with the frog didn't show chroma blending (Probably has something to do with the decimation from 29.97 to 23.976 fps that wasn't in the script).
|
23rd March 2014, 13:43 | #15 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
after "xxxsource"
add "utoy ()" to your script and post the image you got then replace it with "vtoy ()" and post the image too edit: if it isn't chroma blending, my guess would be plane y,u,v are running out of sync, you need to decimate 3 planes manually and separately to make them synchronized again Last edited by feisty2; 23rd March 2014 at 13:55. |
23rd March 2014, 14:11 | #16 | Link |
Registered User
Join Date: Jun 2012
Posts: 44
|
There is no "xxxsource" anywhere in the script. Did you mean after "DGDecode_mpeg2source("C:\VIDEO_TS\VTS_05_1.d2v", info=3, cpu=6)" ?
Code:
DGDecode_mpeg2source("C:\VIDEO_TS\VTS_05_1.d2v", info=3, cpu=6) utoy() This is how it ends up then: Last edited by eriler; 23rd March 2014 at 14:14. |
23rd March 2014, 16:17 | #20 | Link |
Registered User
Join Date: Jun 2012
Posts: 44
|
To use an override file? But i have no idea how to make one that'll decimate chroma and luma separately and sync them. The help file for tdecimate doesn't specify it either.
Although, as lansing said, when IVTCing with just tfm().tdecimate() and where the crop part is after the IVTC part (See picture post #11), the chroma and luma were in sync, the only problem then was some telecined frames remaining because of the bizzarre telecining pattern this video has. Wouldn't the solution lie more towards tweaking a IVTC plugin to handle the unusual pattern (tdecimate, QTGMC, yadif)? Last edited by eriler; 23rd March 2014 at 16:27. |
|
|