Closed lulzsun closed 4 years ago
Partially solved. Here's a quick and dirty example on how to create and pick a window for window_capture:
const videoSource = osn.InputFactory.create('window_capture', 'window-source');
let settings = videoSource.settings;
let windows = videoSource.properties.get('window').details.items;
settings['window'] = windows[0].value; //first detected 'window' in the array of windows
videoSource.update(settings);
videoSource.save();
I'm assuming 'game-capture' works the same way. Closing this.
Thank you for sharing code examples!
@lulzsun
let windows = videoSource.properties.get('window').details.items;
when the windows[0].value has chinese,
and use encodeURI(windows[0].value)
Preview is still black
Thanks for this answer. It's helpful.
Window capture didn't work for me to capture the game, it seems to capture the region on my screen behind the game rather than the game itself.
I tried to make game_capture
work in the same manner but had no luck. Is there a reference somewhere to these properties?
Hm I found an example here: https://github.com/davidweatherall/replayslol-obs-recorder/blob/a1dac524eca22d95a7e940d3ab65a2eb6613fe30/src/NodeRecorder.ts
Might be an issue with my PC... recording appears to be working but the playback shows a black screen.
Hey! The example works great, however it doesn't provide any examples other than Display, Audio Device, and Video Device capture.
The examples provide clear and intuitive usage on those inputs, but others are not as easy to use, due to lack of documentation.
For example, I have tried to create a game capture source like so:
const gameSource = osn.InputFactory.create('game_capture', 'game-source');
However, I wasn't able to understand how to define a window/source for the game capture. The
gameSource.settings
also do not show a way to add a source:If someone could provide an simple example on creating a 'game_capture' and 'window_capture', would greatly appreciate it!