A text overlay is configured by passing a text overlay string containing the text and the overlay settings (width, height, font, etc...) as follows:
DatasteadRTSPConfig.SetStr(RTSP_VideoStream_ConfigureTextOverlay_str,
OVERLAYSTRING);
E.g.:
DatasteadRTSPConfig.SetStr(RTSP_VideoStream_ConfigureTextOverlay_str,
"|overlayid=1|text=Hello
World!|fontsize=40|x=20|y=20|fontcolor=white");
- the
1st character of the string is used as separator for all
the parameters. In this example it is "|" (ASCII 124), but
any other character that is not a letter or number can be used.
- "overlayid" can specify any short string that is used to identify this text overlay. This identified will be used by the filter to retrieve the overlay when updating it in real time while the filter is running.
- THE OVERLAYS MUST BE SET BEFORE OPENING THE URL. If an overlay must not be displayed immediately, configure it with an empty string, then invoke the function again
while the filter is running and pass the string to display.
- passing an incorrect string syntax may crash the filter (e.g. wrong color name)
In the example below 2 overlays are defined at startup, and
the 2nd is not displayed (empty string), then they are
updated in real time while the filter is running.
before running the filter,
invoke:
DatasteadRTSPConfig.SetStr(RTSP_VideoStream_ConfigureTextOverlay_str,
"| overlayid=first
| text=this is the first text displayed at startup
| fontsize=40 | x=20 | y=20 |
fontcolor=white");
DatasteadRTSPConfig.SetStr(RTSP_VideoStream_ConfigureTextOverlay_str,
"| overlayid=second
| text= | fontsize=40 | x=60 | y=60 | fontcolor=white");
then, later, while the filter is
running,
invoke:
DatasteadRTSPConfig.SetStr(RTSP_VideoStream_ConfigureTextOverlay_str,
"| overlayid=first | text=now the 1st
text is updated | fontsize=40 | x=20 | y=20 |
fontcolor=white");
DatasteadRTSPConfig.SetStr(RTSP_VideoStream_ConfigureTextOverlay_str,
"| overlayid=second | text=now the 2nd
text appears | fontsize=40 | x=60 | y=60 | fontcolor=white");