Gstreamer cheat sheet

This page contains various shortcuts to achieving specific functionality using Gstreamer. These functionalities are mostly related to my Digital Video Transmission experiments. There is no easy to read "user manual" for gstreamer but the online the plugin documentation often contains command line examples in addition to the API docs. Other sources of documentation: The Gstreamer documentation is also available in Devhelp.
 * The manual page for gst-launch
 * The gst-inspect tool
 * Online tutorials

Video Test Source
To generate a test video stream use :

gst-launch videotestsrc ! ximagesink

Use the  property to select a specific pattern:

gst-launch videotestsrc pattern=snow ! ximagesink

can be both numeric and symbolic. Some patterns can be adjusted using additional parameters:

To generate a test pattern of a given size and at a given rate a "caps filter" can be used:

gst-launch videotestsrc ! video/x-raw-rgb, framerate=25/1, width=640, height=360 ! ximagesink

TODO: I'd like to add more about "caps filter" but I can not find any comprehensive documentation.

Resizing and Cropping
For quick cropping from 4:3 to 16:9, the plugin can be used:

gst-launch v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=15/1 ! aspectratiocrop aspect-ratio=16/9 ! ffmpegcolorspace ! xvimagesink

Network Streaming
TBD

Encoding and Muxing
TBD

Decoding and Demuxing
TBD

Picture in Picture
TBD

four videos combined into one video matrix

Text Overlay
The plugin can be used to add text to the video stream:

gst-launch videotestsrc ! video/x-raw-yuv,width=640,height=480,framerate=15/1 ! textoverlay text="Hello" ! ffmpegcolorspace ! ximagesink

It has many options for text positioning and alignment. User can also specify font properties as a Pango font description string, e.g..

TODO: A few font description examples.

Time Overlay
Elapsed time can be added using the plugin:

gst-launch videotestsrc ! timeoverlay ! xvimagesink

inherits the properties of  so the text properties can be set using the same properties:

gst-launch videotestsrc ! timeoverlay halign=right valign=bottom text="Stream time:" shaded-background=true ! xvimagesink

Alternatively, can be used but it doesn't seem to have any properties:

gst-launch videotestsrc ! cairotimeoverlay ! xvimagesink

Instead of elapsed time, the system date and time can be added using the plugin:

gst-launch videotestsrc ! clockoverlay ! xvimagesink

also inherits the properties of. In addition to that  also allows setting the time format:

gst-launch videotestsrc ! clockoverlay halign=right valign=bottom shaded-background=true time-format="%Y.%m.%D" ! ffmpegcolorspace ! ximagesink

Complete Examples
TBD