Debayering (bayer 2 rgb) with opengl glshader gst-1.5.1

Christian Sell christian at gsvitec.com
Wed Aug 19 05:05:14 PDT 2015


I have verified it: to do any rendering at all, a GL program must consist of at
least a vertex and a fragment shader. These work together. Roughly speaking, the
vertex shader determines the working position, and the fragment shader
determines the work to be done at that position.
 

> Christian Sell <christian at gsvitec.com> hat am 19. August 2015 um 13:58
> geschrieben:
> 
>  Hi,
>   
>  I am not the ultimate expert on GL shader programming, but I dont think you
> can do without a vertex shader at all. In the particular case of the
> debayering stuff, the vertex shader computes the values of xCoord, yCoord and
> center based on the previously mentioned input parameters. These values are
> then used by the pixel shader. So unless the input parameters are correctly
> set, nothing will work.
>   
>  chris
> 
>   > > Hamdi Rakkez <hamdi.rakez.selotec at gmail.com> hat am 19. August 2015 um
>   > > 13:26 geschrieben:
> > 
> >   Great explanation Christian.
> >       * Actually I am using only the pixel shader file.
> >       * The source is successfully entered from gstreamer to the shader.
> >       * SourceSize and first red are in the vertex shader which I am not
> > using.
> >   Question :
> >       * Is it necessary, for the debayering to work, to use both files
> > (vertex and pixel shader). If yes, is it possible to have them both in one
> > file so I can deal with input parameters statically.
> >   thanks.
> >    
> >   Best,
> >   Hamdi
> >    
> > 
> >   On Wed, Aug 19, 2015 at 12:15 PM, Christian Sell <christian at gsvitec.com
> > <mailto:christian at gsvitec.com> > wrote:
> >     > > >     Hello,
> > >      
> > >     I am not sure how the glshader element works, but I do know how that
> > > shader program works, because we are successfully using it. Actually, we
> > > are using the GL variant for client-side debayering (outside of gstreamer,
> > > immediately before the data is displayed) and the CL variant for
> > > debayering inside the gstreamer pipeline with a custom element.
> > >      
> > >     There are 2 things I am doubtful with regard to the glshader element:
> > >      
> > >     1. the debayering code consists of a vertex and a pixel (aka fragment)
> > > shader. How are these integrated into glshader?
> > >     2. the code expects several parameters to be set from the outside,
> > > namely "source" (input buffer), "sourceSize" (an array with values width,
> > > height, 1/width, 1/height) and "firstRed" (a 0/1 combination describing
> > > the bayer pattern in use)
> > >      
> > >     I dont see how these prerequistes would be met by glshader..
> > >      
> > >     regards,
> > >     Chris
> > >      
> > > 
> > >      > > > > Hamdi Rakkez <hamdi.rakez.selotec at gmail.com
> > >      > > > > <mailto:hamdi.rakez.selotec at gmail.com> > hat am 19. August
> > >      > > > > 2015 um 12:06 geschrieben:
> > > > 
> > > > 
> > > >      Hi,
> > > >       
> > > >      I am trying to use shaders to decode bayer images to RGB images.
> > > >       
> > > >      I don't want to use the bayer2rgb element.
> > > >       
> > > >      So, according to this
> > > > http://graphics.cs.williams.edu/papers/BayerJGT09/#shaders it is
> > > > possible to user gl shaders for demosaicing a bayer image.
> > > >       
> > > >      I have used the shader file along with glshader in a pipeline like
> > > > this :
> > > >       
> > > >        > > > > > ​gst-launch-1.0 -v filesrc location=bayer_file.avi !
> > > >        > > > > > avidemux ! ​glupload ! glshader location=bayerRGB.GLSL
> > > >        > > > > > ! glimagesink​
> > > > >      > > > >       
> > > >       
> > > >      But, I have a very noisy result, and an image of the result is
> > > > attached to this Email.​
> > > >       
> > > >      Any ideas why such behavior.
> > > >       
> > > >      Thank you
> > > >      _______________________________________________
> > > >      gstreamer-devel mailing list
> > > >      gstreamer-devel at lists.freedesktop.org
> > > > <mailto:gstreamer-devel at lists.freedesktop.org>
> > > >      http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > > > 
> > > >     > > > 
> > >     _______________________________________________
> > >     gstreamer-devel mailing list
> > >     gstreamer-devel at lists.freedesktop.org
> > > <mailto:gstreamer-devel at lists.freedesktop.org>
> > >     http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > >   > >   _______________________________________________
> >   gstreamer-devel mailing list
> >   gstreamer-devel at lists.freedesktop.org
> >   http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > 
> >  > 
>   
>  Christian Sell
> 
>  GS Vitec GmbH
>  Im Ziegelhaus 6-8
>  D-63571 Gelnhausen
> 
>  mail: christian at gsvitec.com
>  mobil: +49 (0) 173 5384289
> 
>  Tel: +49 (0) 6051 601.26-90
>  Fax: +49 (0) 6051 601.26-91
> 

 

> _______________________________________________
>  gstreamer-devel mailing list
>  gstreamer-devel at lists.freedesktop.org
>  http://lists.freedesktop.org/
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150819/7e055b02/attachment-0001.html>


More information about the gstreamer-devel mailing list