Log in

View Full Version : Processing every 5th frame


jcsston
4th December 2002, 04:57
I have a video I captured at 320x480 Mpeg-2 but the chroma channels on some frames is off.
So I looked thru my video (tossing out the second field which is fine) and noticed the chroma is off was every 5 frames and lasted for one frame.
So every 5th frame I want to replace the Chroma for that frame only with the next frame's chroma.
How could I do this?

Something like this
If FrameNo / 5 = Int(FrameNo / 5) Then MergeChroma(FrameNo,FrameNo+1)

Is this possible in AviSynth?

stickboy
4th December 2002, 10:37
I haven't tested it, but off the top of my head, something along the lines of:
function foo(clip c)
{
c0 = c.SelectEvery(5, 0)
c1 = c.SelectEvery(5, 1)
c2 = c.SelectEvery(5, 2)
c3 = c.SelectEvery(5, 3)
c4 = c.SelectEvery(5, 4)

fixedc4 = MergeChroma(c4, c0.Trim(1, 0), 1)
return Interleave(c0, c1, c2, c3, fixedc4)
}might work. There are probably better ways, though.

jcsston
5th December 2002, 01:35
thanks, that worked