Development has moved
\nNeolink is now maintained at https://github.com/QuantumEntangledAndy/neolink as I no longer have time to dedicate to development.\nPlease direct your thanks and bug reports over there!
\nNeolink
\n\nNeolink is a small program that acts as a proxy between Reolink IP cameras and\nnormal RTSP clients.\nCertain cameras, such as the Reolink B800, do not implement ONVIF or RTSP, but\ninstead use a proprietary \"Baichuan\" protocol only compatible with their apps\nand NVRs (any camera that uses \"port 9000\" will likely be using this protocol).\nNeolink allows you to use NVR software such as Shinobi or Blue Iris to receive\nvideo from these cameras instead.\nThe Reolink NVR is not required, and the cameras are unmodified.\nYour NVR software connects to Neolink, which forwards the video stream from the\ncamera.
\nThe Neolink project is not affiliated with Reolink in any way; everything it\ndoes has been reverse engineered.
\nSupported cameras
\nNeolink intends to support all Reolink cameras that do not provide native RTSP.\nCurrently it has been tested on the following cameras:
\n- \n
- B800/D800 \n
- B400/D400 \n
- E1 \n
- Lumus \n
- 510A \n
Neolink does not support other cameras such as the RLC-420, since they already\nprovide native RTSP.
\nUsage
\n- \n
- \n
First, write a configuration yaml file describing your cameras. See the\nConfiguration section below or the provided sample config.
\n \n - \n
Launch Neolink:
\n \n
neolink rtsp --config=your_config.yaml
- \n
- Then, connect your RTSP viewer to
rtsp://127.0.0.1:8554/your_camera_name! \n
Additional commands
\nNeolink also has some additional command line tools\nfor controlling the camera. They are all used through neolink subcommands like this:
\nneolink subcommand --config=...
The currently supported subcommands are
\n- \n
- rtsp: The standard neolink rtsp bridge \n
- status-light: Control the LED status light \n
- reboot: Reboot a camera \n
- talk: Enable talk back through either the microphone or by\nreading a sound file. \n
For a full list of commands use neolink help, or use\nneolink help <subcommand> for details on a subcommand of interest.
Download & Installation
\nBuilds are provided for the following platforms:
\n- \n
- Windows x86_64 (download) \n
- macOS x86_64 (download) \n
- Ubuntu/Debian x86_64 (download) \n
- Ubuntu/Debian x86 (download) \n
- Debian aarch64 (Raspberry Pi 64-bit) (download) \n
- Debian armhf (Raspberry Pi 32-bit) (download) \n
- Arch Linux (AUR) \n
- Docker x86 (see below) \n
Windows/Linux
\n- \n
- \n
Install Gstreamer from the most recent MSI installer on Windows,\nor your package manager on Linux.
\nOn Ubuntu/Debian machines gstreamer can be installed with:
\n\nsudo apt install \\\n libgstrtspserver-1.0-0 \\\n libgstreamer1.0-0 \\\n libgstreamer-plugins-bad1.0-0 \\\n gstreamer1.0-plugins-good \\\n gstreamer1.0-plugins-bad
\n - \n
If you are using Windows, add the following to your
\nPATHenvironment variable:\n%GSTREAMER_1_0_ROOT_X86_64%\\bin\nNote: If you use Chocolatey to install Gstreamer, it does this\nautomatically.
\n \n - \n
Download and unpack Neolink from the links above.
\n- \n
- Note: you can also click on this link to see all historical builds.\nYou will need to be logged in to GitHub to download directly from the builds page (wget doesn't work) \n
Ubuntu/Debian/Raspberry Pi OS example:
\n\nunzip release-arm64-buster.zip\nsudo cp neolink /usr/local/bin/\nsudo chmod +x /usr/local/bin/neolink
\n - \n
Write a configuration file for your cameras. See the section below.
\n \n - \n
Launch Neolink from a shell, passing your configuration file:
\n\nneolink rtsp --config my_config.toml
\n - \n
Connect your NVR software to Neolink's RTSP server.
\nThe default URL is
\nrtsp://127.0.0.1:8554/your_camera_nameif you're running\nit on the same computer.\nIf you run it on a different server, you may need to open firewall ports.\nSee the \"Viewing\" section below for more troubleshooting. \n
Docker
\nA Docker image is also available containing Neolink and all its dependencies.\nThe image is thirtythreeforty/neolink.\nPort 8554 is exposed, which is the default listen port.\nYou must mount a configuration file (see below) into the container at\n/etc/neolink.toml.
Here is a sample launch commmand:
\ndocker run \\\n -p 8554:8554 \\\n --restart=on-failure \\\n --volume=$PWD/config.toml:/etc/neolink.toml \\\n thirtythreeforty/neolinkHere is an example docker-compose:
\n---\nversion: \"2\"\nservices:\n neolink:\n image: thirtythreeforty/neolink\n container_name: neolink\n ports:\n - 8554:8554\n volumes:\n - $PWD/neolink.toml:/etc/neolink.toml\n restart: unless-stopped
The Docker image is \"best effort\" and intended for advanced users; questions\nabout running Docker are outside the scope of Neolink.
\nIf you use a battery-powered camera (or other UDP-only camera) you will need to either\nuse --net=host or setup a macvlan\nfor the docker image that supports UDP broadcast.\nThis is because UDP requires that udp broadcast messages are transmitted across\nthe docker network interface, however this is not possible in the default\nbridging mode
Configuration
\nNote: for a more comprehensive setup tutorial, refer to the\nBlue Iris setup walkthrough in docs/ (which is probably\nalso helpful even with other NVR software).
Note: more comprehensive setup details for linux based devices is provided in\ndocs/unix_setup.md
\nNote: instructions for also setting up a (systemd based) service for linux\nbased devices is provided in docs/unix_service.md
\nCopy and modify the sample_config.toml to specify the address, username, and\npassword for each camera (if there is no password, you can omit that line).\nThe default credentials for some cameras is username admin password 123456.
- \n
- \n
For a non battery powered camera you need to provide the address field with the\nip and port (default 9000).
\n \n - \n
For a battery powered camera you need to provide the uid field with the\ncamera's UID. In this case your network must support UDP.\nBattery cameras exclusively use this UDP mode so you must always use a UID.
\n \n
Each [[cameras]] block creates a new camera; the name determines the RTSP\npath you should connect your client to.
By default, the HD stream is available at the RTSP path /name or\n/name/mainStream, and the SD stream is available at /name/subStream.\nYou can use only the HD stream by adding stream = \"mainStream\" to the\n[[cameras]] config, or only the SD stream with stream = \"subStream\".
Note: The B400/D400 models only support a single stream at a time, so you\nmust add this line to sections for those cameras.
\nBy default Neolink serves on all IP addresses on port 8554.\nYou can modify this by changing the bind and the bind_port parameter.\nYou only need one bind/bind_port setting at the top of the config file.
You can enable rtsps (TLS) by adding a certificate = \"/path/to/pem\" to the\ntop section of the config file. This PEM should contain the certificate\nand the key used for the server. If TLS is enabled all connections must use\nrtsps. You can also use client side TLS with the config option\ntls_client_auth = \"none|request|require\"; in this case the client should\npresent a certificate signed by the server's CA.
TLS is disabled by default.
\nYou can password-protect the Neolink server by adding [[users]] sections to\nthe configuration file, but this is not secure without also using TLS:
[[users]]\nname: someone\npass: somepass\nyou also need to add the allowed users into each camera by adding the following\nto [[cameras]].
permitted_users = [\"someone\", \"someoneelse\"]\nAnywhere a username is accepted it can take any username or one of the\nfollowing special values.
\n- \n
anyonemeans any user with a valid user/pass \nanonymousmeans no user/pass required \n
The default permitted_users list is:
- \n
- \n
\n[ \"anonymous\"]if no[[users]]were given in the config meaning no\nauthentication required to connect. \n - \n
\n[ \"anyone\" ]if[[users]]were provided meaning any authourised users can\nconnect. \n
You can change the Neolink log level by setting the RUST_LOG environment\nvariable (not in the configuration file) to one of error, warn, info,\ndebug, or trace:
- \n
- On sh: \n
- \n
- On Bash: \n
Viewing
\nConnect your RTSP client to the stream with the name you provided in the\nconfiguration file.
\nAgain, the default URL is rtsp://127.0.0.1:8554/your_camera_name if you're\nrunning it on the same computer as the client.\nThe smaller SD video is rtsp://127.0.0.1:8554/your_camera_name/subStream.
4K cameras send large video \"key frames\" once every few seconds and the client\nmust have a receive buffer large enough to store the entire frame.\nIf your client's buffer size is configurable (like Blue Iris), ensure it's set\nto 20MB, which should ensure plenty of headroom.
\nStability
\nNeolink has had minimal testing, but it seems to be very reliable in multiple\nusers' testing.
\nThe formats of all configuration files and APIs is subject to change as required\nwhile it is pre-1.0.
\nDevelopment
\nNeolink is written in Rust, and binds to Gstreamer to provide RTSP server\nfunctionality.
\nTo compile, ensure you have the Rust compiler, Gstreamer, and gst-rtsp-server\ninstalled.
\nThen simply run:
\n\nfrom this top directory.
\nBaichuan Protocol
\nThe \"port 9000\" protocol used by Reolink and some Swann cameras is internally\nreferred to as the Baichuan protocol; this is the company based in China that\nis known internationally as Reolink.
\nThis protocol is a slightly convoluted header-data format, and appears to have\nbeen upgraded several times.
\nThe modern variant uses obfuscated XML commands and sends ordinary H.265 or\nH.264 video streams encapsulated in a custom header.
\nMore details of the on-the-wire protocol are provided in dissector/.
Baichuan dissector
\nA Wireshark dissector is available for the BC wire protocol in the dissector\ndirectory.
It dissects the BC header and also allows viewing the deobfuscated XML in\ncommand messages.\n(It cannot deobfuscate newer messages that use AES encryption.)\nTo use it, copy or symlink it into your Wireshark plugin directory; typically\nthis is ~/.local/lib/wireshark/plugins/ under Linux.
Currently the dissector does not attempt to decode the Baichuan \"extension\"\nmessages except binaryData.\nThis will change in the future as reverse engineering needs require.
License
\nNeolink is free software, released under the GNU Affero General Public License\nv3.
\nThis means that if you incorporate it into a piece of software available over\nthe network, you must offer that software's source code to your users.
\n