glshader
OpenGL fragment shader filter
Examples
gst-launch-1.0 videotestsrc ! glupload ! glshader fragment="\"`cat myshader.frag`\"" ! glimagesink
FBO (Frame Buffer Object) and GLSL (OpenGL Shading Language) are required.
Depending on the exact OpenGL version chosen and the exact requirements of
the OpenGL implementation, a #version
header may be required.
The following is a simple OpenGL ES (also usable with OpenGL 3 core contexts) passthrough shader with the required inputs.
#version 100
#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 );
}
Hierarchy
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBaseTransform ╰──GstGLBaseFilter ╰──GstGLFilter ╰──glshader
Factory details
Authors: –
Classification: – Filter/Effect
Rank – none
Plugin – opengl
Package – GStreamer Base Plug-ins
Pad Templates
sink
video/x-raw(ANY):
format: RGBA
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
texture-target: 2D
video/x-raw(memory:GLMemory):
format: RGBA
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
texture-target: 2D
src
video/x-raw(memory:GLMemory):
format: RGBA
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
texture-target: 2D
video/x-raw(ANY):
format: RGBA
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
texture-target: 2D
Signals
create-shader
GstGLShader * create_shader_callback (GstElement * param_0, gpointer udata)
def create_shader_callback (param_0, udata):
#python callback for the 'create-shader' signal
function create_shader_callback(param_0: GstElement * param_0, udata: gpointer udata): {
// javascript callback for the 'create-shader' signal
}
Parameters:
param_0
–
udata
–
No description available
Flags: Run Last
Properties
update-shader
“update-shader” gboolean
Emit the 'create-shader' signal for the next frame
Flags : Read / Write
Default value : false
The results of the search are