obs-studio-node
obs-studio-node copied to clipboard
Errors running OBS_service_startRecording()
I built the package locally and was able to initialize osn successfully in Electron 6. However, once OBS_service_startRecording
is called, the app immediately crashes and fills the logs with this error (it continues running even after I close the Electron app).
[Error] WriteFileEx failed with getErrorCode 232
Any idea what is causing this? I followed the setSettings
structure in the tests and verified that the FilePath has indeed been changed to a folder of my choosing.
Incidentally, when I run the tests from this package via yarn test
all pass except for 2, including nodeobs_service
, which calls the OBS_service_startRecording
function I'm looking at. I recognize that this is likely due to the Twitch comment from the README, but even after I comment that code, the tests seem to just hang on that function. When I look up the logs, I see this error:
load_graphics_offsets: Failed to start 'get-graphics-offsets32.exe`
Any help is very much appreciated!
In case it helps, here is what I see in the logs (when I run it from my Electron app). @summeroff Sorry for another ping but it's a great package and I just want to get something simply working. Thank you!!
[000:00:00:00.232.525.100][Error] config_save_safe: failed to write to C:\Users\jesse\Documents\obs-studio-node-usage-test\osn-data\global.ini.tmp
[000:00:00:00.240.264.800][Info] ---------------------------------
[000:00:00:00.240.305.900][Info] Initializing D3D11...
[000:00:00:00.240.322.500][Info] Available Video Adapters:
[000:00:00:00.241.805.700][Info] Adapter 0: NVIDIA GeForce GTX 1650
[000:00:00:00.241.842.100][Info] Dedicated VRAM: 4154458112
[000:00:00:00.241.855.800][Info] Shared VRAM: 4200919040
[000:00:00:00.241.888.800][Info] output 0: pos={0, 0}, size={1280, 720}, attached=true
[000:00:00:00.242.565.500][Info] Adapter 1: Intel(R) UHD Graphics 630
[000:00:00:00.242.579.100][Info] Dedicated VRAM: 134217728
[000:00:00:00.242.585.800][Info] Shared VRAM: 4200919040
[000:00:00:00.245.185.500][Info] Loading up D3D11 on adapter NVIDIA GeForce GTX 1650 (0)
[000:00:00:00.293.294.100][Info] D3D11 loaded successfully, feature level used: b000
[000:00:00:00.293.344.900][Debug] set_priority: Failed to set process priority class: -1073741790
[000:00:00:00.293.355.600][Info] D3D11 GPU priority setup failed (not admin?)
[000:00:00:00.748.975.400][Info] ---------------------------------
[000:00:00:00.749.002.800][Info] video settings reset:
[000:00:00:00.749.002.800][Info] base resolution: 1280x720
[000:00:00:00.749.002.800][Info] output resolution: 1280x720
[000:00:00:00.749.002.800][Info] downscale filter: Bicubic
[000:00:00:00.749.002.800][Info] fps: 30/1
[000:00:00:00.749.002.800][Info] format: NV12
[000:00:00:00.749.002.800][Info] YUV mode: 601/Partial
[000:00:00:00.749.166.600][Info] NV12 texture support enabled
[000:00:00:00.750.957.000][Debug] ---------------------------------
[000:00:00:00.751.601.700][Debug] Required module function 'obs_module_load' in module 'C:/Users/jesse/Documents/obs-studio-node-usage-test/node_modules/obs-studio-node/obs-plugins/64bit/chrome_elf.dll' not found, loading of module failed
[000:00:00:00.751.624.200][Debug] ---------------------------------
[000:00:00:00.751.938.100][Debug] Loading module: coreaudio-encoder.dll
[000:00:00:00.752.678.900][Debug] [CoreAudio encoder]: Failed loading library 'CoreAudioToolbox.dll'
[000:00:00:00.752.695.200][Warning] [CoreAudio encoder]: CoreAudio AAC encoder not installed on the system or couldn't be loaded
[000:00:00:00.752.707.300][Debug] ---------------------------------
[000:00:00:00.753.032.400][Debug] Loading module: enc-amf.dll
[000:00:00:00.753.285.100][Debug] [AMF] <obs_module_load> Loading...
[000:00:00:00.788.439.700][Error] [AMF] AMF Test failed due to one or more errors.
[000:00:00:00.788.475.900][Warning] Failed to initialize module 'enc-amf.dll'
[000:00:00:00.788.496.500][Debug] ---------------------------------
[000:00:00:00.788.912.700][Debug] Loading module: image-source.dll
[000:00:00:00.789.095.000][Debug] ---------------------------------
[000:00:00:00.794.231.700][Debug] Required module function 'obs_module_load' in module 'C:/Users/jesse/Documents/obs-studio-node-usage-test/node_modules/obs-studio-node/obs-plugins/64bit/libcef.dll' not found, loading of module failed
[000:00:00:00.794.279.800][Debug] ---------------------------------
[000:00:00:00.794.742.300][Debug] Required module function 'obs_module_load' in module 'C:/Users/jesse/Documents/obs-studio-node-usage-test/node_modules/obs-studio-node/obs-plugins/64bit/libEGL.dll' not found, loading of module failed
[000:00:00:00.794.785.800][Debug] ---------------------------------
[000:00:00:00.797.952.300][Debug] Required module function 'obs_module_load' in module 'C:/Users/jesse/Documents/obs-studio-node-usage-test/node_modules/obs-studio-node/obs-plugins/64bit/libGLESv2.dll' not found, loading of module failed
[000:00:00:00.797.989.200][Debug] ---------------------------------
[000:00:00:00.798.432.900][Debug] Loading module: obs-browser.dll
[000:00:00:00.798.564.900][Info] [obs-browser]: Version 2.7.11
[000:00:00:00.798.910.100][Debug] ---------------------------------
[000:00:00:00.799.984.600][Debug] Loading module: obs-ffmpeg.dll
[000:00:00:00.800.910.200][Info] NVENC supported
[000:00:00:00.800.931.700][Debug] ---------------------------------
[000:00:00:00.801.219.900][Debug] Loading module: obs-filters.dll
[000:00:00:00.801.408.000][Debug] ---------------------------------
[000:00:00:00.801.670.700][Debug] Loading module: obs-ndi.dll
[000:00:00:00.801.802.400][Info] [obs-ndi] hello ! (version 4.5.3)
[000:00:00:00.801.815.600][Error] [obs-ndi] Error when loading the library.
[000:00:00:00.801.822.900][Warning] Failed to initialize module 'obs-ndi.dll'
[000:00:00:00.801.870.200][Debug] ---------------------------------
[000:00:00:00.802.605.400][Debug] Loading module: obs-outputs.dll
[000:00:00:00.803.167.500][Debug] ---------------------------------
[000:00:00:00.803.496.100][Debug] Loading module: obs-qsv11.dll
[000:00:00:00.808.804.500][Debug] ---------------------------------
[000:00:00:00.809.474.900][Debug] Loading module: obs-text.dll
[000:00:00:00.809.947.600][Debug] ---------------------------------
[000:00:00:00.810.416.200][Debug] Loading module: obs-transitions.dll
[000:00:00:00.810.675.500][Debug] ---------------------------------
[000:00:00:00.811.269.400][Debug] Loading module: obs-vst.dll
[000:00:00:00.811.470.900][Debug] ---------------------------------
[000:00:00:00.811.926.400][Debug] Loading module: obs-x264.dll
[000:00:00:00.812.114.900][Debug] ---------------------------------
[000:00:00:00.812.602.000][Debug] Loading module: rtmp-services.dll
[000:00:00:00.812.846.100][Debug] ---------------------------------
[000:00:00:00.813.258.200][Debug] Loading module: text-freetype2.dll
[000:00:00:00.813.479.000][Debug] ---------------------------------
[000:00:00:00.813.968.300][Debug] Loading module: vlc-video.dll
[000:00:00:00.814.209.700][Info] Couldn't find VLC installation, VLC video source disabled
[000:00:00:00.814.227.800][Debug] ---------------------------------
[000:00:00:00.814.595.300][Debug] Loading module: win-capture.dll
[000:00:00:00.814.886.600][Debug] ---------------------------------
[000:00:00:00.815.200.100][Debug] Loading module: win-decklink.dll
[000:00:00:00.816.258.700][Info] No blackmagic support
[000:00:00:00.816.290.200][Debug] Failed to start search for DeckLink devices
[000:00:00:00.816.304.800][Debug] ---------------------------------
[000:00:00:00.816.708.300][Debug] Loading module: win-dshow.dll
[000:00:00:00.818.357.800][Debug] ---------------------------------
[000:00:00:00.818.666.200][Debug] Loading module: win-mf.dll
[000:00:00:00.818.713.900][Debug] ---------------------------------
[000:00:00:00.819.004.900][Debug] Loading module: win-wasapi.dll
[000:00:00:00.819.277.500][Error] Plugin Path provided is invalid: 0
[000:00:00:00.819.277.500][Error] ݾ
[000:00:00:00.820.963.400][Debug] service 'default_service' (rtmp_common) created
[000:00:00:00.824.975.100][Debug] output 'simple_stream' (rtmp_output) created
[000:00:00:00.825.064.600][Debug] output 'simple_file_output' (ffmpeg_muxer) created
[000:00:00:00.825.144.400][Debug] output 'ReplayBuffer' (replay_buffer) created
[000:00:00:00.825.158.800][Error] Encoder ID 'x264' not found
[000:00:00:00.825.169.900][Debug] encoder 'streaming_h264' (x264) created
[000:00:00:00.825.232.000][Debug] AAC encoder bitrate mapping:
[000:00:00:00.825.232.000][Debug] 64 kbit/s: 'FFmpeg Default AAC Encoder' (ffmpeg_aac)
[000:00:00:00.825.232.000][Debug] 96 kbit/s: 'FFmpeg Default AAC Encoder' (ffmpeg_aac)
[000:00:00:00.825.232.000][Debug] 128 kbit/s: 'FFmpeg Default AAC Encoder' (ffmpeg_aac)
[000:00:00:00.825.232.000][Debug] 160 kbit/s: 'FFmpeg Default AAC Encoder' (ffmpeg_aac)
[000:00:00:00.825.232.000][Debug] 192 kbit/s: 'FFmpeg Default AAC Encoder' (ffmpeg_aac)
[000:00:00:00.825.232.000][Debug] 224 kbit/s: 'FFmpeg Default AAC Encoder' (ffmpeg_aac)
[000:00:00:00.825.232.000][Debug] 256 kbit/s: 'FFmpeg Default AAC Encoder' (ffmpeg_aac)
[000:00:00:00.825.232.000][Debug] 288 kbit/s: 'FFmpeg Default AAC Encoder' (ffmpeg_aac)
[000:00:00:00.825.232.000][Debug] 320 kbit/s: 'FFmpeg Default AAC Encoder' (ffmpeg_aac)
[000:00:00:00.825.312.600][Debug] encoder 'streaming_h264' destroyed
[000:00:00:00.825.335.300][Debug] encoder 'streaming_h264' (obs_x264) created
[000:00:00:01.135.467.900][Debug] obs_encoder_update: Null 'encoder' parameter
[000:00:00:01.135.505.700][Debug] encoder 'simple_h264_recording' (obs_x264) created
[000:00:00:01.135.519.500][Info] ---------------------------------
[000:00:00:01.135.526.600][Info] audio settings reset:
[000:00:00:01.135.526.600][Info] samples per sec: 44100
[000:00:00:01.135.526.600][Info] speakers: 2
[000:00:00:01.151.641.200][Info] ---------------------------------
[000:00:00:01.151.670.800][Info] video settings reset:
[000:00:00:01.151.670.800][Info] base resolution: 1280x720
[000:00:00:01.151.670.800][Info] output resolution: 1280x720
[000:00:00:01.151.670.800][Info] downscale filter: Bicubic
[000:00:00:01.151.670.800][Info] fps: 30/1
[000:00:00:01.151.670.800][Info] format: NV12
[000:00:00:01.151.670.800][Info] YUV mode: 601/Partial
[000:00:00:01.151.835.800][Info] NV12 texture support enabled
[000:00:00:01.153.601.600][Debug] encoder 'adv_aac0' (ffmpeg_aac) created
[000:00:00:01.153.639.100][Debug] encoder 'adv_aac1' (ffmpeg_aac) created
[000:00:00:01.153.652.900][Debug] encoder 'adv_aac2' (ffmpeg_aac) created
[000:00:00:01.153.665.500][Debug] encoder 'adv_aac3' (ffmpeg_aac) created
[000:00:00:01.153.677.400][Debug] encoder 'adv_aac4' (ffmpeg_aac) created
[000:00:00:01.153.688.800][Debug] encoder 'adv_aac5' (ffmpeg_aac) created
[000:00:00:01.153.716.800][Info] Audio monitoring device:
[000:00:00:01.153.716.800][Info] name: Default
[000:00:00:01.153.716.800][Info] id: default
[000:00:19:54.128.211.100][Error] WriteFileEx failed with getErrorCode 232
[000:00:19:54.149.161.300][Error] WriteFileEx failed with getErrorCode 232
[000:00:19:54.170.101.400][Error] WriteFileEx failed with getErrorCode 232
[000:00:19:54.191.102.800][Error] WriteFileEx failed with getErrorCode 232
[000:00:19:54.211.986.200][Error] WriteFileEx failed with getErrorCode 232
[000:00:19:54.233.249.700][Error] WriteFileEx failed with getErrorCode 232
[000:00:19:54.253.900.900][Error] WriteFileEx failed with getErrorCode 232
getErrorCode 232 - it is usually indicate what client was disconnected from named pipe. it is expected what electron app keeps client side of module active.
Failed to start 'get-graphics-offsets32.exe` - it is probably ok for local build.
Hm I see -- in that case, do you happen to know what's missing from my bare-bones setup here (in preload.js
of my app)? I spent all of today rummaging through the slobs codebase but wasn't able to see what to extract just the basic functionality to record a screen.
// Init the library
console.log('Initializing OBS...');
osn.NodeObs.IPC.host('eletest-pipe'); // Usually some UUIDs go there
osn.NodeObs.SetWorkingDirectory(path.join(__dirname, 'node_modules', 'obs-studio-node'));
const obsDataPath = path.join(__dirname, 'osn-data'); // OBS Studio configs and logs
const initResult = osn.NodeObs.OBS_API_initAPI('en-US', obsDataPath, "1.1.4");
console.log('OBS Init result: ', initResult); // Should be 0 (Success)
// Start recording
setSetting('Output', 'Mode', 'Simple');
setSetting('Output', 'StreamEncoder', 'x264');
setSetting('Output', 'FilePath', path.join(path.normalize(__dirname), 'videos'));
osn.NodeObs.OBS_service_startRecording();
The first part of this (the initialization) runs successfully, but it looks like I'm not setting up the "client" here. How would I go about doing that?
It seems that call to OBS_service_connectOutputSignals
is a lacking crucial initialization step.
Correct, signals needs to be correctly connected in order for the client the receive the different output states. Is this still an issue?
Resolved thank you!