GStreamer OpenCL Bayer to RGB converter

From RidgeRun Developer Wiki

Template:Eval SDK Download, Demo Image download and Contact Us buttons

Overview

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. To avoid memory copies, the upstream GStreamer element must put the bayer frame directly into GPU memory. Another way of stating this is the upstream element (likely the video capture element) needs to have user pointer support.

  • 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. Measurements taked using a quad core sabre lite board.

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