Plugin for timestamp

Yopolo

New Member
Hi,

We would like OBS to have the ability to add a time stamp with the current recording information there too using a hotkey combination so i.e. if i'm recording a session and i press a set of buttons later in my log i would have the time in the recording when i pressed that buttons. the idea is to develop a plugin for this since it doesn't exist in core OBS, unfortunately the OBS API isn't documented very well and the initial starting point is needed here as well.

Appreciate any help on this.
 

NLeseul

Member
In lieu of actual documentation, your best plan is basically to look at the code of existing OBS Studio modules to see how they're structured. Most of the built-in features of OBS Studio are implemented as modules, so there are plenty of examples. plugins/image-source/color-source.c is a pretty good barebones example.

When a plugin is loaded, OBS Studio will attempt to call the obs_module_load() function exported by the plugin DLL, if it exists. That will then call obs_register_source() or similar API to define what features that plugin provides. What you'll generally be looking for as the entry point to plugins is the struct sent to that call that provides the function pointers OBS Studio uses to interface with the plugin. In the case of color-source.c, you'll see color_source_info at the bottom of the file. This is then registered in the obs_module_load() function in image-source.c.

The interesting thing is that I'm not sure if any of OBS Studio's existing plugin types are all that appropriate for a feature that just sits in the background waiting for hotkeys. You can register sources, encoders, streaming services, and outputs, basically. I wonder if it would behave nicely if you just called obs_hotkey_register_frontend() directly from your obs_module_load() function?
 
Top