On this page:
3.10.1 Source Elements
3.10.1.1 videotestsrc
videotestsrc
videotestsrc?
videotest-pattern/  c
videotestsrc-pattern
set-videotestsrc-pattern!
videotestsrc-live?
3.10.1.2 audiotestsrc
audiotestsrc
audiotestsrc?
audiotestsrc-live?
3.10.2 Filter-like Elements
3.10.2.1 capsfilter
capsfilter
capsfilter?
capsfilter-caps
set-capsfilter-caps!
3.10.2.2 videomixer
videomixer
videomixer?
videomixer-ref
3.10.2.3 tee
tee
tee?
3.10.2.4 videoscale
videoscale
videoscale?
3.10.2.5 videobox
videobox
videobox?
3.10.3 Sink Elements
3.10.3.1 rtmpsink
rtmpsink
rtmpsink?
rtmpsink-location
3.10.3.2 filesink
filesink
filesink?
filesink-location
3.10.3.3 appsink%
appsink%
eos?
dropping?
get-max-buffers
get-caps
set-caps!
get-eos-evt
on-sample
on-eos
make-appsink
6.12

3.10 Common Elements

Included in gstreamer are helpers and utilities for working with frequently used elements, including predicates (implemented with element/c) and property getters/setters.

3.10.1 Source Elements

A source element generates data for use by a pipeline. A source element has a source pad and do not accept data, they only produce it.

Examples of source elements are those that generate video or audio signal, or those that capture data from a disk or some other input device.

3.10.1.1 videotestsrc

procedure

(videotestsrc [name    
  #:pattern pattern    
  #:live? is-live?])  videotestsrc?
  name : (or/c string? #f) = #f
  pattern : videotest-pattern/c = 'smpte
  is-live? : boolean? = #t
Creates a videotestsrc element with the given name (or a generated name if #f). A videotestsrc element produces a pattern on its src pad.

procedure

(videotestsrc? v)  boolean?

  v : any/c
Returns #t if v is an element of the "videotestsrc" factory, #f otherwise.

value

videotest-pattern/c : flat-contract?

 = 
(one-of/c 'smpte 'snow 'black 'white 'red 'green 'blue
          'checkers-1 'checkers-2 'checkers-4 'checkers-8
          'circular 'blink 'smpte75 'zone-plate 'gamut
          'chroma-zone-plate 'solid-color 'ball 'smpte100
          'bar 'pinwheel 'spokes 'gradient 'colors)
A contract that accepts a valid pattern for a videotestsrc.

procedure

(videotestsrc-pattern element)  videotest-pattern/c

  element : videotestsrc?
Returns the test pattern of element.

procedure

(set-videotestsrc-pattern! element pattern)  void?

  element : videotestsrc?
  pattern : videotest-pattern/c
Sets the test pattern of element.

procedure

(videotestsrc-live? element)  boolean?

  element : videotestsrc?
Returns #t if element is being used as a live source, #f otherwise.

3.10.1.2 audiotestsrc

procedure

(audiotestsrc [name #:live? is-live?])  audiotestsrc?

  name : (or/c string? #f) = #f
  is-live? : boolean? = #t
Creates a audiotestsrc element with the given name.

procedure

(audiotestsrc? v)  boolean?

  v : any/c
Returns #t if v is an element of the "audiotestsrc" factory, #f otherwise.

procedure

(audiotestsrc-live? element)  boolean?

  element : audiotestsrc?
Returns #t if element is being used as a live source, #f otherwise.

3.10.2 Filter-like Elements

Filters and filter-like elements have both input and output pads, also called sink and source pads respectively. They operate on data they receive on their sink pads and provide data on their output pads.

Examples include an h.264 encoder, an mp4 muxer, or a tee element — used to take a single input and send it to multiple outputs.

3.10.2.1 capsfilter

procedure

(capsfilter caps [name])  capsfilter?

  caps : caps?
  name : (or/c string? #f) = #f
Create a capsfilter element with the given name (or use a generated name if #f). A capsfilter element does not modify data but can enforce limitations on the data passing through it via its caps property.

procedure

(capsfilter? v)  boolean?

  v : any/c
Returns #t if v is an element of the "capsfilter" factory, #f otherwise.

procedure

(capsfilter-caps element)  caps?

  element : capsfilter?
Returns the possible allowed caps of element.

procedure

(set-capsfilter-caps! element caps)  void?

  element : capsfilter?
  caps : caps?
Sets the allowed caps of element to caps.

3.10.2.2 videomixer

procedure

(videomixer name)  videomixer?

  name : (or/c string? #f)
Create a videomixer element with the given name (or use a generated name if #f). A videomixer element composites/mixes multiple video streams into one.

procedure

(videomixer? v)  boolean?

  v : any/c
Returns t if v is an element of the "videomixer" factory, #f otherwise.

procedure

(videomixer-ref mixer pos)  (or/c (is-a?/c pad%) #f)

  mixer : videomixer?
  pos : exact-nonnegative-integer?
Gets the pad at pos from mixer, or #f if there is none present.

3.10.2.3 tee

procedure

(tee [name])  tee?

  name : (or/c string? #f) = #f
Create a tee element with the given name (or use a generated name if #f). A tee element is a 1-to-N pipe fitting element, meant for splitting data to multiple pads.

procedure

(tee? v)  boolean?

  v : any/c
Returns #t if v is an element of the "tee" factory, #f otherwise.

3.10.2.4 videoscale

procedure

(videoscale [name])  videoscale?

  name : (or/c string? #f) = #f

procedure

(videoscale? v)  boolean?

  v : any/c
Returns #t if v is an element of the "videoscale" factory, #f otherwise.

3.10.2.5 videobox

procedure

(videobox [name]    
  #:autocrop? autocrop    
  #:top top    
  #:bottom bottom    
  #:left left    
  #:right right)  videobox?
  name : (or/c string? #f) = #f
  autocrop : boolean?
  top : exact-integer?
  bottom : exact-integer?
  left : exact-integer?
  right : exact-integer?
Create a videobox element with the given name. A videobox element will crop or enlarge the input video stream. The top, bottom, left, and right parameters will crop pixels or add pixels to a border depending on if the values are positive or negative, respectively. When autocrop is #t, caps will determine crop properties. This element can be used to support letterboxing, mosaic, and picture-in-picture.

procedure

(videobox? v)  boolean?

  v : any/c
Returns #t if v is an element of the "videobox" factory, #f otherwise.

3.10.3 Sink Elements

Sink elements are the end points in a media pipeline. They accept data but do not produce anything. Writing to a disk or video or audio playback are implemented by sink elements.

3.10.3.1 rtmpsink

procedure

(rtmpsink location [name])  rtmpsink?

  location : string?
  name : (or/c string? #f) = #f
Create a rtmpsink element with the given name (or use a generated name if #f) and with location as the RTMP URL.

procedure

(rtmpsink? v)  boolean?

  v : any/c
Returns #t if v is an element of the "rtmpsink" factory, #f otherwise.

procedure

(rtmpsink-location element)  string?

  element : rtmpsink?
Returns the RTMP URL of the element.

3.10.3.2 filesink

procedure

(filesink location [name])  filesink?

  location : path-string?
  name : (or/c string? #f) = #f
Create a filesink element with the given name (or use a generated name) and with location as a file path on the local file system.

procedure

(filesink? v)  boolean?

  v : any/c
Returns #t if v is an element of the "filesink" factory, #f otherwise.

procedure

(filesink-location element)  path-string?

  element : filesink?
Returns the file path of the element.

3.10.3.3 appsink%

 (require gstreamer/appsink) package: overscan

An appsink is a sink element that is designed to extract sample data out of the pipeline into the application.

class

appsink% : class?

  superclass: element%

method

(send an-appsink eos?)  boolean?

method

(send an-appsink dropping?)  boolean?

method

(send an-appsink get-max-buffers)  exact-nonnegative-integer?

method

(send an-appsink get-caps)  (or/c caps? #f)

method

(send an-appsink set-caps! caps)  void?

  caps : caps?

method

(send an-appsink get-eos-evt)  evt?

method

(send an-appsink on-sample sample)  any?

  sample : sample?
Refine this method with augment.

method

(send an-appsink on-eos)  any?

Refine this method with augment.

procedure

(make-appsink [name class%])  (is-a?/c appsink%)

  name : (or/c string? #f) = #f
  class% : (subclass?/c appsink%) = appsink%
Create an appsink element with the name name or a generated name if #f. If class% is provided and a subclass of appsink%, the returned element will be an instance of class%.