Video components

video:capture

Video capture support for using webcams, etc. You can specify a device index (preferred, cross-platform) or a GStreamer pipeline. The pipelines for each device index can also be configured globally under Tools / Options / Video / GStreamer.

It is possible to specify the input dimensions and framerate.

A capture device will not start automatically. You can attach a core:start-trigger to the play port.

The device property is empty by default. It must be set before capture can be started.

  • out : VideoOut
  • device : Property (empty, number 1..4 or string) : device index or gstreamer pipeline or empty to clear
  • resize-mode : Property (Crop, Stretch, Scale) : control how the video capture size is adapted to the output size
  • align-x : Property (number 0..1) : horizontal alignment (only when using resize-mode Crop or Scale)
  • align-y : Property (number 0..1) : vertical alignment (only when using resize-mode Crop or Scale)
  • source-width : Property (empty or number 1..) : capture width
  • source-height : Property (empty or number 1..) : capture height
  • source-fps : Property (empty or number 1..) : capture framerate
  • play : Action
  • stop : Action

video:composite

Compose the video input source onto the video input destination using the blend mode and additional opacity as set.

The blend modes available are Normal, Add, Sub, Difference, Multiply, Screen, BitXor

  • in : VideoIn : destination input
  • src : VideoIn : source input
  • out : VideoOut
  • mode : Property : blend mode from above list
  • mix : Property (number 0..1) : additional opacity from 0% to 100%
  • force-alpha : Property (boolean) : force the source input to have an alpha channel (transparency)

video:custom

Base for video components. See coding guide.

  • out : VideoOut

video:output

Output to screen. An output is required in a video graph.

Currently settings here are only read when the video graph is started. Changing them will not affect a running video graph.

Width and height set here only scale output. They do not affect the size of image being processed through the graph - use the root settings for that.

  • title : Property (empty or string) : title of window or empty for default
  • device : Property (empty or number 1..) : monitor device or empty for default
  • width : Property (empty or number 1..) : output width or empty for default (see note above)
  • height : Property (empty or number 1..) : output height or empty for default (see note above)
  • rotation : Property (empty or number 0,90,180,270) : rotation of output on screen
  • full-screen : Property (boolean) : display output full screen
  • always-on-top : Property (boolean) : keep output window above other windows on screen
  • undecorated : Property (boolean) : remove output window decorations

video:player

Video file player.

It is possible to pause and seek through a video file using the position property. For this purpose use a video codec such as MJPEG which supports discreet frames.

The player will not start automatically. You can connect a core:start-trigger to the play or pause ports.

  • out : VideoOut
  • video : Property (empty or resource) : video file location or empty to clear
  • position : Property (number 0..1, transient) : position within video file (normalized)
  • loop : Property (boolean) : loop playback
  • resize-mode : Property (Crop, Stretch, Scale) : control how the video frame size is adapted to the output size
  • align-x : Property (number 0..1) : horizontal alignment (only when using resize-mode Crop or Scale)
  • align-y : Property (number 0..1) : vertical alignment (only when using resize-mode Crop or Scale)
  • play : Action
  • pause : Action
  • stop : Action

video:snapshot

This component provides the ability to capture and display a still frame from its video input. It extends this ability with the option to fade from the previous captured image to the new one over a period of time, and to mix the new image with the previous one.

  • in : VideoIn
  • out : VideoOut
  • fade-time : Property (number 0..60) : time in seconds to fade from previous captued image to current captured image
  • mix : Property (number 0..1) : amount to mix current image on top of previous image, from 0% to 100%
  • trigger : Action : capture new snapshot
  • reset : Action : erase current snapshot

video:still

Output a still image loaded from a file. The image will be drawn onto the input, if the image does not fill the frame or has transparency. Still images are aligned and resized according to the align-x, align-y and resize-mode properties. Images are loaded in the background, and a signal will be sent from the ready port when loaded, or the error port if an image could not be loaded from the supplied resource location.

  • in : VideoIn
  • out : VideoOut
  • image : Property (empty or resource) : image (png or jpeg) file location, or empty to clear
  • resize-mode : Property (Crop, Stretch, Scale) : control how the video frame size is adapted to the output size
  • align-x : Property (number 0..1) : horizontal alignment (only when using resize-mode Crop or Scale)
  • align-y : Property (number 0..1) : vertical alignment (only when using resize-mode Crop or Scale)
  • ready : ControlOut
  • error : ControlOut

video:xfader

Cross fade between two video signals, using the blend mode set. When mix is set to 0 or 1 processing of the unused channel will be switched off.

Available blend modes are Normal, Add, Difference, BitXor

  • in-1 : VideoIn
  • in-2 : VideoIn
  • out : VideoOut
  • mode : Property : blend mode from above list
  • mix : Property (number 0..1)

video:analysis:difference

The difference of two video inputs. Supports three modes - Color, Mono and Threshold (black or white). Differences less than the threshold value are ignored (black or transparent) in all modes.

This component does not currently support OpenGL acceleration.

  • in-1 : VideoIn
  • in-2 : VideoIn
  • out : VideoOut
  • mode : Property : mode from above list
  • threshold : Property (number 0..1) : ignore differences below this level

video:analysis:frame-delay

Delay the output by a single frame. Useful for motion analysis, etc.

  • in : VideoIn
  • out : VideoOut

video:analysis:simple-tracker

A simple blob tracker for motion tracking. Supports tracking of a single blob in the image.

This component requires the input source to be processed to be useful. See the Audio/02 blob theremin example for one possible way to set this up.

  • in-1 : VideoIn
  • in-2 : VideoIn
  • debug : Property (boolean) : draw blobs on screen for debugging purposes
  • x : ControlOut (number 0..1) : horizontal position of blob centre (normalized)
  • y : ControlOut (number 0..1) : vertical position of blob centre (normalized)
  • width : ControlOut (number 0..1) : blob width (normalized)
  • height : ControlOut (number 0..1) : blob height (normalized)

video:container:input

Video input for use inside a core:container

  • out : VideoOut

video:container:output

Video output for use inside a core:container

  • in : VideoOut

video:fx:blur

Simple box blur.

This component does not currently support OpenGL acceleration.

  • in : VideoIn
  • out : VideoOut
  • radius : Property (number 0..64) : blur radius in pixels

video:fx:ripple

Simple ripple effect. The disturbance port controls the amount of rippling of the input source.

This component does not currently support OpenGL acceleration.

  • in : VideoIn
  • disturbance : VideoIn
  • out : VideoOut

video:gl:filter

Component supporting custom GLSL shaders.

Generally it is better to use video:gl:p3d. See the OpenGL components in the custom components library for examples and a base component.

Can only be used with the OpenGL renderer.

  • in : VideoIn
  • out : VideoOut
  • vertex : Property (empty or string) : vertex shader code, or empty for default
  • fragment : Property (empty or string) : fragment shader code, or empty for default
  • u1 : Property (number 0..1) : uniform value which can be read in shader using uniform float u1
  • u2 : Property (number 0..1) : uniform value which can be read in shader using uniform float u2
  • u3 : Property (number 0..1) : uniform value which can be read in shader using uniform float u3
  • u4 : Property (number 0..1) : uniform value which can be read in shader using uniform float u4
  • u5 : Property (number 0..1) : uniform value which can be read in shader using uniform float u5
  • u6 : Property (number 0..1) : uniform value which can be read in shader using uniform float u6
  • u7 : Property (number 0..1) : uniform value which can be read in shader using uniform float u7
  • u8 : Property (number 0..1) : uniform value which can be read in shader using uniform float u8

video:gl:p2d

Base for video components with almost complete access to the Processing P2D renderer. See coding guide and examples / custom components library.

Can only be used with the OpenGL renderer.

  • out : VideoOut

video:gl:p3d

Base for video components with almost complete access to the Processing P3D renderer. See coding guide and examples / custom components library.

Can only be used with the OpenGL renderer.

  • out : VideoOut

video:source:noise

Simple source of white noise.

  • out : VideoOut