rpicamsrc

Source element for capturing video from the Raspberry Pi camera module.

This element works the same way that the raspivid command-line utility does and has a similar feature set.

The element can output video in form of raw video frames or encoded as (M)JPEG or H.264 video. You can use the element properties to fine-tune the capture, image processing and encoding parameters.

Example pipelines

 gst-launch-1.0 -v rpicamsrc preview=true ! fakesink

should show a preview window on the screen.

 gst-launch-1.0 -e rpicamsrc bitrate=1000000 ! h264parse ! matroskamux ! filesink location=test.mkv

should produce a file called test.mkv containing an H.264 video stream. We pass -e to gst-launch-1.0 so that the pipeline is finalised properly when interrupted with Control-C. This makes sure the Matroska file headers are updated when streaming ends.

 gst-launch-1.0 -e rpicamsrc bitrate=5000000 num-buffers=500 keyframe-interval=30 ! h264parse ! splitmuxsink location=video%02d.mov max-size-time=10000000000 max-size-bytes=1000000

Records a video stream captured from the Raspberry Pi camera module and muxes it into ISO mp4 files, splitting as needed to limit size/duration to 10 seconds and 1MB maximum size.

gst-launch-1.0 -e rpicamsrc ! image/jpeg,framerate=1/1 ! multifilesink location=image-%05d.jpg ]| Captures a stream of JPEG images from the Raspberry Pi camera module at a rate of 1 frame per second and writes each frame into a new file in the current directory, starting with image-00000.jpg, then image-00001.jpg etc.

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBaseSrc
                    ╰──GstPushSrc
                        ╰──rpicamsrc

Implemented interfaces

Factory details

Authors: – Jan Schmidt

Classification:Source/Video

Rank – none

Plugin – rpicamsrc

Package – GStreamer Good Plug-ins

Pad Templates

src

video/x-h264:
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]
  stream-format: byte-stream
      alignment: nal
        profile: { (string)constrained-baseline, (string)baseline, (string)main, (string)high }
image/jpeg:
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]
video/x-raw:
         format: { I420, RGB, BGR, RGBA }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]

Presencealways

Directionsrc

Object typeGstPad


Properties

annotation-mode

“annotation-mode” GstRpiCamSrcAnnotationMode *

Flags to control annotation of the output video

Flags : Read / Write

Default value : (none)


annotation-text

“annotation-text” gchararray

Text string to annotate onto video when annotation-mode flags include 'custom-text'

Flags : Read / Write


annotation-text-bg-colour

“annotation-text-bg-colour” gint

Set the annotation text background colour, as the integer corresponding to a VUY value eg 0x8080FF = 8421631, -1 for default

Flags : Read / Write

Default value : -1


annotation-text-colour

“annotation-text-colour” gint

Set the annotation text colour, as the integer corresponding to a VUY value eg 0x8080FF = 8421631, -1 for default

Flags : Read / Write

Default value : -1


annotation-text-size

“annotation-text-size” gint

Set the size of annotation text (in pixels) (0 = Auto)

Flags : Read / Write

Default value : 0


awb-gain-blue

“awb-gain-blue” gfloat

Manual AWB Gain for blue channel when awb-mode=off

Flags : Read / Write

Default value : 0


awb-gain-red

“awb-gain-red” gfloat

Manual AWB Gain for red channel when awb-mode=off

Flags : Read / Write

Default value : 0


awb-mode

“awb-mode” GstRpiCamSrcAWBMode *

White Balance mode

Flags : Read / Write

Default value : auto (1)


bitrate

“bitrate” gint

Bitrate for encoding. 0 for VBR using quantisation-parameter

Flags : Read / Write

Default value : 17000000


brightness

“brightness” gint

Image capture brightness

Flags : Read / Write

Default value : 50


camera-number

“camera-number” gint

Which camera to use on a multi-camera system - 0 or 1

Flags : Read / Write

Default value : 0


contrast

“contrast” gint

Image capture contrast

Flags : Read / Write

Default value : 0


drc

“drc” GstRpiCamSrcDRCLevel *

Dynamic Range Control level

Flags : Read / Write

Default value : off (0)


exposure-compensation

“exposure-compensation” gint

Exposure Value compensation

Flags : Read / Write

Default value : 0


exposure-mode

“exposure-mode” GstRpiCamSrcExposureMode *

Camera exposure mode to use

Flags : Read / Write

Default value : auto (1)


fullscreen

“fullscreen” gboolean

Display preview window full screen

Flags : Read / Write

Default value : true


hflip

“hflip” gboolean

Flip capture horizontally

Flags : Read / Write

Default value : false


image-effect

“image-effect” GstRpiCamSrcImageEffect *

Visual FX to apply to the image

Flags : Read / Write

Default value : none (0)


inline-headers

“inline-headers” gboolean

Set to TRUE to insert SPS/PPS before each IDR packet

Flags : Read / Write

Default value : false


intra-refresh-type

“intra-refresh-type” GstRpiCamSrcIntraRefreshType *

Type of Intra Refresh to use, -1 to disable intra refresh

Flags : Read / Write

Default value : none (-1)


iso

“iso” gint

ISO value to use (0 = Auto)

Flags : Read / Write

Default value : 0


keyframe-interval

“keyframe-interval” gint

Interval (in frames) between I frames. -1 = automatic, 0 = single-keyframe

Flags : Read / Write

Default value : -1


metering-mode

“metering-mode” GstRpiCamSrcExposureMeteringMode *

Camera exposure metering mode to use

Flags : Read / Write

Default value : average (0)


preview

“preview” gboolean

Display preview window overlay

Flags : Read / Write

Default value : true


preview-encoded

“preview-encoded” gboolean

Display encoder output in the preview

Flags : Read / Write

Default value : true


preview-h

“preview-h” gint

Height of the preview window (in pixels)

Flags : Read / Write

Default value : 768


preview-opacity

“preview-opacity” gint

Opacity to use for the preview window

Flags : Read / Write

Default value : 255


preview-w

“preview-w” gint

Width of the preview window (in pixels)

Flags : Read / Write

Default value : 1024


preview-x

“preview-x” gint

Start X coordinate of the preview window (in pixels)

Flags : Read / Write

Default value : 0


preview-y

“preview-y” gint

Start Y coordinate of the preview window (in pixels)

Flags : Read / Write

Default value : 0


quantisation-parameter

“quantisation-parameter” gint

Set a Quantisation Parameter approx 10-40 with bitrate=0 for VBR encoding. 0 = off

Flags : Read / Write

Default value : 0


roi-h

“roi-h” gfloat

Normalised region-of-interest H coord

Flags : Read / Write

Default value : 1


roi-w

“roi-w” gfloat

Normalised region-of-interest W coord

Flags : Read / Write

Default value : 1


roi-x

“roi-x” gfloat

Normalised region-of-interest X coord

Flags : Read / Write

Default value : 0


roi-y

“roi-y” gfloat

Normalised region-of-interest Y coord

Flags : Read / Write

Default value : 0


rotation

“rotation” gint

Rotate captured image (0, 90, 180, 270 degrees)

Flags : Read / Write

Default value : 0


saturation

“saturation” gint

Image capture saturation

Flags : Read / Write

Default value : 0


sensor-mode

“sensor-mode” GstRpiCamSrcSensorMode *

Manually set the camera sensor mode

Flags : Read / Write

Default value : automatic (0)


sharpness

“sharpness” gint

Image capture sharpness

Flags : Read / Write

Default value : 0


shutter-speed

“shutter-speed” gint

Set a fixed shutter speed, in microseconds. (0 = Auto)

Flags : Read / Write

Default value : 0


use-stc

“use-stc” gboolean

Use the camera STC for timestamping buffers

Flags : Read / Write

Default value : true


vflip

“vflip” gboolean

Flip capture vertically

Flags : Read / Write

Default value : false


video-stabilisation

“video-stabilisation” gboolean

Enable or disable video stabilisation

Flags : Read / Write

Default value : false


Named constants

GstRpiCamSrcAWBMode

Members

off (0) – GST_RPI_CAM_SRC_AWB_MODE_OFF
auto (1) – GST_RPI_CAM_SRC_AWB_MODE_AUTO
sunlight (2) – GST_RPI_CAM_SRC_AWB_MODE_SUNLIGHT
cloudy (3) – GST_RPI_CAM_SRC_AWB_MODE_CLOUDY
shade (4) – GST_RPI_CAM_SRC_AWB_MODE_SHADE
tungsten (5) – GST_RPI_CAM_SRC_AWB_MODE_TUNGSTEN
fluorescent (6) – GST_RPI_CAM_SRC_AWB_MODE_FLUORESCENT
incandescent (7) – GST_RPI_CAM_SRC_AWB_MODE_INCANDESCENT
flash (8) – GST_RPI_CAM_SRC_AWB_MODE_FLASH
horizon (9) – GST_RPI_CAM_SRC_AWB_MODE_HORIZON

GstRpiCamSrcAnnotationMode

Members

custom-text (0x00000001) – GST_RPI_CAM_SRC_ANNOTATION_MODE_CUSTOM_TEXT
text (0x00000002) – GST_RPI_CAM_SRC_ANNOTATION_MODE_TEXT
date (0x00000004) – GST_RPI_CAM_SRC_ANNOTATION_MODE_DATE
time (0x00000008) – GST_RPI_CAM_SRC_ANNOTATION_MODE_TIME
shutter-settings (0x00000010) – GST_RPI_CAM_SRC_ANNOTATION_MODE_SHUTTER_SETTINGS
caf-settings (0x00000020) – GST_RPI_CAM_SRC_ANNOTATION_MODE_CAF_SETTINGS
gain-settings (0x00000040) – GST_RPI_CAM_SRC_ANNOTATION_MODE_GAIN_SETTINGS
lens-settings (0x00000080) – GST_RPI_CAM_SRC_ANNOTATION_MODE_LENS_SETTINGS
motion-settings (0x00000100) – GST_RPI_CAM_SRC_ANNOTATION_MODE_MOTION_SETTINGS
frame-number (0x00000200) – GST_RPI_CAM_SRC_ANNOTATION_MODE_FRAME_NUMBER
black-background (0x00000400) – GST_RPI_CAM_SRC_ANNOTATION_MODE_BLACK_BACKGROUND

GstRpiCamSrcDRCLevel

Members

off (0) – GST_RPI_CAM_SRC_DRC_LEVEL_OFF
low (1) – GST_RPI_CAM_SRC_DRC_LEVEL_LOW
medium (2) – GST_RPI_CAM_SRC_DRC_LEVEL_MEDIUM
high (3) – GST_RPI_CAM_SRC_DRC_LEVEL_HIGH

GstRpiCamSrcExposureMeteringMode

Members

average (0) – GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_AVERAGE
spot (1) – GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_SPOT
backlist (2) – GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_BACKLIST
matrix (3) – GST_RPI_CAM_SRC_EXPOSURE_METERING_MODE_MATRIX

GstRpiCamSrcExposureMode

Members

off (0) – GST_RPI_CAM_SRC_EXPOSURE_MODE_OFF
auto (1) – GST_RPI_CAM_SRC_EXPOSURE_MODE_AUTO
night (2) – GST_RPI_CAM_SRC_EXPOSURE_MODE_NIGHT
nightpreview (3) – GST_RPI_CAM_SRC_EXPOSURE_MODE_NIGHTPREVIEW
backlight (4) – GST_RPI_CAM_SRC_EXPOSURE_MODE_BACKLIGHT
spotlight (5) – GST_RPI_CAM_SRC_EXPOSURE_MODE_SPOTLIGHT
sports (6) – GST_RPI_CAM_SRC_EXPOSURE_MODE_SPORTS
snow (7) – GST_RPI_CAM_SRC_EXPOSURE_MODE_SNOW
beach (8) – GST_RPI_CAM_SRC_EXPOSURE_MODE_BEACH
verylong (9) – GST_RPI_CAM_SRC_EXPOSURE_MODE_VERYLONG
fixedfps (10) – GST_RPI_CAM_SRC_EXPOSURE_MODE_FIXEDFPS
antishake (11) – GST_RPI_CAM_SRC_EXPOSURE_MODE_ANTISHAKE
fireworks (12) – GST_RPI_CAM_SRC_EXPOSURE_MODE_FIREWORKS

GstRpiCamSrcImageEffect

Members

none (0) – GST_RPI_CAM_SRC_IMAGEFX_NONE
negative (1) – GST_RPI_CAM_SRC_IMAGEFX_NEGATIVE
solarize (2) – GST_RPI_CAM_SRC_IMAGEFX_SOLARIZE
posterize (3) – GST_RPI_CAM_SRC_IMAGEFX_POSTERIZE
whiteboard (4) – GST_RPI_CAM_SRC_IMAGEFX_WHITEBOARD
blackboard (5) – GST_RPI_CAM_SRC_IMAGEFX_BLACKBOARD
sketch (6) – GST_RPI_CAM_SRC_IMAGEFX_SKETCH
denoise (7) – GST_RPI_CAM_SRC_IMAGEFX_DENOISE
emboss (8) – GST_RPI_CAM_SRC_IMAGEFX_EMBOSS
oilpaint (9) – GST_RPI_CAM_SRC_IMAGEFX_OILPAINT
hatch (10) – GST_RPI_CAM_SRC_IMAGEFX_HATCH
gpen (11) – GST_RPI_CAM_SRC_IMAGEFX_GPEN
pastel (12) – GST_RPI_CAM_SRC_IMAGEFX_PASTEL
watercolour (13) – GST_RPI_CAM_SRC_IMAGEFX_WATERCOLOUR
film (14) – GST_RPI_CAM_SRC_IMAGEFX_FILM
blur (15) – GST_RPI_CAM_SRC_IMAGEFX_BLUR
saturation (16) – GST_RPI_CAM_SRC_IMAGEFX_SATURATION
colourswap (17) – GST_RPI_CAM_SRC_IMAGEFX_COLOURSWAP
washedout (18) – GST_RPI_CAM_SRC_IMAGEFX_WASHEDOUT
posterise (19) – GST_RPI_CAM_SRC_IMAGEFX_POSTERISE
colourpoint (20) – GST_RPI_CAM_SRC_IMAGEFX_COLOURPOINT
colourbalance (21) – GST_RPI_CAM_SRC_IMAGEFX_COLOURBALANCE
cartoon (22) – GST_RPI_CAM_SRC_IMAGEFX_CARTOON

GstRpiCamSrcIntraRefreshType

Members

none (-1) – GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_NONE
cyclic (0) – GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_CYCLIC
adaptive (1) – GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_ADAPTIVE
both (2) – GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_BOTH
cyclic-rows (2130706433) – GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_CYCLIC_ROWS

GstRpiCamSrcSensorMode

Members

automatic (0) – Automatic
1920x1080 (1) – 1920x1080 16:9 1-30fps
2592x1944-fast (2) – 2592x1944 4:3 1-15fps / 3240x2464 15fps w/ v.2 board
2592x1944-slow (3) – 2592x1944 4:3 0.1666-1fps / 3240x2464 15fps w/ v.2 board
1296x972 (4) – 1296x972 4:3 1-42fps
1296x730 (5) – 1296x730 16:9 1-49fps
640x480-slow (6) – 640x480 4:3 42.1-60fps
640x480-fast (7) – 640x480 4:3 60.1-90fps

The results of the search are