Color Saturation with openGL shaders

Matthew Waters ystreet00 at gmail.com
Tue Aug 11 04:47:52 PDT 2015


On 11/08/15 11:28, Hamdi Rakkez wrote:
> Hi,
>
> I'm using gstreamer1.5.1 on ubuntu 14.04.
>
> I want to know if it is possible to have a color saturation on a video
> stream with opengl shaders.

Sure, it's possible.  Two options

1. You can write your own shader and use the glshader element.
2. You can write an element based on glbasefilter/glfilter

Here's an example shader for use in the glshader element

#ifdef GL_ES
precision mediump float;
#endif
varying vec2 v_texcoord;
uniform sampler2D tex;
uniform float time;
uniform float width;
uniform float height;

void main () {
  gl_FragColor = texture2D( tex, v_texcoord ) * vec4(0.2, 0.8, 0.7, 1.0);
}

Cheers
-Matt

> Thanks.
>
> Best,
> Hamdi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150811/8ddae09b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150811/8ddae09b/attachment.sig>


More information about the gstreamer-devel mailing list