Resource icon

OBS Lua OBS Stats on Stream v2.1

GreenComfyTea submitted a new resource:

OBS Stats on Stream - The script allow to display certain technical data on stream.

OBS Stats on Stream

he script allow to display certain technical data on stream.

How to use
  1. Download the script.
  2. Add a Text(GDI+) Source to your scene. This source will be used to display the data.
  3. Open Tools -> Scripts. Add the script.
  4. Configure the script.
    • Output Mode must match the OBS encoder mode. Check it by going OBS -> Settings -> Output -> Output Mode (on the very top).
    • Update Delay determines how often...

Read more about this resource...
 

GrumpyDog

Member
Getting error: "Config file not found"

This is because in 'OBS-Stats-on-Stream.lua' returns the profile display name, however the profile filename will replace profile name spaces with an underscore.

see:

Lua:
function read_profile_config()
local profile = obs.obs_frontend_get_current_profile();
should be something like?

Lua:
function read_profile_config()
local profile = obs.obs_frontend_get_current_profile():gsub("%s+", "_")
 
Getting error: "Config file not found"

This is because in 'OBS-Stats-on-Stream.lua' returns the profile display name, however the profile filename will replace profile name spaces with an underscore.

see:

Lua:
function read_profile_config()
local profile = obs.obs_frontend_get_current_profile();
should be something like?

Lua:
function read_profile_config()
local profile = obs.obs_frontend_get_current_profile():gsub("%s+", "_")

Yes, you are right.
obs_frontend_get_current_profile() indeed returns display name.

A temporary fix for you would be:
Lua:
local profile = obs.obs_frontend_get_current_profile():gsub(" ", "_");

There are other symbols that are being replaced, but not with underscore. "?" is replaced with "2"(lol???)
I will look into OBS source code to handle all cases in a couple of days.
 
Yes, you are right.
obs_frontend_get_current_profile() indeed returns display name.

A temporary fix for you would be:
Lua:
local profile = obs.obs_frontend_get_current_profile():gsub(" ", "_");

There are other symbols that are being replaced, but not with underscore. "?" is replaced with "2"(lol???)
I will look into OBS source code to handle all cases in a couple of days.

The final fix is:

Lua:
local profile = obs.obs_frontend_get_current_profile():gsub("[^%w_ ]", ""):gsub("%s", "_");

All non-alphanumerics are being removed, and all whitespaces are being replaced with underscores.

Idk how I managed to get "2" yesterday. I assume its because folder name already existed, so it incremented name (it's in OBS source code). Thou I cant reproduce anymore :c
 
Top