textrender

textrender

Synopsis

struct              GstTextRender;
enum                GstTextRenderHAlign;
enum                GstTextRenderLineAlign;
enum                GstTextRenderVAlign;

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GstObject
               +----GstElement
                     +----GstTextRender

Properties

  "font-desc"                gchar*                : Write
  "halignment"               GstTextRenderHAlign   : Read / Write
  "line-alignment"           GstTextRenderLineAlign  : Read / Write
  "valignment"               GstTextRenderVAlign   : Read / Write
  "xpad"                     gint                  : Read / Write
  "ypad"                     gint                  : Read / Write

Description

This plugin renders text received on the text sink pad to a video buffer (retaining the alpha channel), so it can later be overlayed on top of video streams using other elements.

The text can contain newline characters. (FIXME: What about text wrapping? It does not make sense in this context)

Example launch lines

1
gst-launch-1.0 -v filesrc location=subtitles.srt ! subparse ! textrender ! videoconvert ! autovideosink

Synopsis

Element Information

plugin

pango

author

David Schleef <ds@schleef.org>, GStreamer maintainers <gstreamer-devel@lists.freedesktop.org>

class

Filter/Editor/Video

Element Pads

name

sink

direction

sink

presence

always

details

text/x-raw, format=(string){ pango-markup, utf8 }

name

src

direction

source

presence

always

details

video/x-raw, format=(string){ AYUV, ARGB }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

Details

struct GstTextRender

struct GstTextRender;

Opaque textrender data structure.


enum GstTextRenderHAlign

typedef enum {
    GST_TEXT_RENDER_HALIGN_LEFT,
    GST_TEXT_RENDER_HALIGN_CENTER,
    GST_TEXT_RENDER_HALIGN_RIGHT
} GstTextRenderHAlign;

Horizontal alignment of the text.

GST_TEXT_RENDER_HALIGN_LEFT

align text left

GST_TEXT_RENDER_HALIGN_CENTER

align text center

GST_TEXT_RENDER_HALIGN_RIGHT

align text right

enum GstTextRenderLineAlign

typedef enum {
    GST_TEXT_RENDER_LINE_ALIGN_LEFT = PANGO_ALIGN_LEFT,
    GST_TEXT_RENDER_LINE_ALIGN_CENTER = PANGO_ALIGN_CENTER,
    GST_TEXT_RENDER_LINE_ALIGN_RIGHT = PANGO_ALIGN_RIGHT
} GstTextRenderLineAlign;

Alignment of text lines relative to each other

GST_TEXT_RENDER_LINE_ALIGN_LEFT

lines are left-aligned

GST_TEXT_RENDER_LINE_ALIGN_CENTER

lines are center-aligned

GST_TEXT_RENDER_LINE_ALIGN_RIGHT

lines are right-aligned

enum GstTextRenderVAlign

typedef enum {
    GST_TEXT_RENDER_VALIGN_BASELINE,
    GST_TEXT_RENDER_VALIGN_BOTTOM,
    GST_TEXT_RENDER_VALIGN_TOP
} GstTextRenderVAlign;

Vertical alignment of the text.

GST_TEXT_RENDER_VALIGN_BASELINE

draw text on the baseline

GST_TEXT_RENDER_VALIGN_BOTTOM

draw text on the bottom

GST_TEXT_RENDER_VALIGN_TOP

draw test on top

Property Details

The "font-desc" property

  "font-desc"                gchar*                : Write

Pango font description of font to be used for rendering. See documentation of pango_font_description_from_string for syntax.

Default value: ""


The "halignment" property

  "halignment"               GstTextRenderHAlign   : Read / Write

Horizontal alignment of the text.

Default value: center


The "line-alignment" property

  "line-alignment"           GstTextRenderLineAlign  : Read / Write

Alignment of text lines relative to each other.

Default value: center


The "valignment" property

  "valignment"               GstTextRenderVAlign   : Read / Write

Vertical alignment of the text.

Default value: baseline


The "xpad" property

  "xpad"                     gint                  : Read / Write

Horizontal paddding when using left/right alignment.

Allowed values: >= 0

Default value: 25


The "ypad" property

  "ypad"                     gint                  : Read / Write

Vertical padding when using top/bottom alignment.

Allowed values: >= 0

Default value: 25

See Also

GstTextOverlay