View Full Version : Help with Convolution3D usage (interlaced video)
FulciLives
6th May 2004, 08:52
Hello :)
I could use some help in trying to pin down the proper way to use Convolution3D with 29.970fps NTSC interlaced video sources (720x480).
Most of the videos I process are PICVideo MJPEG captures. So they tend to have a 3-2 pattern but I rarely do IVTC because it never seems as though the 3-2 pattern is "perfect" enough so I'd rather just leave it interlaced.
Anyways I came up with this the AviSynth script from elsewhere on this website. I would like to know if anyone thinks this is proper or if something is wrong in it and if so how to fix it
----------
AviSource("D:\CAPTURE\capture.avi")
SeparateFields()
odd=SelectOdd.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
evn=SelectEven.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
Interleave(evn,odd)
Weave()
DoubleWeave.SelectOdd()
ConvertToYUY2(interlaced=true)
----------
I think this script was for DV AVI because I have to change line 7 to this:
DoubleWeave.SelectEven()
To get proper playback loading and checking the script out in VirtualDubMod. I assume the difference here is that DV AVI is bottom field first whereas my capture is top field first.
Last but not least I also use Trim, Crop and AddBorders and adding those to the above script I get this:
----------
AviSource("D:\CAPTURE\capture.avi")
Trim(1103,1363)
crop(8,4,-8,-12)
SeparateFields()
odd=SelectOdd.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
evn=SelectEven.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
Interleave(evn,odd)
Weave()
DoubleWeave.SelectOdd()
AddBorders(8,8,8,8)
ConvertToYUY2(interlaced=true)
----------
Am I OK with the location in the script of my Trim, Crop and AddBorders commands or am I better off putting them elsewhere?
- John "FulciLives" Coleman
P.S.
Also does anyone have a suggestion for Convultion3D settings that would be somewhere bettween movieLQ and vhsBQ settings? I find that with VHS captures that vhsBQ looks MUCH better than movieLQ but only at the expense of much (perhaps too much) detail. Surely there must be a happy medium between the two settings?
Your script looks fine; I don't see any errors (haven't tested it, though). Regarding the Convolution3D settings, refer to the file "Convolution3d.txt" for the parameter values of the presets:
Convolution3d (preset="vhsBQ") // VHS capture Bad Quality (???)
is an alias for Convolution3D (0, 32, 128, 16, 64, 10, 0)
You may wish to decrease the values, e.g. try to use lower values for the thresholds. Play with the first parameter, too (can be either 0 or 1, where 1 is the "full-1 matrix", which I prefer for most applications).
bb
Malcolm
6th May 2004, 13:25
Just use this instead
AviSource("D:\CAPTURE\capture.avi")
Trim(1103,1363)
crop(8,4,-8,-12)
ViewFields()
Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
UnViewFields()
AddBorders(8,8,8,8)
ConvertToYUY2(interlaced=true)
ViewFields() and UnViewFields() are 2 avisynth filters.
Greetings,
Malcolm
scharfis_brain
6th May 2004, 13:29
@malcom:
only use [un]viewfields() If you apply non-spatial filters.
convolution3d will also filter the edge between the fields, resulting in a false processed line on top and bottom after unviewfields.
Malcolm
6th May 2004, 13:38
Originally posted by scharfis_brain
@malcom:
only use [un]viewfields() If you apply non-spatial filters.
convolution3d will also filter the edge between the fields, resulting in a false processed line on top and bottom after unviewfields.
That's right, but who cares??? :) If you like to avoid this, then you can
a) add 2 (or more) black lines at the bottom of the vid and crop them afterwards
b) use FoldFieldsVertical(true) and UnFoldFieldsVertical(true)
these are 2 scripts from the jdl-util.avsi package (search for it here). The boolean parameter tells the script to flip the lower part. by doing this, the 2 lines at the bottom of the video (which belongs to another) are blended.
Greetings,
Malcolm
I fail to see the advantage of the ViewFields/UnViewFields method. I'd rather use the classic approach of separating the fields.
bb
Malcolm
6th May 2004, 14:10
Originally posted by bb
I fail to see the advantage of the ViewFields/UnViewFields method. I'd rather use the classic approach of separating the fields.
bb
That makes me wonder!!!
Just look at the 2 scripts and see the difference. if you use ViewFields/UnViewFields you don't have to think about all this stuff like odd() even() SeparateFields() Interleave() Weave() DoubleWeave() SelectOdd() bla bla bla
The script is much simpler! The filters inbetween ViewFields/UnViewFields have to be called/parameterized only once!
That's much easier to edit.
But i don't care. do it just as you like it to do. i do it like this :p
Wilbert
6th May 2004, 14:21
Do it at least correctly, and add
DoubleWeave.SelectOdd()
The (Un)ViewFields script may be simpler, but as scharfis_brain pointed out, you should not use it in conjunction with spatial filtering (having an impact in the vertical direction).
bb
stickboy
6th May 2004, 16:59
As mentioned, just use my JDL_UnfoldFieldsVertical/JDL_FoldFieldsVertical functions (http://www.avisynth.org/stickboy/). They're designed to be used with spatial-temporal smoothers.
The primary disadvantage of the SeparateFields() method is that Dust doesn't like to be called twice.
By the way, what's the deal with the DoubleWeave().SelectOdd() stuff? Shouldn't Interleave(...).AssumeFieldBased().Weave() be sufficient?
Edit:
Oh, that reminds me. Another complication with the SeparateFields() method is that you'll need to keep track of the field-order. There really needs to be an AssumeTFF()/AssumeBFF() call before Weave(). FWIW, my Unfold/FoldFieldsVertical functions take care of all that for you.
Originally posted by stickboy
By the way, what's the deal with the DoubleWeave().SelectOdd() stuff? Shouldn't Interleave(...).AssumeFieldBased().Weave() be sufficient?
The DoubleWeave().SelectOdd() is used to change the field order from BFF to TFF for CCE encoding. As I've read the latest CCE Basic can encode BFF, so if you use that one (or another encoder being capable of encoding BFF), then you don't need that.
bb
Let me ask a direct question. I basically use one noise filter combo, Undot().Deen() on my progressive source when needed because it is simple and effective and I don't have to think about it much.
My limited understanding of Stickboy's [un]UnfoldFieldsVertical is that it takes care of all the stuff I don't want to think about the few time a month I do interlaced.
Assuming top field first, when dealing with 60i from a DVD source like an interlaced trailer, is this a correct usage?:
jdl_UnfoldFieldsVertical(flip=true)
Undot().Deen()
# resize here also if vertical resize?
jdl_FoldFieldsVertical(flip=true)
What I am looking for is the simplest way to take the commands from my progressive source scripts and move them over to the interlaced scripts with the least amount of effort. I suspect there may be a lot of other folks that would like a simple recipe also. Frankly, interlaced is just a PITA and good enough is good enough for a cheesy trailer.
Boulder
6th May 2004, 18:14
Originally posted by DDogg
jdl_UnfoldFieldsVertical(flip=true)
Undot().Deen()
# resize here also if vertical resize?
jdl_FoldFieldsVertical(flip=true)
Yep, that's the proper way..
FulciLives
6th May 2004, 18:17
Originally posted by bb
The DoubleWeave().SelectOdd() is used to change the field order from BFF to TFF for CCE encoding. As I've read the latest CCE Basic can encode BFF, so if you use that one (or another encoder being capable of encoding BFF), then you don't need that.
bb
This is the one thing that I'm still slightly confused about ...
Here is my "final" script:
----------------------------------------
LoadPlugin("Convolution3d.dll")
avisource("D:\CAPTURE\capture.avi")
Trim(1103,1363)
crop(4,4,-4,-12)
SeparateFields()
odd=SelectOdd.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
evn=SelectEven.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
Interleave(evn,odd)
Weave()
DoubleWeave.SelectEven()
AddBorders(8,8,8,8)
ConvertToYUY2(interlaced=true)
----------------------------------------
Now this is almost exactly what I posted above. The only difference is the first line (forgot that before duh!) and the fact that I had to make this change:
Instead of:
DoubleWeave.SelectOdd()
I have to use:
DoubleWeave.SelectEven()
If I preview this script in VirtualDubMod it looks very strange with SelectOdd() but if I change that to SelectEven() then it looks A-OK and as I said above I guess this is because my source is a capture with TOP FIELD FIRST.
But if I understand correctly what user bb is saying I can just delete this entire DoubleWeave.SelectEven() line since I have a TOP FIELD FIRST video source.
Correct?
So that means I just need the following:
----------------------------------------
LoadPlugin("Convolution3d.dll")
avisource("D:\CAPTURE\capture.avi")
Trim(1103,1363)
crop(4,4,-4,-12)
SeparateFields()
odd=SelectOdd.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
evn=SelectEven.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
Interleave(evn,odd)
Weave()
AddBorders(8,8,8,8)
ConvertToYUY2(interlaced=true)
----------------------------------------
I tried this script just now (the only difference being that I dropped the DoubleWeave.SelectEven() part) and it seems to look A-OK in VirtualDubMod
Just want to make sure I'm not "missing" something or doing it wrong :)
- John "FulciLives" Coleman
John,
you are correct, you don't need the "DoubleWeave.SelectEven()". Now if you take a deep breath and dig into what these weave and select commands do, you'll find out that nobody needs this command, because it is a NOP, i.e. it does nothing except eating processing time.
bb
FulciLives
7th May 2004, 19:18
Originally posted by bb
John,
you are correct, you don't need the "DoubleWeave.SelectEven()". Now if you take a deep breath and dig into what these weave and select commands do, you'll find out that nobody needs this command, because it is a NOP, i.e. it does nothing except eating processing time.
bb
Thank you and everyone else who helped here I apprecaite it :)
BTW I also tried this:
LoadPlugin("Convolution3d.dll")
avisource("D:\CAPTURE\capture.avi")
Trim(1103,1363)
crop(4,4,-4,-12)
JDL_UnfoldFieldsVertical(true)
Convolution3D(1, 32, 128, 16, 64, 10, 0)
JDL_FoldFieldsVertical(true)
AddBorders(8,8,8,8)
ConvertToYUY2(interlaced=true)
and was pleased that I got it to work :)
So now I have two options :)
- John "FulciLives" Coleman
North2Polaris
10th May 2004, 02:46
Originally posted by bb
John,
you are correct, you don't need the "DoubleWeave.SelectEven()". Now if you take a deep breath and dig into what these weave and select commands do, you'll find out that nobody needs this command, because it is a NOP, i.e. it does nothing except eating processing time.
bb
bb,
In your updated version of the DV to DVD-R guide, http://www.doom9.org/dv/guide.html
you give an example of an AviSynth script for use with CCE that has the following line: DoubleWeave.SelectOdd()
Based on the discussion in this thread, this line in the script would not be necessary if the encoder was able to handle bottom field first, correct?
North
Originally posted by North2Polaris
[...]Based on the discussion in this thread, this line in the script would not be necessary if the encoder was able to handle bottom field first, correct?
North
Correct :) Even with older CCE versions (before 2.67) you may tick the "Upper field first" flag (or however it is called), but this will move each picture by one line leaving a line doubled. The DoubleWeave.SelectOdd() line provides a better method to get it straight.
I have no information on how / how good the bottom field first encoding works in CCE 2.67 by the way. Does anybody know?
bb
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.