# Plugin for timestamp



## Yopolo (Nov 2, 2017)

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 (Nov 3, 2017)

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?


----------



## RytoEX (Nov 4, 2017)

If I'm understanding your use case correctly, I think you're looking for the InfoWriter plugin.


----------



## Yopolo (Nov 4, 2017)

RytoEX said:


> If I'm understanding your use case correctly, I think you're looking for the InfoWriter plugin.



Yeah, thank you! that looks great :)


----------

