The RTMP client's totalBytesReceived counter grows unbounded as a JavaScript number. When it exceeds 2^31 (~2.15 GB received), the writeUInt32BE call in sendAcknowledgementIfNeeded throws a RangeError because JavaScript bitwise operations produce signed 32-bit integers. This crashes the RTMP session and drops the video stream. For a high-bitrate camera like the Reolink D340P (~4 Mbps main stream), this overflow occurs after approximately 90 minutes of continuous streaming, causing periodic stream drops at a consistent interval. Fix by using the unsigned right shift operator (>>> 0) to keep totalBytesReceived and bytesToAck in the unsigned uint32 range [0, 4294967295], matching the RTMP spec's sequence number wrapping behavior. Co-authored-by: Josh Casada <joshcasada@Joshs-Mac-mini.ts.net lan> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Scrypted
Scrypted is a high performance home video integration platform and NVR with smart detections. Instant, low latency, streaming to HomeKit, Google Home, and Alexa. Supports most cameras. Learn more.
Installation and Documentation
Installation and camera onboarding instructions can be found in the docs.
Community
Scrypted has active communities on Discord, Reddit, and Github. Check them out if you have questions!
Development
Debug Scrypted Plugins in VS Code
# this is an example for homekit.
# check out the code
git clone https://github.com/koush/scrypted
cd scrypted
# get the dependencies for the server and various plugins
./npm-install.sh
# open the homekit project in VS Code
code plugins/homekit
You can now launch (using the Start Debugging play button) the HomeKit Plugin in VS Code. Please be aware that you do not need to restart the Scrypted Server if you make changes to a plugin. Edit the plugin, launch, and the updated plugin will deploy on the running server.
If you do not want to set up VS Code, you can also run build and install the plugin directly from the command line:
# currently in the plugins/homekit directory.
npm run build && npm run scrypted-deploy 127.0.0.1
Plugin SDK Documentation
Want to write your own plugin? Full documentation is available here: https://developer.scrypted.app
Debug the Scrypted Server in VS Code
Debugging the server should not be necessary, as the server only provides the hosting and RPC mechanism for plugins. The following is for reference purpose. Most development can be done by debugging the relevant plugin.
# check out the code
git clone https://github.com/koush/scrypted
cd scrypted
# get the dependencies for the server and various plugins
./npm-install.sh
# open server project in VS Code
code server
You can now launch the Scrypted Server in VS Code.