|
| 1 | +# RTSPServer for RTS3903N based YI Cameras |
| 2 | +*While this repo is focused on Yi based cameras, it should compile and run on any RTS3903N based camera!* |
| 3 | + |
| 4 | +## Background |
| 5 | +It took many hours of research to put this together. The SDK was very hard to find, and I luckily stumbled across it by |
| 6 | +finding similar cameras (TP Link) that had shared the source due to GPL requirements. |
| 7 | + |
| 8 | +**Important**: This method doesn't overwrite the existing flash, simply remove the SD card, and the 'hack' will be disabled. |
| 9 | + |
| 10 | +## Getting Started |
| 11 | +- Download the latest zip from the releases page |
| 12 | +- Extract the contents to the root of a MicroSD card (minimum 2GB) that is FAT32 partitioned |
| 13 | +- (Optional) If you're using WiFi, edit Factory/wpa_supplicant.conf and add your WiFi credentials |
| 14 | +- Connect to RTSP via `rtsp://[YOUR_CAMERA_IP]/ch0_0.h264` |
| 15 | +- Does the picture look normal? No, see troubleshooting below |
| 16 | + |
| 17 | +### What's Working |
| 18 | +- H264 encoded stream via `rtsp://[YOUR_CAMERA_IP]/ch0_0.h264` |
| 19 | +- Telnet server open by default (root, no password) |
| 20 | +- WiFi connection without having to go through the initial vendor pairing process |
| 21 | +- Yi Camera |
| 22 | + - Tested with `7.1.00.25A_202002271051` and |
| 23 | + |
| 24 | +### TODO: |
| 25 | +- Add audio to the feed |
| 26 | +- Control PTZ (pan/tilt) based cameras |
| 27 | +- ONVIF |
| 28 | +- Better documentation |
| 29 | +- Create a flash version / permanent solution |
| 30 | +## Developers / Compiling |
| 31 | +- Install Docker |
| 32 | +- Run `./compile.sh` |
| 33 | +- This chipset is very capable and there are many features / options available for the encoder see `stream.c` where there are |
| 34 | +calls to `manage_modes` |
| 35 | + - To find out what options are available see `rtsvideo.h` where `enum_rts_video_ctrl_id` is defined. |
| 36 | +- If you create / discover better settings to improve the picture quality, please push to this repo :) |
| 37 | + |
| 38 | +## Video Quality |
| 39 | +- See the `Developers/Compiling` section and tweak the settings in `stream.c` inside the `start_stream()` function - |
| 40 | + if you find an improved configuration, **please push it to this repo**, so we can all benefit. |
| 41 | +- Significant settings: |
| 42 | + - h264_attr.bps |
| 43 | + - RTS_VIDEO_CTRL_ID_NOISE_REDUCTION |
| 44 | + - RTS_VIDEO_CTRL_ID_LDC |
| 45 | + - RTS_VIDEO_CTRL_ID_DETAIL_ENHANCEMENT |
| 46 | + - RTS_VIDEO_CTRL_ID_3DNR **(Offers significant improvement but can't find the 'sweet' spot)** |
| 47 | + - RTS_VIDEO_CTRL_ID_IR_MODE **(If you're having issues with nightmode)** |
| 48 | +## Troubleshooting |
| 49 | +The RTS3903N has a dedicated ADC that's used for sensing the light, I've discovered that some cameras had their logic inverted |
| 50 | + and to get around this, do the following |
| 51 | +- Create an empty file on the root of the sd card named `invert_adc` (exact path `/sdcard/invert_adc`) |
| 52 | + |
| 53 | +If this doesn't solve the issue, take a look at the `stream.c` where `sensor_sensitivity` is declared. |
| 54 | + |
| 55 | +## Credit |
| 56 | +- The RTSPServer part of this repo was taken from another repo, full credit to be given to: |
| 57 | + - `roleo` I believe is the original author[?] |
| 58 | + - `alienatedsec` I copied the modified version that repo |
0 commit comments