View Full Version : 2:3 Pulldown Removal from Blended Fields
otakusama
26th September 2010, 03:32
Hi, do you remember the option from Virtualdub "Reconstruct from Blurred Fields - Manual"? It really made wonders when a 24fps video was converted to 30fps and instead of deinterlacing it correctly, the fields were blended. But that option was deleted in the new versions of Virtualdub (v1.9.x), it was last used on the v1.8.8...
So my question is: Is any way to do this on AVIsynth? It would be very useful for reconstructing those kind of videos...
The theory is easy as far I understand, for example every 5 frames from a 2:3 pulldown "blended" clip:
T: A B C D D
B: A B B C D
look at them as frames, not fields because they are blended... as you can see, the frame C is blended with the frames B and D, making two blended frames: CB and DC. What I assume the filter should do is to somehow reconstruct the frame CB from BB, and reconstruct the frame DC from DD (I know there would be slight noise from both reconstructions though), and then merging the two results: (CB-BB)+(DC-DD), having this way the frame CC (with slight noise from the frames BB & DD, which is better than blended frames) and a unblended 24fps videoclip.
T: A B C D
B: A B C D
Why merging/averaging the two results instead of just select one of them, if they are supposed to be the very same frame? well I've seen that when the source isn't very clean (TV,VHS, sometimes DVD!) the only difference between these frames is the noise, which obviously we can't say which one looks better, it's just noise! (specially if CB & DC frames are reconstructed from BB & DD frames) even if they are the same frame, there'd be slight differences. so it'd be better to just blend them or to have a average from both reconstructed frames, don't you think so?
I hope I explained myself :)
maybe this is an idea for a new filter, or i don't know if this filter does exactly what i mean or if another filter already does this...
MrVideo
26th September 2010, 09:15
Hi, do you remember the option from Virtualdub "Reconstruct from Blurred Fields - Manual"? It really made wonders when a 24fps video was converted to 30fps and instead of deinterlacing it correctly, the fields were blended. But that option was deleted in the new versions of Virtualdub (v1.9.x), it was last used on the v1.8.8...
IMHO, you never deinterlace 2:3 pulldown material. Makes it extremely difficult to IVTC.
Before I continue, I need to understand that you mean by blended. I think my definition is different than yours.
otakusama
26th September 2010, 09:59
actually I just made some tests and I achieved some interesting results, very closed of what I wanted:
this is the blended frame:
http://img201.imageshack.us/img201/5034/blended.jpg (http://img201.imageshack.us/i/blended.jpg/)
and this is the recovered frame I obtained:
http://img201.imageshack.us/img201/553/recovered.jpg (http://img201.imageshack.us/i/recovered.jpg/)
you can see there're some artifacts from the recovering as I mention above, but it seems OK, I mean, that's better than having a blended frame
This is the script I used:
----------
scr=AVISource("videoclip.avi")
#first, I identify which frames are blended
f0=scr.selectevery(5, 0) #unblended frames
f1=scr.selectevery(5, 1) #temporal-blended frames
f2=scr.selectevery(5, 2) #blended frames
f3=scr.selectevery(5, 3) #blended frames
f4=scr.selectevery(5, 4) #unblended frames
#Then I subtract the difference between the frames
f01=subtract(f0,f1).invert()
f12=subtract(f1,f2)
f43=subtract(f4,f3)
#I recover the original frames
nf1=subtract(f01,f1).invert()
nf2=subtract(f12,f2).invert()
nf3=subtract(f3,f43)
#I blend the recovered frames for making this: 30fps->24fps
#I know I could have just selected one of them
#both are the same frame, but the only difference is the noise
#and as I can't decide which of the two to take, I just blend them :)
nf23=merge(nf2,nf3)
Interleave(f0, nf1, nf23, f4)
#interleaved and that's all :D
----------
it still need some optimization, maybe the invert() is not necessary but I'll verify that later... however it is still very close of what I wanted :)
do you have any other suggestions?
Didée
26th September 2010, 12:47
FixBlendIVTC() (http://avisynth.org/mediawiki/FixBlendIVTC) , or Srestore (http://avisynth.org/mediawiki/Srestore)(omode="pp1")
MrVideo
28th September 2010, 03:20
this is the blended frame:
Oh crap. That almost looks like a 25 fps PAL to 29.97 fps standards conversion. That kind of crap is done a lot when standards converting, in order to smooth the spatial motion.
Not what I was expecting. I have zero knowledge dealing with that kind of video.
txporter
28th September 2010, 18:44
I use a script like this to recover the 25fps frames from PAL-->NTSC blends:
LoadCPlugin("C:\Program Files\Avisynth 2.5\plugins\yadif.dll")
o = MPEG2Source("source.d2v")
y = o.yadif(mode=1,order=1)
tgmc = o.TempGaussMC_beta2(1,1,0,4,0,0,edimode="Yadif",Smode=1,SLmode=1,Sbb=0,SVthin=0.0,pelsearch=1)
tgmc.Srestore(frate=25.0,dclip=y)
and have been experimenting now with QTGMC as well (which seems to give comparable results with a sizable speed-up):
LoadCPlugin("C:\Program Files\Avisynth 2.5\plugins\yadif.dll")
o = MPEG2Source("source.d2v")
y = o.yadif(mode=1,order=1)
qtgmc = o.QTGMC(Preset="Ultra Fast",rep2=4,SLmode=1,SLrad=1)
qtgmc.Srestore(frate=25.0,dclip=y)
StainlessS
28th September 2010, 21:14
@otakusama
I personally have 3 different versions of VDUB on my machine, all accessible
via difference CTRL/ALT combinations. You could, if you really wanted,
get the old v1.8.8 to get back this functionality. I have VDUBMPEG2,
(Last version here: http://fcchandler.home.comcast.net/~fcchandler/stable/)
which has that, dont know where you might get the old official
version. Also note, from VDUB official v1.9.10, Video Framerate control,
"Inverse Telecine has been moved to IVTC video filter",
From that, I take it that what you seek, now resides in that filter.
I did have a cursory look at the filter list on Neuron2's site, but
could not locate it. Good luck. :)
Edit: No wonder I could not find it, it's now an internal filter named
IVTC with "Pattern Phase" options of 'Adaptive' or 'Manual' and "Offset
to first combed frame". Hope this is what you were looking for.
otakusama
29th September 2010, 02:14
@otakusama
I personally have 3 different versions of VDUB on my machine, all accessible
via difference CTRL/ALT combinations. You could, if you really wanted,
get the old v1.8.8 to get back this functionality. I have VDUBMPEG2,
(Last version here: http://fcchandler.home.comcast.net/~fcchandler/stable/)
which has that, dont know where you might get the old official
version. Also note, from VDUB official v1.9.10, Video Framerate control,
"Inverse Telecine has been moved to IVTC video filter",
From that, I take it that what you seek, now resides in that filter.
I did have a cursory look at the filter list on Neuron2's site, but
could not locate it. Good luck. :)
Edit: No wonder I could not find it, it's now an internal filter named
IVTC with "Pattern Phase" options of 'Adaptive' or 'Manual' and "Offset
to first combed frame". Hope this is what you were looking for.
Thanks, I know it was moved to IVTC filter, the problem is that it doesn't work with "blended frames" anymore :( it just does the work with interlaced fields... thank anyways :)
You're right, I have both versions the updated one and the last version that had the Inversed Telecine for blended frames, but it'd have been better if the VD author haven't dropped that useful functionality... and of course it'd be even better if it would be done from the avisynth script at first ;-)
specially in my case because I encode in other programs, not only in Virtualdub
I have been doing some tests with interesting results using essentially the internal avisynth filters: selectevery(), subtract() and invert(), like the script I posted before, this proved to be very useful when the blended patterns are predictable (which is my case, i wouldn't bother to deblend a irregular frame blending! :s )
the other filters that were mentioned are still useful though... but honestly I liked my way, it's simple... and I made it by myself! heheh XP
thanks everybody for all your help, I hope you'll find my method kind of useful
StainlessS
30th September 2010, 17:00
@otakusama
My Exblend() (see sig) plugin recovers frames that were thrown away during
a 24 or 25 FPS -> 30 or 29.97 FPS conversion of progressive to eg VCD,
where 2 blended frames were created using the frame that was eventually chucked
in the bin. Maybe some day I shall have a crack at this problem. ExBlend
does not rely on the sequence staying "in-sync".
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.