Video filter to slightly shift R, G and B
|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]|
On Tue, Apr 27, 2010 at 05:31:48PM +0200, Yann Pomarede wrote: > I have an LCD video-projector, and as on almost all video-projector, > the 3 matrix are not perfectly aligned (or maybe it is related to > optical diffraction ?) but there is a shift (less than 1 pixel) > between red, green and blue. The resulting effect can be seen on the > following photo: > http://www.gemibox.net/upload/rgb_shift.jpg > > I'm used to Windows, and there are 2 ways to get rid of this problem: > either using Haali renderer that can shift cyan and magenta, or using > Media Player Classic and a custom Pixel Shader filter that do almost > the same (but with R, G and B) using the graphic card. An example of > pixel shader code to do this can be seen here: > http://pastebin.com/dMs33c99 > > I looked on Google but could not find any way to do this with mplayer? > Would it be difficult to develop a new filter? MPlayer -vo gl has customprog option allowing to write your own programs. However the one you linked above went the lazy way and will cause rather high CPU load (since the CPU has to convert to RGB). As a starting point, mplayer -vo gl -v -v will print "[gl] generated fragment program:" and after that the one it uses (will change depending on other -vo gl options) and TOOLS/*.fp are a few more samples. However all include YUV->RGB conversion, which makes them a bit more complex. Shiftng cyan and magenta is relatively simple for those, the parts like TEX yuv.g, fragment.texcoord, texture, 2D; TEX yuv.b, fragment.texcoord, texture, 2D; need to be changed to add an offset to fragment.texcoord first.