My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links

About

This project hosts Elphel cameras related gstreamer components, so far:

  • the jp462bayer plugin converts color and monochrome JP46 Elphel bitstreams to Bayer raw format
  • bayer2rgb2 converts raw Bayer streams to RGB images

For information about JP4 and demosaicing, see WhyJP4

This project is sponsored by Ubicast.

jp462bayer: JP4 to Bayer

After jpegdec, re-arranges the pixels in Bayer format.

Features:

  • fast downscaling algorithm, with which a simultaneous full quality raw capture and a smaller quality preview can be done without the need for full frame decoding
  • multithreading (1-4 threads) by using the threads property

bayer2rgb2 debayer

It offers the same features as the legacy bayer2rgb, but by wrapping Libdc1394's debayering algorithms you can choose the interpoloation algorithm between : simple, bilinear, hqlinear, downsample, edgesense, vng, ahd, nearest.

TODOs

  • other JP4 modes handling (JP4, JP4-HDR, ...)
  • integrate alternative debayer methods

Usage

Installing

To compile, see HowToInstall

Pre-compiled binaries (for 32 bits, 0.10.28 Gstreamer) are also available in the downloads section:

Put them into the ~/.gstreamer-0.10/plugins directory (create it if it does not exist yet).

Jp462bayer options

threads : Number of threads used by the plugin (0 for automatic). Currently, fast downsampling is disabled if the number of threads > 1; when using fast downsampling, use threads=1

Debayering options

gst-inspect bayer2rgb2:

method: Demosaicing interpolation algorithm
Enum "GstMethodeRGB" Default: 0, Current: 0,
  • (0): Bilinear - Bilinear (orced version)
  • (1): Hqlinear - Hqlinear
  • (2): Downsample - Downsample
  • (3): Edgesense - Edgesense
  • (4): Vng - Vng
  • (5): Ahd - Ahd

Note: since bayer2rgb2-0.6, Bilinear (0) is now the default, and the algorithm used has switched from libdc1394's implentation to David Schleef's accelerated implementation using ORC, which is blazing fast.

bpp: bits per pixel in raw sensor data
FALSE = 8 bpp, TRUE = 16 bpp. flags: accès en lecture, accès en écriture Boolean. Default: false Current: false

pixel order is defined by using bayer caps, e.g. "video/x-raw-bayer, width=(int)960, height=(int)544, framerate=(fraction)24/1, format=(string)grbg"

Example pipelines

Assuming that elphel is in your /etc/hosts file, pointing to the correct IP address:

  • Live decoding and preview using multithreading

gst-launch-0.10 rtspsrc location=rtsp://elphel:554 protocols=0x00000001 latency=100 ! rtpjpegdepay ! jpegdec ! queue ! jp462bayer ! "video/x-raw-bayer, width=(int)1920, height=(int)1088, format=(string)grbg" ! queue ! bayer2rgb2 method=1 ! ffmpegcolorspace ! queue ! xvimagesink

For fast image resizing, use caps after jp462bayer; note that for image reduction to work, target caps need to be the original resolution divided by 4 or 16 and threads=1.

  • With 1920x1088 live stream and resizing by 4 single-threaded
gst-launch-0.10 rtspsrc location=rtsp://elphel:554 protocols=0x00000001 latency=100 ! rtpjpegdepay ! jpegdec ! queue ! jp462bayer ! "video/x-raw-bayer, width=(int)960, height=(int)544, format=(string)grbg" ! queue ! bayer2rgb2 method=1 ! ffmpegcolorspace ! queue ! xvimagesink

  • With 1920x1088 live stream and resizing by 16

gst-launch-0.10 rtspsrc location=rtsp://elphel:554 protocols=0x00000001 latency=100 ! rtpjpegdepay ! jpegdec ! queue ! jp462bayer ! "video/x-raw-bayer, width=(int)480, height=(int)272, format=(string)grbg" ! queue ! bayer2rgb2 method=1 ! ffmpegcolorspace ! queue ! xvimagesink

  • Simultaneous raw dump & small scale preview

gst-launch-0.10 rtspsrc location=rtsp://elphel:554 protocols=0x00000001 latency=100 ! rtpjpegdepay ! tee name=raw_tee ! queue ! jpegdec ! queue ! jp462bayer ! "video/x-raw-bayer, width=(int)480, height=(int)272, format=(string)grbg" ! queue ! bayer2rgb2 method=1 ! ffmpegcolorspace ! queue ! xvimagesink raw_tee. ! queue ! videorate ! "image/jpeg, width=(int)1920, height=(int)1088, framerate=(fraction)25/1" ! matroskamux ! filesink location=jp46test.mkv -e

gst-launch-0.10 filesrc location=fruits.jp4 ! jpegdec ! queue ! jp462bayer threads=2 ! queue ! bayer2rgb2 ! queue ! ffmpegcolorspace ! freeze ! xvimagesink

gst-launch-0.10 filesrc location=jp46test.mkv ! decodebin ! ffmpegcolorspace ! queue ! jp462bayer ! "video/x-raw-bayer, width=(int)1920, height=(int)1088, format=(string)grbg" ! queue ! bayer2rgb2 method=1 ! queue ! ffmpegcolorspace ! xvimagesink

  • Converting the file with high quality (VNG) debayering

gst-launch filesrc location=jp46test.mkv ! decodebin ! ffmpegcolorspace ! queue ! jp462bayer ! "video/x-raw-bayer, width=(int)1920, height=(int)1088, format=(string)grbg" ! queue ! bayer2rgb2 method=5 ! queue ! ffmpegcolorspace ! "video/x-raw-yuv, format=(fourcc)YUY2, width=(int)1920, height=(int)1088, framerate=(fraction)25/1" ! jpegenc ! matroskamux ! filesink location=test.mkv

Powered by Google Project Hosting