View Full Version : Babylon 5 Crusade deinterlacing issues
cybersharky
10th May 2012, 11:16
I'm having issues with a PAL source(Babylon 5 Crusade), some frames aren't being deinterlaced properly.
QTGMC( Preset="Slow", FPSDivisor=2)
This script works using yadif:
LoadPlugin("D:\MeGUI_OneClick_Preview\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("C:\Users\me\Documents\DVDrips\CRUSADE_DISC_1_E1\VIDEO_TS\VTS_01_1.d2v", info=3)
LoadPlugin("D:\MeGUI_OneClick_Preview\tools\avisynth_plugin\ColorMatrix.dll")
ColorMatrix(hints=true, interlaced=true, threads=0)
Load_Stdcall_Plugin("D:\MeGUI_OneClick_Preview\tools\yadif\yadif.dll")
Yadif(order=1)
crop(8, 2, -8, 0)
LanczosResize(640,480) # Lanczos (Sharp)
#denoise
cybersharky
11th May 2012, 11:40
cybersharky: I can't tell what your problem is without part of your source video.
http://www.mediafire.com/?ek7axpxx1d1zrml Larger than I would normally go for a sample, but covers most of the frames causing problems
cybersharky
12th May 2012, 20:06
http://www.mediafire.com/?ek7axpxx1d1zrml Larger than I would normally go for a sample, but covers most of the frames causing problems
no help :(
-Vit-
12th May 2012, 22:19
Have some patience please.
It's not an interlaced video. The fields are messed up. Start by trying just SeparateFields() - every half-height field should be a different point in time for pure interlace - but in that sample each pair of fields is the same point in time, but with a one field offset so it looks interlaced. So try SeparateFields().trim(1,0).Weave() to pair the fields up better. It looks progressive, but a bit of mess, because the fields seem to have had some processing on them already. Look again at SeparateFields(), as well as the expected slight vertical offset, there's a weird motion shift between paired fields. And the effect is not always on the even or odd frames, but kinda moves between them so the progressive modes of QTGMC don't help much either. Problem source needs custom solution, maybe someone else recognizes this kinda problem pattern.
Reel.Deel
12th May 2012, 23:57
The suggestion from -Vit- did the trick. This looks correct to me. Then again I'm fairly new to Avisynth. :)
Edit - Did not check it in real time. :stupid:
Clip1 = DGSource("crusade-sample.demuxed.dgi").SeparateFields().SelectEven().Trim(1,0)
Clip2 = DGSource("crusade-sample.demuxed.dgi").SeparateFields().SelectOdd()
Interleave(Clip1, Clip2).Weave().AssumeTFF()
Didée
13th May 2012, 00:31
Poor Crusade. Not only the series was cancelled before it really started, but they even made it technically broken? Oh my.
It's difficult to tell what happened to that source. Maybe some kind of noise filter, maybe some kind of mocomp-restauration, or whoknowswhat. Anyway, the problem is what -Vit- already noted: between the fields from the same progressive frame, some parts do move. (Or: some parts stay "locked", while the rest of the frame moves.)
Possibility#1: after field matching, just make daa3() - antialiasing. That's relatively fast, but in places with that "in-frame / inter-field motion" it will just blend (i.e. smear) the motion states.
Possibility#2: (much slower): create a 50% motion-state between the two fields.
mpeg2source("crusade-sample.demuxed.d2v")
doubleweave().selectodd() # tfm(pp=0)
o=last
deblock_qed(quant1=30,quant2=25,aoff1=2,boff1=4,aoff2=2,boff2=4)
nnedi3(field=-2)
sup1=removegrain(11).msuper(pel=2,levels=1)
sup2=last.msuper(levels=1,pel=2,sharp=2)
bv=sup1.manalyse(isb=true, truemotion=false,global=true,search=3,searchparam=1,pelsearch=8,dct=5,blksize=16,overlap=8,levels=1)
fv=sup1.manalyse(isb=false,truemotion=false,global=true,search=3,searchparam=1,pelsearch=8,dct=5,blksize=16,overlap=8,levels=1)
mflowfps(sup2,bv,fv,num=100,den=1).selectevery(4,1)
matched=last
last.repair(removegrain(2),1)
sd=mt_makediff(last,last.removegrain(11))
matched
mt_adddiff(sd.mt_lut("x 128 - 1.49 * 128 +"),U=2,V=2)
mt_makediff(sd.removegrain(20).mt_lut("x 128 - 0.751 * 128 +"),U=2,V=2)
stackhorizontal(o,last)
Of course, it is absolutely mandatory that the fields are matched. The sample shows constant phase shift, therefore the fixed fieldmatch (doubleweave.select) is sufficient. For the full shows, you need to make sure if the phaseshift is constant, or if it's in fact dynamic. If dynamic, use TFM instead.
Reel.Deel
13th May 2012, 00:56
doubleweave().selectodd(). That's it? Well I learned something new. lol :o
cybersharky
13th May 2012, 11:46
Thank you for your replies -Vit- & Didée.
Sorry, -Vit-, I was frustrated nothing I tried was working.
cybersharky
14th May 2012, 18:56
Still haven't had much success.
LoadPlugin("D:\MeGUI_OneClick_Preview\tools\dgindexnv\DGDecodeNV.dll")
Clip1 = DGSource("C:\Users\me\Documents\DVDrips\CRUSADE_DISC_1_E1\VIDEO_TS\VTS_01_1test.dgi").SeparateFields().SelectEven().Trim(1,0)
Clip2 = DGSource("C:\Users\me\Documents\DVDrips\CRUSADE_DISC_1_E1\VIDEO_TS\VTS_01_1test.dgi").SeparateFields().SelectOdd()
Interleave(Clip1, Clip2).Weave().AssumeTFF()
I get an error, SeparateFields: YV12 height must be a multiple of 4.
[Edit] I forgot I had cropped manually in .dgi file, it works now. Will test more tomorrow
Didée's code results in some very blurry frames.
Where can I find the file\code for daa3()? Is this it?:
function daa(clip c) {
nn = c.nnedi2(field=-2)
dbl = mt_average(selecteven(nn),selectodd(nn),U=3,V=3)
dblD = mt_makediff(c,dbl,U=3,V=3)
shrpD = mt_makediff(dbl,dbl.removegrain((width(c)>1100) ? 20 : 11),U=3,V=3)
DD = shrpD.repair(dblD,13)
return dbl.mt_adddiff(DD,U=3,V=3) }
Didée
15th May 2012, 09:58
Example, please? On your sample video, my script does not create any blurry frames.
Fieldmatched -vs- fieldmatched+MotionAligned :
http://thumbnails76.imagebam.com/19033/4c90a3190321991.jpg (http://www.imagebam.com/image/4c90a3190321991) - http://thumbnails69.imagebam.com/19033/ce7664190321983.jpg (http://www.imagebam.com/image/ce7664190321983)
http://thumbnails60.imagebam.com/19033/e9b4ec190322006.jpg (http://www.imagebam.com/image/e9b4ec190322006) - http://thumbnails71.imagebam.com/19033/1e9dff190322000.jpg (http://www.imagebam.com/image/1e9dff190322000)
http://thumbnails62.imagebam.com/19033/fbe82f190321969.jpg (http://www.imagebam.com/image/fbe82f190321969) - http://thumbnails7.imagebam.com/19033/b3544e190322012.jpg (http://www.imagebam.com/image/b3544e190322012)
If you get blurry frames on sequences other than that sample, then the source probably has dynamic field shift. For which the measures were already noted. But then, there might be a problem (I didn't actually try yet) - a fieldmatcher is made to combine those fields together that do match together. But in Crusade, obviously, those fields that belong together do not necessarily match together. Therefore it could be possible that automatic fieldmatching is not always successful. In which case, you'd be left back with the mission to make all fieldmatching manually. :)
Edit:
Oh, wait ... I just saw that you are using DGDecodeNV to decode the source? If I'm not mistaken, DGSource() does not report the source's field parity? (in contrast to DGIndex/mpeg2source, which does.)
Try adding an "AssumeTFF()" right after loading the source:
DGsource("crusade-sample.demuxed.dgi")
AssumeTFF()
doubleweave().selectodd() # tfm(pp=0)
...etc...
Point is that for sources with unknown field parity, Avisynth always assumes BFF. The sample actually is TFF, but if the source filter does not report that it is, all will go wrong. ;)
cybersharky
15th May 2012, 14:38
Firstly, thank you for your help again Didée.
I indexed the file again with DGIndex, now your script works properly and looks great. I don't know what DGIndexNV did or is doing but there are frames that look really bad, even when I added AssumeTFF.
When you say Fieldmatched, do you mean: doubleweave().selectodd()?
Didée
15th May 2012, 15:01
Yes, that's fixed matching of a constant phase shift.
A progressive field/frame sequence is
A B C D E F G
a b c d e f g
A phase-shifted field/frame sequence is
A B C D E F G | | . A B C D E F
. a b c d e f | or | a b c d e f g
Correction of phase-shifted content is done by re-arranging the fields accordingly.
In case of "dynamic" phase-shift, the content is alternating between plain progressive sequences, and sequences with phase shift. Usually this is caused by the editor using a interlaced workflow (or the video being hard-telecined), and cutting at odd-numbered positions.
Guest
15th May 2012, 15:19
I indexed the file again with DGIndex, now your script works properly and looks great. I don't know what DGIndexNV did or is doing but there are frames that look really bad, even when I added AssumeTFF.
Didée, did you use DGDecNV? If there is an issue here, I'd like to fix it.
Didée
15th May 2012, 15:32
For AVC i use it regularly, but for Mpeg2-video I still use mpeg2source. "Keep the retirees engaged."
Guest
15th May 2012, 15:36
OK.
@cybersharky
Please post a screenshot of a frame that looks "really bad" that I can reproduce with the sample, together with your script. I don't see any issues with this script:
dgsource("crusade-sample.demuxed.dgi")
assumetff()
separatefields()
doubleweave().selectodd()
There is some aliasing on the CG shots but that's in the source.
cybersharky
15th May 2012, 19:01
I did some more testing.
I was trying out cropping in DGDecodeNV, so the dgi file was created manually, it's that file that is giving issues. I now used Megui and indexed the vob's again using DGDecodeNV, that dgi file works. So somehow that first dgi file is corrupting frames.
Comparing the two files in notepad++, the first file has CLIP 8 8 2 0, the second file has no cropping. The only other difference is the second file has .vob in lowercase
VTS_01_2.VOB 570019840 | VTS_01_2.vob 570019840
Guest
15th May 2012, 20:17
You manually added cropping to the DGI file?! Don't mess with that if you want DGDecodeNV to do the cropping.
Anyway, cropping by 2 is a no-no.
cybersharky
16th May 2012, 07:36
You manually added cropping to the DGI file?! Don't mess with that if you want DGDecodeNV to do the cropping.
Anyway, cropping by 2 is a no-no.
Yes, I added the 2 value manually :eek:
Thank you, for your input neuron2.
StickHorsie
20th January 2013, 16:32
Poor Crusade indeed! (I have the same DVD set.)
Didée #6: I managed to get possibility #2 working, but it ends with getting 2 horizontally stacked fields (stackhorizontal(o,last)). What comes next?
cybersharky #18: And then came episode 2 which had merged even fields. :( Did you ever get beyond episode 1 with any decent quality? And, if yes, how?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.