Top | ![]() |
![]() |
![]() |
![]() |
gint | deltax | Read / Write |
gint | deltay | Read / Write |
gchar * | font-desc | Write |
gchar * | halign | Write |
gboolean | shaded-background | Read / Write |
gchar * | text | Read / Write |
gchar * | valign | Write |
GstTextOverlayWrapMode | wrap-mode | Read / Write |
gint | xpad | Read / Write |
gint | ypad | Read / Write |
GstTextOverlayHAlign | halignment | Read / Write |
GstTextOverlayVAlign | valignment | Read / Write |
GstTextOverlayLineAlign | line-alignment | Read / Write |
gboolean | silent | Read / Write |
gboolean | wait-text | Read / Write |
gboolean | auto-resize | Read / Write |
gboolean | vertical-render | Read / Write |
guint | color | Read / Write |
gdouble | xpos | Read / Write |
gdouble | ypos | Read / Write |
guint | outline-color | Read / Write |
gboolean | shadow | Read / Write |
struct | GstTextOverlay |
enum | GstTextOverlayVAlign |
enum | GstTextOverlayHAlign |
enum | GstTextOverlayWrapMode |
GObject ╰── GstObject ╰── GstElement ╰── GstTextOverlay ├── GstClockOverlay ╰── GstTimeOverlay
This plugin renders text on top of a video stream. This can be either static text or text from buffers received on the text sink pad, e.g. as produced by the subparse element. If the text sink pad is not linked, the text set via the "text" property will be rendered. If the text sink pad is linked, text will be rendered as it is received on that pad, honouring and matching the buffer timestamps of both input streams.
The text can contain newline characters and text wrapping is enabled by default.
1 |
gst-launch -v videotestsrc ! textoverlay text="Room A" valign=top halign=left ! xvimagesink |
1 |
gst-launch -v filesrc location=subtitles.srt ! subparse ! txt. videotestsrc ! timeoverlay ! textoverlay name=txt shaded-background=yes ! xvimagesink |
If you do not have such a subtitle file, create one looking like this in a text editor:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
1 00:00:03,000 --> 00:00:05,000 Hello? (3-5s) 2 00:00:08,000 --> 00:00:13,000 Yes, this is a subtitle. Don't you like it? (8-13s) 3 00:00:18,826 --> 00:01:02,886 Uh? What are you talking about? I don't understand (18-62s) |
One can also feed arbitrary live text into the element:
1 2 3 |
gst-launch fdsrc fd=0 ! text/plain ! txt. videotestsrc ! \ textoverlay name=txt shaded-background=yes font-desc="Serif 40" wait-text=false ! \ xvimagesink |
This shows new text as entered on the terminal (stdin). This is not suited for subtitles as the test overlay is not timed. Subtitles should use timestamped formats. For the above use case one can also read the text from the application as set the “text” property.
Vertical alignment of the text.
draw text on the baseline |
||
draw text on the bottom |
||
draw text on top |
||
draw text according to the “ypos” property |
||
draw text vertically centered |
Horizontal alignment of the text.
align text left |
||
align text center |
||
align text right |
||
position text according to the “xpos” property |
“deltax”
property “deltax” gint
Shift X position to the left or to the right. Unit is pixels.
Flags: Read / Write
Default value: 0
“deltay”
property “deltay” gint
Shift Y position up or down. Unit is pixels.
Flags: Read / Write
Default value: 0
“font-desc”
property “font-desc” gchar *
Pango font description of font to be used for rendering. See documentation of pango_font_description_from_string for syntax.
Flags: Write
Default value: ""
“halign”
property “halign” gchar *
Horizontal alignment of the text (deprecated; use halignment).
Flags: Write
Default value: "center"
“shaded-background”
property “shaded-background” gboolean
Whether to shade the background under the text area.
Flags: Read / Write
Default value: FALSE
“valign”
property “valign” gchar *
Vertical alignment of the text (deprecated; use valignment).
Flags: Write
Default value: "baseline"
“wrap-mode”
property“wrap-mode” GstTextOverlayWrapMode
Whether to wrap the text and if so how.
Flags: Read / Write
Default value: wordchar
“xpad”
property “xpad” gint
Horizontal paddding when using left/right alignment.
Flags: Read / Write
Allowed values: >= 0
Default value: 25
“ypad”
property “ypad” gint
Vertical padding when using top/bottom alignment.
Flags: Read / Write
Allowed values: >= 0
Default value: 25
“halignment”
property“halignment” GstTextOverlayHAlign
Horizontal alignment of the text.
Flags: Read / Write
Default value: center
“valignment”
property“valignment” GstTextOverlayVAlign
Vertical alignment of the text.
Flags: Read / Write
Default value: baseline
“line-alignment”
property “line-alignment” GstTextOverlayLineAlign
Alignment of text lines relative to each other (for multi-line text)
Flags: Read / Write
Default value: center
Since: 0.10.15
“silent”
property “silent” gboolean
If set, no text is rendered. Useful to switch off text rendering temporarily without removing the textoverlay element from the pipeline.
Flags: Read / Write
Default value: FALSE
Since: 0.10.15
“wait-text”
property “wait-text” gboolean
If set, the video will block until a subtitle is received on the text pad. If video and subtitles are sent in sync, like from the same demuxer, this property should be set.
Flags: Read / Write
Default value: TRUE
Since: 0.10.20
“auto-resize”
property “auto-resize” gboolean
Automatically adjust font size to screen-size.
Flags: Read / Write
Default value: TRUE
“vertical-render”
property “vertical-render” gboolean
Vertical Render.
Flags: Read / Write
Default value: FALSE
“color”
property “color” guint
Color of the rendered text.
Flags: Read / Write
Default value: 4294967295
Since: 0.10.31
“xpos”
property “xpos” gdouble
Horizontal position of the rendered text when using positioned alignment.
Flags: Read / Write
Allowed values: [0,1]
Default value: 0.5
Since: 0.10.31
“ypos”
property “ypos” gdouble
Vertical position of the rendered text when using positioned alignment.
Flags: Read / Write
Allowed values: [0,1]
Default value: 0.5
Since: 0.10.31
“outline-color”
property “outline-color” guint
Color of the outline of the rendered text.
Flags: Read / Write
Default value: 4278190080
Since: 0.10.36