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

Unable to set webcam resolution #31

Closed berkon closed 3 years ago

berkon commented 3 years ago

I'v removed the comments in the corresponding section in obsRecorder.js, and set the resolution to 1920x1080, but the webcam still shows 640x480. Also setting width and height in InputFactory.create(...) does not seem to change anything.

// Way to update settings if needed:
let settings = obsCameraInput.settings;
console.debug('Camera settings:', obsCameraInput.settings);
settings['width'] = 1920;
settings['height'] = 1080;
obsCameraInput.update(settings);
obsCameraInput.save();

BTW: Thanks for this great example @Envek. This helped me a lot. Unfortunately obs-studio-node is not documented very well.

berkon commented 3 years ago

Just found the solution:

// Way to update settings if needed:
let settings = obsCameraInput.settings;
console.debug('Camera settings:', obsCameraInput.settings);
settings['res_type'] = 1
settings['resolution'] = "1920x1080",
obsCameraInput.update(settings);
obsCameraInput.save();
Envek commented 3 years ago

Unfortunately obs-studio-node is not documented very well.

That's why we've created this example, after all.

Thank you for sharing the solution! I've added it to README