[ANSWERED] Deinterlacing
-
Hi, I have some badly encoded videos and want an up to date way to deinterlace, is there anything availabe that is GPU accelarated for Isadora?
-
I couldn't think of anything instantly, so I did a quick search, found an ISF shader, and converted it.
// CREDIT: by zoidberg uniform sampler2D tex0; uniform vec2 resolution; const vec2 pointOffset = vec2(0.0, 1.0); void main() { vec4 outColor; // "upper" (a.k.a. "the top row") if (fract((gl_FragCoord.y+0.5)/2.0) == 0.0) { //gl_FragColor = vec4(1,0,0,1); outColor = (texture2D(tex0, (gl_FragCoord.xy)/resolution) + texture2D(tex0, (gl_FragCoord.xy - pointOffset)/resolution))/2.0; gl_FragColor = outColor; } // "lower" (a.k.a. "the bottom row") else { //gl_FragColor = vec4(0,1,0,1); outColor = (texture2D(tex0, (gl_FragCoord.xy)/resolution) + texture2D(tex0, (gl_FragCoord.xy + pointOffset)/resolution))/2.0; gl_FragColor = outColor; } }
From a quick test it seems to work. Of course you may get better results deinterlacing in Shutter Encoder or another non real-time tool.
-
@dusx said:
// CREDIT: by zoidberg uniform sampler2D tex0; uniform vec2 resolution; const vec2 pointOffset = vec2(0.0, 1.0); void main() { vec4 outColor; // "upper" (a.k.a. "the top row") if (fract((gl_FragCoord.y+0.5)/2.0) == 0.0) { //gl_FragColor = vec4(1,0,0,1); outColor = (texture2D(tex0, (gl_FragCoord.xy)/resolution) + texture2D(tex0, (gl_FragCoord.xy - pointOffset)/resolution))/2.0; gl_FragColor = outColor; } // "lower" (a.k.a. "the bottom row") else { //gl_FragColor = vec4(0,1,0,1); outColor = (texture2D(tex0, (gl_FragCoord.xy)/resolution) + texture2D(tex0, (gl_FragCoord.xy + pointOffset)/resolution))/2.0; gl_FragColor = outColor; } }
Hey thanks a lot! works ok for my puposes, I just needed a fast realt time solution, all the files will be re-encoded correctly some time.
Cheers
Fred