-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add mac support #19
add mac support #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! Cool!
Maybe preview window doesn't work because of displayId
is different on MacOS (can't remember where I've got this display1
from)? Or, perhaps, window.getNativeHandle()
returns something different?
obs-studio-node-example/obsRecorder.js
Lines 241 to 248 in 2ab50a3
const displayId = 'display1'; | |
function setupPreview(window, bounds) { | |
osn.NodeObs.OBS_content_createSourcePreviewDisplay( | |
window.getNativeWindowHandle(), | |
scene.name, // or use camera source Id here | |
displayId, | |
); |
obsRecorder.js
Outdated
function getAudioDevices(type, subtype) { | ||
const dummyDevice = osn.InputFactory.create(type, subtype, { device_id: 'does_not_exist' }); | ||
const dummyDevice = osn.InputFactory.create( | ||
byOS({ [OS.Windows]: 'wasapi_input_capture', [OS.Mac]: 'coreaudio_input_capture' }), | ||
uuid(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getAudioDevices
is being used to get both input and output sources, so it is better to detect of OS-specific types in places that call this function. And here just use type
and subtype
. Btw why uuid()
is used here instead of provided subtype
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I reverted that change
Hmm I think the |
@Envek I'm also seeing a problem with slow frame rates when streaming to the virtual camera. Recording to disk is smooth. Do you know what could be causing it? This warning comes up:
|
No, I have no idea. I think that it can be internal issue in obs-studio-node (probably very low-level one). So, please open an issue in their issue tracker at https://github.com/stream-labs/obs-studio-node/issues |
It works well when running the latest streamlabs-obs with the same obs-studio-node, so it must be related to this setup. I'll keep digging, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it on Windows: it works. LGTM at this stage. Hope that you'll find solution for preview.
That one looks like #18 (comment) |
@psd-coder sure you're on the right branch? Looks like it's using the windows input types, is |
@alse You are right! My bad, I forgot to checkout branch... it works! but needed to be fixed |
Great! What was wrong with the uuid require? |
I got |
@alse Can the mac version of obs-studio-node run? |
@psd-coder thanks, I updated the uuid require @chfeizy yes, it runs on mac for me. Make sure you start it from a native terminal, not vscode |
@alse I'm run with mac terminal, the display is not show, the record is success |
@chfeizy the preview doesn't work on mac yet |
Thank you very much! Let's use it as is and fix known issues later (maybe by someone else) |
@Envek thanks for putting this together!
I made some updates to add mac support.
Recording the screen and webcam works, but the live preview doesn't show up. Any idea why? log_output.txt