GStreamer OpenCL Bayer to RGB converter

From RidgeRun Developer Connection
Jump to: navigation, search

RR Eval SDK download button.png RR Pre built demo image download.png RR Contact Us.png


This wiki describes the OpenCL accelerated GStreamer Bayer to RGB conversion element, along with benchmarking information and example pipelines. The plug-in allows you to leverage the processing power of the IMX6 GP-GPU to perform real-time Full HD Bayer to RGB conversion. It adds the capability to link sensors that deliver Bayer content into your pipeline without compromising real time performance. The OpenCL and GStreamer integration enable a zero-memcopy buffer flow so data can be delivered between the different hardware accelerators in the platforms.

  • Bayer to RGB
  • 30 fps @ 1080p
  • No memory copies
  • Friendly with other HW accelerators
  • GStreamer 1.X

Plugin Performance

The following table shows the time needed to debayer one single frame for several resolutions using a nearest neighbour algorithm:

Resolution Debayering time (ms) Theoretical maximum Framerate (fps)
2592x1944 55 15
1920x1080 25 30
1280x720 13 60
640x480 4.5 200

Sample pipelines

These are some sample pipelines using the bayer to rgb plugin.

  • 640x480 videotestsrc in
gst-launch-1.0 videotestsrc is-live=true ! 'video/x-bayer,width=640,height=480,framerate=30/1,format=bggr' ! \
queue ! clbayer2rgb ! 'video/x-raw,width=640,height=480,format=RGBA'  ! queue ! imxg2dvideosink sync=false -v
  • 720p from file
gst-launch-1.0 filesrc blocksize=921600 location=720p-bayer.bggr ! 'video/x-bayer,width=1280,height=720,framerate=30/1,format=bggr' ! \
queue ! clbayer2rgb ! 'video/x-raw,width=1280,height=720,format=RGBA'  ! queue ! imxg2dvideosink sync=false -v
  • Camera loopback
gst-launch-1.0 v4l2src ! 'video/x-bayer,width=1920,height=1080,framerate=30/1,format=bggr' ! \
queue ! clbayer2rgb ! 'video/x-raw,width=1920,height=1080,format=RGBA'  ! queue ! imxg2dvideosink sync=false -v