Question / Help Table in Python script

br1xz

New Member
I am not really a OBS user, but rather a programmer that just got into all of this and wants to add a few things. My idea is to include some data in predefined spots on stream using Python script. I already made a python script that acquires that data from my website, parses it and shows it on stream, but not in a nice way. It's being shown on my stream, but I'd like to place it in a table. What would be a best way to do this? Is making a background image and filling it with data a way to go? How would you approach this? Thanks!
 

Sukiyucky

Member
OBS layout is based around a Scene and one or more Sources. The Sources that are available can be seen when you Add a Source. If you look at the available Source objects, there are things like a Browser source and Image source. One approach would be to render HTML and have a browser source show it in the Scene.

An easier approach is to an image source and drop it into a Scene. Have the image source reference a PNG file that sits on your SSD. Write to that SSD as a file from with your real time Python script that is pulling in data, parsing it, calculating, renders a table, and then outputs a PNG file.

All of this table to image processing has been done before and available as Python libraries. No need to reinvent the wheel. Look for a library that takes an internal metadata representation of a table (like an HTML string) and send that string to an image table renderer to be saved as a PNG.
 

br1xz

New Member
OBS layout is based around a Scene and one or more Sources. The Sources that are available can be seen when you Add a Source. If you look at the available Source objects, there are things like a Browser source and Image source. One approach would be to render HTML and have a browser source show it in the Scene.

An easier approach is to an image source and drop it into a Scene. Have the image source reference a PNG file that sits on your SSD. Write to that SSD as a file from with your real time Python script that is pulling in data, parsing it, calculating, renders a table, and then outputs a PNG file.

All of this table to image processing has been done before and available as Python libraries. No need to reinvent the wheel. Look for a library that takes an internal metadata representation of a table (like an HTML string) and send that string to an image table renderer to be saved as a PNG.
Rendering using those libraries seems like a good way to go. Could you please be so kind and link me such libs since I haven't had any luck googling it myself? Thanks
 
Top