View Full Version : Weave from different files
Argaricolm
13th October 2024, 16:56
Is there any filter that can get fields from different files?
I need to denoise fully interlaced video without deinterlacing it.
So I want to separate fields. Then denoise only top fields and save them to say top.mkv. Then do same for bottom.mkv
Then I need to make interlaced clip again.
Something like:
a = clip from top.mkv
b = clip from bottom.mkv
weave(a,b)
johnmeyer
13th October 2024, 17:20
... deinterlace only top fields That concept makes no sense. You need two adjacent fields in order to deinterlace.
lollo2
13th October 2024, 18:59
I need to denoise fully interlaced video without deinterlacing it.
Even if you want the final outcome being interlaced, for interlaced videos is always better to (lossless)deinterlace-denoise-interlace_back rather than denoise separate fields.
More details here: http://forum.doom9.net/showthread.php?p=1921993#post1921993
DTL
13th October 2024, 22:11
a = clip from top.mkv
b = clip from bottom.mkv
Try get top fields from a-clip and bottom fields from b-clip and weave:
a_s=SeparateFields(a)
b_s=SeparateFields(b)
a_t=SelectOdd(a_s)
b_b=SelectEven(b_s)
Weave(a_t, b_b)
FranceBB
13th October 2024, 22:54
Why not bringing everything to progressive by bobbing, filter and then divide everything back into fields by reinterlacing?
I mean doing something like:
#indexing
video=LWLibavVideoSource ("file.mxf")
audio=LWLibavAudioSource("file.mxf")
AudioDub(video, audio)
#bobbing
Bob()
#Denoising
dfttest()
#Divide in fields
assumeTFF()
separatefields()
selectevery(4,0,3)
weave()
Argaricolm
13th October 2024, 22:59
That concept makes no sense. You need two adjacent fields in order to deinterlace.
Mistype. There should be "denoise".
johnmeyer
14th October 2024, 01:59
Mistype. There should be "denoise".Ah, that's a totally different thing. I believe that is the correct way to denoise interlaced video.
lollo2
14th October 2024, 10:16
Why not bringing everything to progressive by bobbing, filter and then divide everything back into fields by reinterlacing?
Better do it with a lossless operation:
### de-interlacing
QTGMC(lossless=1)
### denoising
TemporalDegrain2() # or whatever temporal or spatial/temporal denoiser
### interlacing
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
I believe that is the correct way to denoise interlaced video.
It is not. Because what already told and because best denoisers are designed for progressive materials.
Frank62
14th October 2024, 10:24
The "missing link" for Argaricolm seems to be a simple INTERLEAVE, like:
separatefields
selecteven
denoise
save file
selectodd
denoise
save file
read both files in a and b
interleave a,b
weave
I am also not sure if this is the best way to handle interlaced video.
When you handle separated fields with anything that changes the structure, then you will get bigger aliasing at the edges after re-weaving than before.
I would also prefer the other way: First deinterlacing, then denoising, and then re-interlacing. But this can also never be perfect, because at edges the two changed fields never fit as well as they did before.
Best to me seems to bob (HQ), denoise, and leave it bobbed.
lollo2
14th October 2024, 12:42
But this can also never be perfect, because at edges the two changed fields never fit as well as they did before.
Best to me seems to bob (HQ), denoise, and leave it bobbed.
If you lossless deinterlace, the field originating the frame is left untouched.
When you interlace back, you discharge the (new) frame(field) that has been generated by the deinterlacing procedure.
So the problem you mentioned does not appear, except for the motion vectors used for the (temporal) denoise algorithm, which is neglettable.
Do this simple experiment:
video_org=AviSource("<filename>.avi")
deinterlaced=video_org.AssumeTFF().QTGMC(lossless=1)
interlaced=deinterlaced.AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
### check difference between original video and original video after QTGMC_lossless and re-interlacing ###
difference_video_org_interlaced=Subtract(video_org, interlaced).Levels(65, 1, 255-64, 0, 255, coring=false)
stackhorizontal(\
subtitle(video_org,"video_org",size=20,align=2),\
subtitle(interlaced,"interlaced",size=20,align=2),\
subtitle(difference_video_org_interlaced,"difference",size=20,align=2)\
)
FranceBB
14th October 2024, 13:08
Better do it with a lossless operation
yep, yep, I agree, QTGMC is definitely better for the task, mine was just a very simple "example" on the idea.
Frank62
14th October 2024, 22:41
If you lossless deinterlace, the field originating the frame is left untouched.
Yes. Absolutely.
When you interlace back, you discharge the (new) frame(field) that has been generated by the deinterlacing procedure.
Of course.
So the problem you mentioned does not appear, except for the motion vectors used for the (temporal) denoise algorithm, which is neglettable.
No. That is the problem I mentioned. You change fields. And if you are not very lucky, the field(s) is/are changed also at the edges. And this you can see after re-interlacing. Interlaced edges are very "sensitive", also - another thing - to compression algorithms, even to very slight compressions like Digital Betacam. I had lots of (PAL) partly field-delayed DigiBeta copies that were 100% without aliasing on the portions that were field-correct, but had very visible aliasing at the edges of the field-delayed parts after the fields were simply corrected (no deinterlacing).
Do this simple experiment:
Not necessary, I can see that here nothing will be affected.
lollo2
14th October 2024, 23:00
you change fields
No. In lossless mode the original fields are not touched.
Frank62
15th October 2024, 12:57
You change the fields NOT by deinterlacing, as I admitted 100%, you change it by
"except for the motion vectors used for the (temporal) denoise algorithm, which is neglettable. "
which is NOT neglettable.
lollo2
15th October 2024, 14:30
The motion vector are used for the denoising operation (only).
But better than thousand words, here an example.
I lossless deinterlace, denoise and then interlace back.
Let me know where you see defects in the edges (search for latest frames with non black edges). Or otherwise post a sample where you highligth the problem you mentioned.
https://drive.google.com/file/d/1HZkWtPD3bInpP1CTNdsRL9MnljIkO_We/view?usp=sharing
video_org=AviSource("<fileName>.avi")
denoised=video_org.AssumeTFF().QTGMC(lossless=1).ConvertToYV16().TemporalDegrain2(degrainTR=3).ConvertToYUY2()
interlaced=denoised.AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
### check difference between original video and original video after QTGMC_lossless, denoise and re-interlacing ###
difference_video_org_interlaced=Subtract(video_org, interlaced).Levels(65, 1, 255-64, 0, 255, coring=false)
stackhorizontal(\
subtitle(video_org,"video_org",size=20,align=2),\
subtitle(interlaced,"interlaced",size=20,align=2),\
subtitle(difference_video_org_interlaced,"difference",size=20,align=2)\
)
Frank62
16th October 2024, 10:05
It's ok, it should not be a challenge.;)
lollo2
16th October 2024, 11:59
Sure Frank62, I did not mean a challenge ;)
I was interested in seeing your point of view, I may be missing something. I do not know everything, and there is always room to learn and to improve :)
Frank62
17th October 2024, 14:27
That sounds great.:)
I cannot be sure if EVERY kind of changing fields does damage to the edges, when you re-weave, but i had it a lot of times. And when you filter somehow efficiently, there is going to be a change in the field after these filtering, and this also changes the edges, so that they do not fit 100%.
But when I think about, I had the problems mainly in combination with later sharpening (unsharp masking), maybe that made the staircases really visible.
So: Without sharpening, changes are maybe "neglettable", as you said. :)
Anyway I would always prefer not to make changes to fields and then re-weave, but we can be of different opinions.
lollo2
17th October 2024, 15:19
But when I think about, I had the problems mainly in combination with later sharpening
Using LSFmod and CAS I did not see any problem, but YMMV ;)
edit: here the same video as before but with LSFmod added to the processing: https://drive.google.com/file/d/1qavkxONOlLfpt9aOmRKiWzfAWJ0duRkq/view?usp=sharing
Anyway I would always prefer not to make changes to fields and then re-weave, but we can be of different opinions.
As you said earlier, and I fully agree, the best is deinterlace-denoise-(shapen)-leave video deinterlaced.
Mine was just an example when people wish to keep the final video interlaced (there are some, knowledgeable users Sharc and johnmeyer just to mention a few)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.