Envek / obs-studio-node-example

Learn how to use OBS Studio from your Electron app for screen video recording
GNU General Public License v2.0
99 stars 19 forks source link

How to get a stream or per frame event of the input source or scene #40

Closed maximehuylebroeck closed 3 years ago

maximehuylebroeck commented 3 years ago

Hi guys, I'm trying to use this as an example of how to use the obs-studio-node lib. But what I'm actually trying to do is to get a stream/event of the captured input/preview screen so i can get data from every frame captured by the obs lib (in real time ish). I just can't seem to find anything in the code that is updating the preview div tag let alone a way to get the frames of the input source.

Many Thanks in advance.

Envek commented 3 years ago

can't seem to find anything in the code that is updating the preview div tag

That's because nothing updates div tag. It is always blank and serves just as a placeholder to keep space. obs-studio-node renders preview video separately on top of that div, we just provide coordinates of this div container relatively to window borders, using some OS-level mechanics (I'm not sure which).

Regarding your main question I don't know whether it is possible or not using just the library.

maximehuylebroeck commented 3 years ago

can't seem to find anything in the code that is updating the preview div tag

That's because nothing updates div tag. It is always blank and serves just as a placeholder to keep space. obs-studio-node renders preview video separately on top of that div, we just provide coordinates of this div container relatively to window borders, using some OS-level mechanics (I'm not sure which).

Regarding your main question I don't know whether it is possible or not using just the library.

thanks for your reply. seems like I have a bit of research to do :p