{"_id":"@berezins/obs-studio-node","_rev":"1-ebfc3fadf5d2f9d3dd5cadc61e1b6818","name":"@berezins/obs-studio-node","dist-tags":{"latest":"0.3.99"},"versions":{"0.3.99":{"name":"@berezins/obs-studio-node","version":"0.3.99","description":"Experimental bindings to obs-studio using nan directly","author":{"name":"Streamlabs","email":"support@streamlabs.com"},"license":"GPL-2.0","repository":{"type":"git","url":"git+https://github.com/stream-labs/obs-studio-node.git"},"bugs":{"url":"https://github.com/stream-labs/obs-studio-node/issues"},"homepage":"https://github.com/stream-labs/obs-studio-node#readme","main":"./index.js","types":"./index.d.ts","scripts":{"build:bindings":"cmake-js configure -a x64 --CDCMAKE_PREFIX_INSTALL=distribute && cmake --build build --target install --config Release","build:javascript":"tsc -p js","build:docs":"typedoc --out docs","local:config":"yarn install && git submodule update --init --recursive --force && cmake -Bbuild -H. -G\"Visual Studio 16 2019\" -A\"x64\" -DCMAKE_INSTALL_PREFIX=\"./obs-studio-node\" -DLIBOBS_BUILD_TYPE=\"debug\"","local:build":"cmake --build build --target install --config Debug","local:clean":"rm -rf build/*","test":"electron-mocha -t 80000 -c true -r ts-node/register tests/osn-tests/src/**/*.ts --reporter tests/osn-tests/util/list-reporter.js"},"devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.5","@types/node":"^12.16.3","archiver":"^3.1.1","aws-sdk":"^2.585.0","chai":"^4.2.0","colors":"^1.4.0","electron":"10.4.2","electron-mocha":"^8.2.2","mocha":"^7.1.0","mocha-junit-reporter":"^1.22.0","node-addon-api":"^3.1.0","request":"^2.88.0","ts-node":"^7.0.1","typedoc":"^0.16.11","typedoc-default-themes":"^0.5.0","typedoc-plugin-markdown":"^2.2.17","typescript":"^2.9.2","uuid":"^3.0.1","wait-queue":"^1.1.3"},"keywords":["capture","stream","record","twitch","youtube","obs","open","broadcaster","software","obs","studio","c++","c","native","desktop","video","audio","mixer","beam"],"dependencies":{},"gitHead":"3d6d047362f9031794fe186b1b46f2e09a08b71a","_id":"@berezins/obs-studio-node@0.3.99","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-E4hbir4CmCSHFoGPZrI+y7CQhedRHpC+oFS4Hud9ryZZMUOSaDxNP+EMGvhg0Zc/y6HM79tqdrWzyTpqo7AmWQ==","shasum":"84d360ec4f4276c6f3d154d2cd00edbe922e1559","tarball":"https://registry.npmjs.org/@berezins/obs-studio-node/-/obs-studio-node-0.3.99.tgz","fileCount":274,"unpackedSize":2244495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEgvzCRA9TVsSAnZWagAAP0MP/37ZDlGw+8DcTzQqAK8M\nZvgjTTdfy/px626jra+Fid17knPKyJ8wI/WpdTj1+XAiQ9nzcOwDp1Cgjisc\nnX9acPaFxuq/TS994zQcpuD8AoxGCs5zyYSoe1wBi1Xiw7ju4uOh4zn9zndB\nGAgS3TDVbOqJ3Nanm+LsiaD1K2VWTPBETebvuCzTDPCKxIjZ8Xqi3VEOA+SO\n9+KGDiWvAUHn7QDKg1ebOELXozv0B6aezILJJP2QZELpm8a+5f5oveuuLAnr\n066fMEfG1m3Qp3R2euSc7IB9AEgknx/+qDGT42hWDKfV88LtiXme4UvpAf6k\nZ4I5cHNWVP5agtDR2NdQ06Fe0hLYtpKXNpILelOEyHyzprBbxcEUM/ICKHv2\nbvT4Ol+7yBeDylnzFd+n7seZi6bbCwA+mzxejau2rOSdmXbZrL+CRcXaRif4\n/jNp6vFdSN4brbGPE/SaLgE69UvMa8c+T6mGWj1uD6YE0hyfE+TinurbAF/T\nte+eNJONP46yH+DxspKMF/VhoDsyYh8enqI5rO22HeISAxqw9hU8DEACFZbu\nT3rFR/KjxQyxZ4q9VYxNzyuYUH8pbH1rgmSo4ugcjHkjN1qKOwBqpLfb8Mn+\nQEnasyG4Jo+7fX83Ow9FWywx3Wfdhz2OiZkksmugdr3vre6RXlqx+HHYRQmP\nIVop\r\n=GS6K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwXA0SZS0VgKPrSaJiYEhu/HA3F4WfJiagmKCLfEKPiAiEAwfjBMcTngfeJK6LC5tHRrfPXbpdQO/cwl5nX/iLhRU8="}]},"_npmUser":{"name":"berezins","email":"berezins@gmail.com"},"directories":{},"maintainers":[{"name":"berezins","email":"berezins@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/obs-studio-node_0.3.99_1628572659592_0.7064887039893195"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-10T05:17:39.538Z","0.3.99":"2021-08-10T05:17:39.810Z","modified":"2022-04-04T18:28:45.458Z"},"maintainers":[{"name":"berezins","email":"berezins@gmail.com"}],"description":"Experimental bindings to obs-studio using nan directly","homepage":"https://github.com/stream-labs/obs-studio-node#readme","keywords":["capture","stream","record","twitch","youtube","obs","open","broadcaster","software","obs","studio","c++","c","native","desktop","video","audio","mixer","beam"],"repository":{"type":"git","url":"git+https://github.com/stream-labs/obs-studio-node.git"},"author":{"name":"Streamlabs","email":"support@streamlabs.com"},"bugs":{"url":"https://github.com/stream-labs/obs-studio-node/issues"},"license":"GPL-2.0","readme":"# libobs via node bindings\r\nThis library intends to provide bindings to obs-studio's internal library, named libobs accordingly, for the purpose of using it from a node runtime.\r\nCurrently, only Windows is supported.\r\n\r\n## Why CMake?\r\nCMake offers better compatibility with existing projects than node-gyp and comparable solutions. It's also capable of generating solution files for multiple different IDEs and compilers, which makes it ideal for a native module. Personally, I don't like gyp syntax or the build system surrounding it or the fact it requires you to install python.\r\n\r\n# Building\r\n\r\n## Prerequisites\r\nYou will need to have the following installed:\r\n\r\n* Git\r\n* [Node.js](https://nodejs.org/en/)\r\n* [Yarn](https://yarnpkg.com/en/docs/install#windows-stable)\r\n* [CMake](https://cmake.org/)\r\n\r\n### Windows\r\nBuilding on windows requires additional software:\r\n\r\n* [Visual Studio 2017 or 2015](https://visualstudio.microsoft.com/)\r\n* [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk) (may be installed with Visual Studio 2017 Installer)\r\n\r\n### Example Build\r\nWe use a flexible cmake script to be as broad and generic as possible in order to prevent the need to constantly manage the cmake script for custom uses, while also providing sane defaults. It follows a pretty standard cmake layout and you may execute it however you want.\r\n\r\nExample:\r\n```\r\nyarn install\r\ngit submodule update --init --recursive\r\nmkdir build\r\ncd build\r\ncmake .. -G\"Visual Studio 15 2017\" -A x64\r\ncmake --build .\r\ncpack -G ZIP\r\n```\r\n\r\nThis will will download any required dependencies, build the module, and then place it in an archive compatible with npm or yarn that you may specify in a given package.json.\r\n\r\n### Custom OBS Build\r\nBy default, we download a pre-built version of libobs if none is specified. However, this pre-built version may not be what you want to use or maybe you're testing a new obs feature.\r\n\r\nYou may specify a custom archive of your own. However, some changes need to be made to obs-studio's default configuration before building:\r\n\r\n* `ENABLE_SCRIPTING` must be set to `false`\r\n* `ENABLE_UI` must be set to `false`\r\n* `QTDIR` should *not* be specified.\r\n\r\nIf you don't know how to build obs-studio from source, you may find instructions [here](https://github.com/obsproject/obs-studio/wiki/Install-Instructions#windows-build-directions).\r\n\r\nExample (from root of obs-studio repository clone):\r\n```\r\nmkdir build\r\ncd build\r\ncmake .. -DENABLE_UI=false -DDepsPath=\"C:\\Users\\computerquip\\Projectslibobs-deps\\win64\" -DENABLE_SCRIPTING=false -G\"Visual Studio 15 2017\" -A x64\r\ncmake --build .\r\ncpack -G ZIP\r\n```\r\n\r\nThis will create an archive that's compatible with obs-studio-node. The destination of the archive will appear after cpack is finished executing.\r\n\r\nExample:\r\n\r\n> CPack: Create package using ZIP\r\n>\r\n> CPack: Install projects\r\n>\r\n> CPack: - Install project: obs-studio\r\n>\r\n> CPack: Create package\r\n>\r\n> CPack: - package: C:/Users/computerquip/Projects/obs-studio/build/obs-studio-x64-22.0.3-sl-7-13-g208cb2f5.zip generated.\r\n\r\nThis archive may then be specified as a cmake variable when building obs-studio-node like so:\r\n```\r\ncmake .. -G\"Visual Studio 15 2017\" -A x64 -DOSN_LIBOBS_URL=\"C:/Users/computerquip/Projects/obs-studio/build/obs-studio-x64-22.0.3-sl-7-13-g208cb2f5.zip\"\r\ncmake --build .\r\ncpack -G ZIP\r\n```\r\n\r\n### Further Building\r\nI don't specify every possible combination of variables. Here's a list of actively maintained variables that control how obs-studio-node is built:\r\n\r\n* All configurable node-cmake variables found [here](https://github.com/cjntaylor/node-cmake/blob/dev/docs/NodeJSCmakeManual.md).\r\n* `OSN_LIBOBS_URL` - Controls where to fetch the libobs archive. May be a directory, any compressed archive that cpack supports, or a URI of various types including FTP or HTTP/S.\r\n\r\nIf you find yourself unable to configure something about our build script or have any questions, please file a github issue!\r\n\r\ndefine `EXTENDED_DEBUG_LOG` controls logging of ipc requests. \r\n\r\n### Static code analyzis \r\n\r\n#### cppcheck \r\n\r\nInstall cppcheck from http://cppcheck.sourceforge.net/ and add cppcheck folder to PATH \r\nTo run check from console:  \r\n```\r\ncd build \r\ncmake --build . --target CPPCHECK\r\n```\r\n\r\nAlso target can be built from Visula Studio. \r\nReport output format set as compatible and navigation to file:line posiible from build results panel.  \r\n\r\nSome warnings suppressed in files `obs-studio-client/cppcheck_suppressions_list.txt` and `obs-studio-server/cppcheck_suppressions_list.txt`.\r\n\r\n#### Clang Analyzer \r\n\r\n`Ninja` and `LLVM` have to be installed in system. Warning: depot_tool have broken ninja.  \r\nTo make build open `cmd.exe`. \r\n\r\n\r\n```\r\nmkdir build_clang\r\ncd build_clang\r\n\r\n\"c:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\vcvars64.bat\"\r\n \r\nset CCC_CC=clang-cl\r\nset CCC_CXX=clang-cl\r\nset CC=ccc-analyzer.bat\r\nset CXX=c++-analyzer.bat\r\n#set CCC_ANALYZER_VERBOSE=1\r\n\r\n#make ninja project \r\ncmake  -G \"Ninja\" -DCLANG_ANALYZE_CONFIG=1 -DCMAKE_INSTALL_PREFIX:PATH=\"\"  -DCMAKE_LINKER=lld-link -DCMAKE_BUILD_TYPE=\"Debug\"   -DCMAKE_SYSTEM_NAME=\"Generic\" -DCMAKE_MAKE_PROGRAM=ninja.exe ..\r\n\r\n#try to build and \"fix\" errors \r\nninja.exe \r\n\r\n#clean build to scan \r\nninja.exe clean \r\n\r\nscan-build --keep-empty -internal-stats -stats -v -v -v -o check ninja.exe\r\n```\r\nStep with `\"fixing\"` errors is important as code base and especially third-party code are not ready to be build with clang. And files which failed to compile will not be scanned for errors.\r\n\r\n### Tests\r\n\r\nThe tests for obs studio node are written in Typescript and use Mocha as test framework, with electron-mocha pacakage to make Mocha run in Electron, and Chai as assertion framework.\r\n\r\nYou need to build obs-studio-node in order to run the tests. You can build it any way you want, just be sure to use `CMAKE_INSTALL_PREFIX` to install obs-studio-node in a folder of your choosing. The tests use this variable to know where the obs-studio-node module is. Since we use our own fork of Electron, you also need to create an environment variable called `ELECTRON_PATH` pointing to where the Electron binary is in the node_modules folder after you run `yarn install`. Below are three different ways to build obs-studio-node:\r\n\r\n#### Terminal commands\r\nIn obs-studio-node root folder:\r\n1. `yarn install`\r\n2. `git submodule update --init --recursive --force`\r\n3. `mkdir build`\r\n4. `cmake -Bbuild -H. -G\"Visual Studio 15 2017\" -A x64 -DCMAKE_INSTALL_PREFIX=\"path_of_your_choosing\"`\r\n5. `cmake --build build --target install`\r\n\r\n#### Terminal using package.json scripts\r\nIn obs-studio-node root folder:\r\n1. `mkdir build`\r\n2. `yarn local:config`\r\n3. `yarn local:build`\r\n4. Optional: To clean build folder to repeat the steps 2 to 3 again do `yarn local:clean`\r\n\r\n#### CMake GUI\r\n1. `yarn install`\r\n2. Create a build folder in obs-studio-node root\r\n3. Open CMake GUI\r\n4. Put obs-studio-node project path in `Where is the source code:` box\r\n5. Put path to build folder in `Where to build the binaries:` box\r\n6. Click `Configure`\r\n7. Change CMAKE_INSTALL_PREFIX to a folder path of your choosing\r\n8. Click `Generate`\r\n9. Click `Open Project` to open Visual Studio and build the project there\r\n\r\n#### Running tests\r\nSome tests interact with Twitch and we use a user pool service to get users but in case we are not able to fetch a user from it, we use the stream key provided by an environment variable. Create an environment variable called SLOBS_BE_STREAMKEY with the stream key of a Twitch account of your choosing.\r\n\r\n* To run all the tests do `yarn run test` \r\n* To run only run one test do `yarn run test --grep describe_name_value` where `describe_name_value` is the name of the test passed to the describe call in each test file. Example: `yarn run test --grep nodeobs_api`\r\n","readmeFilename":"README.md"}