Skip to content

obs recording stats hud element#1801

Open
Denzy7 wants to merge 1 commit intoflightlessmango:masterfrom
Denzy7:master
Open

obs recording stats hud element#1801
Denzy7 wants to merge 1 commit intoflightlessmango:masterfrom
Denzy7:master

Conversation

@Denzy7
Copy link
Copy Markdown

@Denzy7 Denzy7 commented Sep 13, 2025

feature request from #448
requires libobs and libobs-frontend-api, which comes bundled with obs.
currently using shm to sync

issues:

  • it could be a separate plugin since all comms are thru shm
  • multiple instances of mangohud may mess with state
  • i think it could some styling too!

initially (inactive state)
Screenshot_20251018_114805

when obs is opened (ready state)
Screenshot_20251018_114827

recording in progress!
Screenshot_20251018_114844

if no shared memory is detected (on win32 or disabled by kernel) error status is shown
if mangohud was compiled without obs support, a spdlog warning is printed and disabled status is shown

@flightlessmango
Copy link
Copy Markdown
Owner

Preferably, communication with OBS should be handled by a self-contained class, exposed through a unique pointer that hud elements query for information

@Denzy7
Copy link
Copy Markdown
Author

Denzy7 commented Oct 9, 2025

I have made some changes in the latest commit. It's really difficult to expose a class with C++ and have it play nicely with OBS since it expects plugins to be written in C. The class hosts a struct which OBS uses to fill in the relevant info

@flightlessmango
Copy link
Copy Markdown
Owner

At the very least we don't want to do things in hud elements except rendering output

@Denzy7
Copy link
Copy Markdown
Author

Denzy7 commented Oct 9, 2025

Yeah. I'll move some of the initialization code to the class. Also I'll add the compiler guards for linux. I'm yet to do a proper Win32 shared memory implementation

@Denzy7
Copy link
Copy Markdown
Author

Denzy7 commented Oct 14, 2025

Added some more QOL changes. Looks ready for a review

@Denzy7 Denzy7 marked this pull request as ready for review October 14, 2025 08:13
Comment thread src/obs_studio.h Outdated
Comment thread src/obs_studio.cpp Outdated
Comment thread src/obs/obs_shared.c Outdated
Comment thread src/hud_elements.cpp Outdated
@Denzy7
Copy link
Copy Markdown
Author

Denzy7 commented Oct 18, 2025

Hello!
Latest commits address the issues in the first review. Now ready for another review

@Denzy7 Denzy7 force-pushed the master branch 2 times, most recently from c9203b6 to 75bdf0a Compare October 21, 2025 09:31
@Denzy7 Denzy7 closed this Oct 28, 2025
@Denzy7 Denzy7 reopened this Oct 28, 2025
Comment thread src/hud_elements.cpp
Comment thread meson_options.txt Outdated
@Denzy7
Copy link
Copy Markdown
Author

Denzy7 commented Nov 2, 2025

I've tested on arch and checked with the ubuntu CI build. Seems ok. I've checked the depends on Fedora and Solus on their online package search and the needed file are there. But on OpenSUSE I've no idea maybe someone could volunteer to test it

@Denzy7 Denzy7 force-pushed the master branch 5 times, most recently from 4c0a6d3 to 455d507 Compare January 2, 2026 13:22
@Denzy7
Copy link
Copy Markdown
Author

Denzy7 commented Jan 2, 2026

bump

@flightlessmango
Copy link
Copy Markdown
Owner

MangoHUD should be MangoHud

commit: 7d009d3
hudelements: obs-vkcapture stats with shm and sem

----

commit: b48fb1a
hudelements: refactor to local obs plugin

----

commit: 9f2319f
hudelements: obs plugin improvements

- cleanup so shm objects are removed on both obs and mangohud. needs
  atexit
- prefix_exe allows prefix exe name at the start of file recording(like
  MSI Afterburner), allows easily finding a recording. prefix_exe isn't
  run if mangohud isn't running
- remove sem. not needed tbh
- add config options
- some light formatting

----

commit: 63127b2
hudelements: shm compiler guards and fix obs mem leak

----

commit: 2a0d3dd
meson: with_obs option

----

commit: 91a1b18
hudelements: obs add ready state

----

commit: b9babc8
hudelements: obs plugin refactor

- moved platform specific init code from hud_elements.cpp to obs_studio.cpp
- obs_shared.c provides the shared interface for the plugin and MangoHud
- obs plugin cleanup so obs exits cleanly

----

commit: 783c64d
hudelements: obs plugin further cleanup and refactor

- moved more code to class. update function updates column string as
  appropriate
- obs directory in src
- obs should still prefix exe even if exited without stopping recording

----

commit: c9203b6
hudelements: with_obs flag and refactor + install plugin

- to conform to other elements
- install obs plugin

----

commit: 6baf00e
hudelements: obs disabled flag if not compiled in

----

commit: 7790d54
hudelements: obs plugin enabled by default

- will have to dlsym obs_frontend_get_last_recording since it was added
  in obs v29.0.0. debian at the time of writing is still on 26
- will issue warning if obs dep was not found at build
- plugin meson.build, easy to isolate and build as seperate plugin if
  needed. a main meson.build will define the obs dependencies
- updated CI files

----
@Denzy7
Copy link
Copy Markdown
Author

Denzy7 commented Jan 3, 2026

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants