1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>textoverlay: GStreamer Base Plugins 1.0 Plugins Reference Manual</title> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="index.html" title="GStreamer Base Plugins 1.0 Plugins Reference Manual"> 8<link rel="up" href="ch01.html" title="gst-plugins-base Elements"> 9<link rel="prev" href="gst-plugins-base-plugins-tcpserversrc.html" title="tcpserversrc"> 10<link rel="next" href="gst-plugins-base-plugins-textrender.html" title="textrender"> 11<meta name="generator" content="GTK-Doc V1.28 (XML mode)"> 12<link rel="stylesheet" href="style.css" type="text/css"> 13</head> 14<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 15<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> 16<td width="100%" align="left" class="shortcuts"> 17<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> 18 <a href="#gst-plugins-base-plugins-textoverlay.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> 19 <a href="#gst-plugins-base-plugins-textoverlay.object-hierarchy" class="shortcut">Object Hierarchy</a></span> 20</td> 21<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> 22<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> 23<td><a accesskey="p" href="gst-plugins-base-plugins-tcpserversrc.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> 24<td><a accesskey="n" href="gst-plugins-base-plugins-textrender.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> 25</tr></table> 26<div class="refentry"> 27<a name="gst-plugins-base-plugins-textoverlay"></a><div class="titlepage"></div> 28<div class="refnamediv"><table width="100%"><tr> 29<td valign="top"> 30<h2><span class="refentrytitle"><a name="gst-plugins-base-plugins-textoverlay.top_of_page"></a>textoverlay</span></h2> 31<p>textoverlay</p> 32</td> 33<td class="gallery_image" valign="top" align="right"></td> 34</tr></table></div> 35<a name="GstTextOverlay"></a><div class="refsect1"> 36<a name="gst-plugins-base-plugins-textoverlay.other"></a><h2>Types and Values</h2> 37<div class="informaltable"><table class="informaltable" width="100%" border="0"> 38<colgroup> 39<col width="150px" class="name"> 40<col class="description"> 41</colgroup> 42<tbody><tr> 43<td class="datatype_keyword">struct</td> 44<td class="function_name"><a class="link" href="gst-plugins-base-plugins-textoverlay.html#GstTextOverlay-struct" title="struct GstTextOverlay">GstTextOverlay</a></td> 45</tr></tbody> 46</table></div> 47</div> 48<div class="refsect1"> 49<a name="gst-plugins-base-plugins-textoverlay.object-hierarchy"></a><h2>Object Hierarchy</h2> 50<pre class="screen"> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a> 51 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a> 52 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstObject.html#GstObject-struct">GstObject</a> 53 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstElement.html#GstElement-struct">GstElement</a> 54 <span class="lineart">╰──</span> GstBaseTextOverlay 55 <span class="lineart">╰──</span> GstTextOverlay 56</pre> 57</div> 58<div class="refsect1"> 59<a name="gst-plugins-base-plugins-textoverlay.description"></a><h2>Description</h2> 60<p>This plugin renders text on top of a video stream. This can be either 61static text or text from buffers received on the text sink pad, e.g. 62as produced by the subparse element. If the text sink pad is not linked, 63the text set via the "text" property will be rendered. If the text sink 64pad is linked, text will be rendered as it is received on that pad, 65honouring and matching the buffer timestamps of both input streams.</p> 66<p>The text can contain newline characters and text wrapping is enabled by 67default.</p> 68<div class="refsect3"> 69<a name="id-1.2.97.6.4"></a><h4>Example launch lines</h4> 70<div class="informalexample"> 71 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 72 <tbody> 73 <tr> 74 <td class="listing_lines" align="right"><pre>1</pre></td> 75 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v videotestsrc <span class="gtkdoc opt">!</span> textoverlay text<span class="gtkdoc opt">=</span><span class="string">"Room A"</span> valignment<span class="gtkdoc opt">=</span>top halignment<span class="gtkdoc opt">=</span>left font<span class="gtkdoc opt">-</span>desc<span class="gtkdoc opt">=</span><span class="string">"Sans, 72"</span> <span class="gtkdoc opt">!</span> autovideosink</pre></td> 76 </tr> 77 </tbody> 78 </table> 79</div> 80 81<p> 82Here is a simple pipeline that displays a static text in the top left 83corner of the video picture</p> 84<div class="informalexample"> 85 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 86 <tbody> 87 <tr> 88 <td class="listing_lines" align="right"><pre>1</pre></td> 89 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v filesrc location<span class="gtkdoc opt">=</span>subtitles<span class="gtkdoc opt">.</span>srt <span class="gtkdoc opt">!</span> subparse <span class="gtkdoc opt">!</span> txt<span class="gtkdoc opt">.</span> videotestsrc <span class="gtkdoc opt">!</span> timeoverlay <span class="gtkdoc opt">!</span> textoverlay name<span class="gtkdoc opt">=</span>txt shaded<span class="gtkdoc opt">-</span>background<span class="gtkdoc opt">=</span>yes <span class="gtkdoc opt">!</span> autovideosink</pre></td> 90 </tr> 91 </tbody> 92 </table> 93</div> 94 95<p> 96Here is another pipeline that displays subtitles from an .srt subtitle 97file, centered at the bottom of the picture and with a rectangular shading 98around the text in the background:</p> 99<p>If you do not have such a subtitle file, create one looking like this 100in a text editor:</p> 101<div class="informalexample"> 102 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 103 <tbody> 104 <tr> 105 <td class="listing_lines" align="right"><pre>1 1062 1073 1084 1095 1106 1117 1128 1139 11410 11511 11612 11713</pre></td> 118 <td class="listing_code"><pre class="programlisting"><span class="number">1</span> 119<span class="number">00</span><span class="gtkdoc opt">:</span><span class="number">00</span><span class="gtkdoc opt">:</span><span class="number">03</span><span class="gtkdoc opt">,</span><span class="number">000</span> <span class="gtkdoc opt">--></span> <span class="number">00</span><span class="gtkdoc opt">:</span><span class="number">00</span><span class="gtkdoc opt">:</span><span class="number">05</span><span class="gtkdoc opt">,</span><span class="number">000</span> 120Hello<span class="gtkdoc opt">? (</span><span class="number">3</span><span class="gtkdoc opt">-</span><span class="number">5</span>s<span class="gtkdoc opt">)</span> 121 122<span class="number">2</span> 123<span class="number">00</span><span class="gtkdoc opt">:</span><span class="number">00</span><span class="gtkdoc opt">:</span><span class="number">08</span><span class="gtkdoc opt">,</span><span class="number">000</span> <span class="gtkdoc opt">--></span> <span class="number">00</span><span class="gtkdoc opt">:</span><span class="number">00</span><span class="gtkdoc opt">:</span><span class="number">13</span><span class="gtkdoc opt">,</span><span class="number">000</span> 124Yes<span class="gtkdoc opt">,</span> <span class="keyword">this</span> is a subtitle<span class="gtkdoc opt">.</span> Don<span class="string">'t</span> 125<span class="string">you like it? (8-13s)</span> 126<span class="string"></span> 127<span class="string">3</span> 128<span class="string">00:00:18,826 --> 00:01:02,886</span> 129<span class="string">Uh? What are you talking about?</span> 130<span class="string">I don'</span>t <span class="function">understand</span> <span class="gtkdoc opt">(</span><span class="number">18</span><span class="gtkdoc opt">-</span><span class="number">62</span>s<span class="gtkdoc opt">)</span></pre></td> 131 </tr> 132 </tbody> 133 </table> 134</div> 135 136<p></p> 137</div> 138<div class="refsynopsisdiv"> 139<h2>Synopsis</h2> 140<div class="refsect2"> 141<a name="id-1.2.97.6.5.1"></a><h3>Element Information</h3> 142<div class="variablelist"><table border="0" class="variablelist"> 143<colgroup> 144<col align="left" valign="top"> 145<col> 146</colgroup> 147<tbody> 148<tr> 149<td><p><span class="term">plugin</span></p></td> 150<td> 151 <a class="link" href="gst-plugins-base-plugins-plugin-pango.html#plugin-pango">pango</a> 152 </td> 153</tr> 154<tr> 155<td><p><span class="term">author</span></p></td> 156<td>David Schleef <ds@schleef.org>, Zeeshan Ali <zeeshan.ali@nokia.com></td> 157</tr> 158<tr> 159<td><p><span class="term">class</span></p></td> 160<td>Filter/Editor/Video</td> 161</tr> 162</tbody> 163</table></div> 164</div> 165<hr> 166<div class="refsect2"> 167<a name="id-1.2.97.6.5.2"></a><h3>Element Pads</h3> 168<div class="variablelist"><table border="0" class="variablelist"> 169<colgroup> 170<col align="left" valign="top"> 171<col> 172</colgroup> 173<tbody> 174<tr> 175<td><p><span class="term">name</span></p></td> 176<td>text_sink</td> 177</tr> 178<tr> 179<td><p><span class="term">direction</span></p></td> 180<td>sink</td> 181</tr> 182<tr> 183<td><p><span class="term">presence</span></p></td> 184<td>always</td> 185</tr> 186<tr> 187<td><p><span class="term">details</span></p></td> 188<td>text/x-raw, format=(string){ pango-markup, utf8 }</td> 189</tr> 190</tbody> 191</table></div> 192<div class="variablelist"><table border="0" class="variablelist"> 193<colgroup> 194<col align="left" valign="top"> 195<col> 196</colgroup> 197<tbody> 198<tr> 199<td><p><span class="term">name</span></p></td> 200<td>video_sink</td> 201</tr> 202<tr> 203<td><p><span class="term">direction</span></p></td> 204<td>sink</td> 205</tr> 206<tr> 207<td><p><span class="term">presence</span></p></td> 208<td>always</td> 209</tr> 210<tr> 211<td><p><span class="term">details</span></p></td> 212<td>video/x-raw, format=(string){ BGRx, RGBx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, I420, YV12, AYUV, YUY2, UYVY, v308, Y41B, Y42B, Y444, NV12, NV21, A420, YUV9, YVU9, IYU1, GRAY8 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 213</tr> 214<tr> 215<td><p><span class="term"></span></p></td> 216<td> video/x-raw(ANY), format=(string){ I420, YV12, YUY2, UYVY, AYUV, VUYA, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, Y210, Y410, NV12, NV21, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10BE, I420_10LE, I422_10BE, I422_10LE, Y444_10BE, Y444_10LE, GBR, GBR_10BE, GBR_10LE, NV16, NV24, NV12_64Z32, A420_10BE, A420_10LE, A422_10BE, A422_10LE, A444_10BE, A444_10LE, NV61, P010_10BE, P010_10LE, IYU2, VYUY, GBRA, GBRA_10BE, GBRA_10LE, BGR10A2_LE, GBR_12BE, GBR_12LE, GBRA_12BE, GBRA_12LE, I420_12BE, I420_12LE, I422_12BE, I422_12LE, Y444_12BE, Y444_12LE, GRAY10_LE32, NV12_10LE32, NV16_10LE32, NV12_10LE40 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 217</tr> 218</tbody> 219</table></div> 220<div class="variablelist"><table border="0" class="variablelist"> 221<colgroup> 222<col align="left" valign="top"> 223<col> 224</colgroup> 225<tbody> 226<tr> 227<td><p><span class="term">name</span></p></td> 228<td>src</td> 229</tr> 230<tr> 231<td><p><span class="term">direction</span></p></td> 232<td>source</td> 233</tr> 234<tr> 235<td><p><span class="term">presence</span></p></td> 236<td>always</td> 237</tr> 238<tr> 239<td><p><span class="term">details</span></p></td> 240<td>video/x-raw, format=(string){ BGRx, RGBx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, I420, YV12, AYUV, YUY2, UYVY, v308, Y41B, Y42B, Y444, NV12, NV21, A420, YUV9, YVU9, IYU1, GRAY8 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 241</tr> 242<tr> 243<td><p><span class="term"></span></p></td> 244<td> video/x-raw(ANY), format=(string){ I420, YV12, YUY2, UYVY, AYUV, VUYA, RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, Y444, v210, v216, Y210, Y410, NV12, NV21, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, AYUV64, r210, I420_10BE, I420_10LE, I422_10BE, I422_10LE, Y444_10BE, Y444_10LE, GBR, GBR_10BE, GBR_10LE, NV16, NV24, NV12_64Z32, A420_10BE, A420_10LE, A422_10BE, A422_10LE, A444_10BE, A444_10LE, NV61, P010_10BE, P010_10LE, IYU2, VYUY, GBRA, GBRA_10BE, GBRA_10LE, BGR10A2_LE, GBR_12BE, GBR_12LE, GBRA_12BE, GBRA_12LE, I420_12BE, I420_12LE, I422_12BE, I422_12LE, Y444_12BE, Y444_12LE, GRAY10_LE32, NV12_10LE32, NV16_10LE32, NV12_10LE40 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 245</tr> 246</tbody> 247</table></div> 248</div> 249</div> 250</div> 251<div class="refsect1"> 252<a name="gst-plugins-base-plugins-textoverlay.functions_details"></a><h2>Functions</h2> 253<p></p> 254</div> 255<div class="refsect1"> 256<a name="gst-plugins-base-plugins-textoverlay.other_details"></a><h2>Types and Values</h2> 257<div class="refsect2"> 258<a name="GstTextOverlay-struct"></a><h3>struct GstTextOverlay</h3> 259<pre class="programlisting">struct GstTextOverlay;</pre> 260<p>Opaque textoverlay data structure.</p> 261</div> 262</div> 263<div class="refsect1"> 264<a name="gst-plugins-base-plugins-textoverlay.see-also"></a><h2>See Also</h2> 265<p><a class="link" href="gst-plugins-base-plugins-textrender.html#GstTextRender"><span class="type">GstTextRender</span></a>, <a class="link" href="gst-plugins-base-plugins-textoverlay.html#GstTextOverlay"><span class="type">GstTextOverlay</span></a>, <a class="link" href="gst-plugins-base-plugins-timeoverlay.html#GstTimeOverlay"><span class="type">GstTimeOverlay</span></a>, <a class="link" href="gst-plugins-base-plugins-subparse.html#GstSubParse"><span class="type">GstSubParse</span></a></p> 266</div> 267</div> 268<div class="footer"> 269<hr>Generated by GTK-Doc V1.28</div> 270</body> 271</html>