View Full Version : Deinterlace and interpolate RGB channels
otherman
26th May 2014, 18:00
Hi!
I've this source (https://mega.co.nz/#!BpllATRZ!3h_5JjUD4KsQ33-lUdt3SAQI-4Mjjaj54IP-IlYy854)
It's interlaced, and this is simple to resolve; the real problem is that odd fields lack blue channel, and the even fields lack red channel.
Before deinterlacing, I need to interpolate the blue channel from the even and put it on the odd fields, and interpolate the red channel from the odd fields and put it on the even.
Green channel is present in the odd and in the even fields, so it has full temphoral resolution, and I would like to use it to make a full motion estimation for red and blue channels interpolation.
I've a preatty cleare idea on how to do it with MVFlowFps, but I can't make this complex script. Anyone can help me?
otherman
27th May 2014, 09:20
I'm so near!
I've sinthetized the new red channel, but I'm getting a ghosts of original frames too. Please, help me to delete them.
this is my scrpit
###################################
#this first part is to make any normal source look like my case
###################################
original=YOUR_SOURCE.ConvertToRGB.AssumeFPS(24).separatefields
originalR=original.selectodd.selectodd.RGBAdjust(1.0, 1.0, 0).AssumeFPS(12)
originalB=original.selecteven.selecteven.RGBAdjust(0, 1.0, 1.0).AssumeFPS(12)
interlaced=interleave(originalB, originalR).AssumeFPS(12).weave
###################################
#now "extract" odd field red channel
#even field blue channel
#and full green channel
###################################
r12=interlaced.separatefields.selectodd.showred.ConvertToYV12
b12=interlaced.separatefields.selecteven.showblue.ConvertToYV12
fullg=interlaced.showgreen.Bob().ConvertToYV12.BilinearResize(interlaced.width, interlaced.height/2).AssumeFPS(24)
###################################
#the tricky part
###################################
fullg
super = MSuper(pel=2)
coso2= Msuper(r12, pel=2)
backward_vec = MAnalyse(super, overlap=4, isb = true, search=3).selectodd
forward_vec = MAnalyse(super, overlap=4, isb = false, search=3).selectodd
r12
MFlowFps(coso2, backward_vec, forward_vec, num=12)
foxyshadis
27th May 2014, 11:23
If you're talking about that clip you uploaded, that's because the channels have an extreme amount of ghosting already present. I gave it a few shots but the red and blue channels just seem completely broken, possibly due to encoding interlaced material as progressive. You seem to be re-encoding into divx everything you upload asking for help, can you stop that? Use UT Video, HuffYUV, or anything that supports interlaced encoding.
otherman
27th May 2014, 12:06
Ok, sorry for that. Otherwise, the source I posted is made with the first part of the script.
I need this script for a source that actualy not exists yet XD
And it never will if I don't find a solution for this case-scenario: it's a project for a new function "Magic Lantern" firmware for Canon cameras.
Reel.Deel
27th May 2014, 12:58
showred.ConvertToYV12
use ShowRed("YV12"), it's faster and more correct.
Hint: ShowRed("YV12") is a lot faster than ShowRed().ConvertToYV12()
It's also more correct here, as it will preserve the 0-255 range instead of converting to 16-235.
otherman
29th May 2014, 16:56
thank you: it helped with ghost in some way also, but it is still there :(
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.