- Design goals
- Platforms
- Installation and Contribution
- Documentation
- Example
- Used third-party tools/libraries
- License
There are lots of programs to project text on screen out there, but none offered the possibility to control the monitor remotely (at least none that I could find). This program lets you show text on the screen of a computer via WebSockets. The program gets a JSON object with information about the text, and the monitor and it just shows the desired text on the desired monitor. I had this project idea for church, when I had to show verses and lyrics while doing a live streaming. This project gives you the posibility to share the work with someone else as they can change the lyrics/verses via phone.
ATTENTION: This project is only the backend, meaning it has no user interface, it just shows the text on the screen. I am currently working on a web intreface for this project.
The goal of this project is to have a program that can show text on screen and be able to take commands from a WebSocket, also it is desired to have a streaming server to stream the text for a streaming software (like OBS).
Currently SimpleTextProjector only works on Windows (tested on Windows 10), but other platforms are on the way (specifically MacOS and Linux).
To install this project you need to download the release and double click on the .exe file.
Any contribution is welcome. I've made this project as easy to build as it can get, you only have to open the project in Visual Studio (2022). Steps you have to follow:
- Download and install Visual Studio Comunity Version (2022) from the Microsoft webpage
- In the installer select "Desktop development with C++" then click install
- Now you should be able to build and run the project.
This program listens for a WebSocket connection on port 80, and takes a JSON object with the commands.
Here are all the possible commands so far:
text-stringtext that should be shown on the screen encoded withbase64, empty text for blank screen.- This command can return an error of type
text_errorif an error occurs.
- This command can return an error of type
font_color-JSON ObjectThis object must define values (between 0.0 and 1.0) for each colors: R (RED), G (GREEN), B(BLUE) and A(ALPHA). Example:{"font_color": {"R": 1.0, "G": 0.0, "B": 0.0, "A": 1.0 } }- This command can return an error of type
color_errorif the values of either R, G, B or A are not between 0.0 and 1.0.
- This command can return an error of type
font_size-intsize in pixels of the font.- This command can return an error of type
font_size_errorif the font size couldn't be set to the desired value.
- This command can return an error of type
font-stringname of the.ttffile that must be present in thefontsfolder.- This command can return an error of type
font_errorif the file couldn't be found or any other exception occurs.
- This command can return an error of type
streamboolean value start or stop streaming- This command can return an error of type
stream_errorif the stream can't be started/stopped
- This command can return an error of type
getget different values from the server, possible values so far:streamreturns if the server is streaming or not or and if it's streaming, then it returns the offer for the WebRTC client. Example:{"isStreaming": true, "offer": {....}}pingreturns{"pong": true}just to keep the WebSocket connection alive. It returns thesession_tokenif the user is logged in or asession_errorif the user is not logged in / token expired.monitorsreturns a JSON array with the IDs of the monitors and their names (names are not guaranteed to be unique). Example output:{"monitors":[{"0":"Generic PnP Monitor 1920 x 1080 60hz"},{"1":"Generic PnP Monitor 2560 x 1440 59hz"},{"2":"Generic PnP Monitor 1920 x 1080 60hz"}]}getcommand can return an error of typeget_errorif the command is not supported.setset different values for this WebRTC connection - usually used to set the offer. Possible values so far:answer- sets the answer for the RTC connection. When"set": "answer"is present, theanswerkey must also be present. Example:
{ "set": "answer", "answer": { "sdp": "v=0\r\no=mozilla...THIS_IS_SDPARTA ... ", "type": "answer" } }box_position- sets the box with the given index to the given location. Example:{"set": "box_position", "box_position": {"index": 0, "x": 10.5, "y": 20.5}}box_size- sets the size of the box at indexindexwith the givenwidthandheight. Example{"set": "box_size", "box_size": {"index": 0, "height": 22.5, "width": 33.4} }setcommand can return an error of typeset_errorif the set command is not supported.
background_color-JSON ObjectThis object must define values (between 0.0 and 1.0) for each colors: R (RED), G (GREEN), B(BLUE) and A(ALPHA). Example:{"background_color": {"R": 1.0, "G": 0.0, "B": 0.0, "A": 1.0 } }- This command can return an error of type
color_errorif the values of either R, G, B or A are not between 0.0 and 1.0.
- This command can return an error of type
monitor-intthe index of the monitor, starting with 0 (1 for secondary monitor, 2 for the third and so on).- This command can return an error of type
monitor_errorif the value is out of range.
- This command can return an error of type
authenticate-JSON ObjectThis object needs to have 2 fields:user- the user in plain text andpassword- the password in plain text. Example:{"authenticate":{"user": "admin", "password": "abcd"}}- This command can return an error of type
auth_errorif something went wrong.
- This command can return an error of type
register-JSON ObjectThis object needs to have 2 fields:user- the user in plain text andpassword- the password in plain text. Example:{"register":{"user": "admin", "password": "abcd"}}
Here's a JSON object example:
{
"text": "SGVsbG8gV29ybGQ=",
"monitor": 0,
"font_size": 35,
"font": "JandaAppleCobbler",
"font_color": [
1,
0,
0
]
}
This software uses libraries from the FFmpeg project under the LGPLv2.1. I do NOT own FFmpeg!
See the LICENSE file