YI stream is an attempt to make "YI Home camera" a standalone RTMP live streaming solution. Once YI is started, go to http://[YI IP] enter "Server URL" and "Stream Name" and camera will start publishing video and audio to RTMP server. It has been tested with YouTube and nginx-rtmp-module, but I believe it will work with other RTMP servers as well.
This solution is meant for educational purposes only. If you decide to flash your YI with this software, you are the only person responsible for any damages you make. Keep in mind that it is an early stage software and it may not work. You may brick your camera, and - for sure - you are breaking warranty agreement. Moreover, this firmware modification breaks all YI default functionality: YI mobile app will not work; no recording is possible.
YI I bought is Chinese version. The hw platform is 2. I did not tested this on any other YI versions.
- ./sd/home - contains proprietary software which I think is a property of Xiaomi Inc.,
- ./sd/test/*.g726 files are probably also proprty of Xiaomi Inc., I took them from 4pda.ru;
- ./sd/test/web/lighttpd - is a LigHttpd web server distributed on revised BSD license;
- ./sd/test/avworker-min - is a modified example of ffmpeg remuxing.c, ffmpeg itself is compiled with GPL 2.0 license;
- Bootstrap is licensed under the MIT license;
- jQuery is released under the MIT license;
- Flot is licensed under the MIT license;
- The rest (by me) is distributed under GPL 2.0;
- Although "YI stream" logo looks the same as the logo on http://www.xiaoyi.com/en/home.html, it is done by me;
- let me know if I am omitting anything
- YI firmware is 220.127.116.11L, taken from http://xiaoyi.querex.be/;
- Lighttpd is 1.4.39;
- ffmpeg is N-78887-g21234c8
How to flash it?
Copy the content of ./sd to the root of your SD card and follow the instructions on http://xiaoyi.querex.be/.
How to setup the camera?
In order to setup wifi, you will still need Xiaomi app. As my camera is Chinese version I am using Chinese version of app from here. Once camera says "Waiting to connect" you need to show it the QR code (from the app) with your wifi SSID and password. Camera will scan it and say "QR code scanned and successful", after few seconds it will say "Wifi is connected". Then (using your router DHCP listing) you find camera IP, go to http://[YI IP] and set up RTMP streaming.
Very useful information on how to setup the camera can be found here: https://yicamera.wordpress.com/2015/12/01/why-cant-i-pair-my-yi-home-camera/.
How does it work?
It uses ffmpeg for re-muxing and re-streaming av stream from RTSP on localhost to RTMP server. Additionaly a simple HTML UI has been made to start/stop streaming, checking an output logs and monitoring bandwidth.
Is this software secure?
Absolutely, not. HTTP of the camera is wide open. Please do not expose it to open Internet.
Does it communicates to Xiaomi servers?
I do not think so. I have removed: /home/cloud and /home/goolink.
What else has been removed?
Check ./sd/test/equip_test.sh (at the end of the file) for all the files that I am removing from /home directory.
Do RTSP, Telnet and FTP work?
How did I build the software?
First, I took Hi3518_SDK_V18.104.22.168.tgz, links can be found on http://nemon.org/ipcam-ipr1631x/. Then compiled lighttpd and ffmpeg with the arm-hisiv100-linux, wrote simple cgi and html/js gui.
Why it cannot stream HD?
The top command shows that ./rmm process takes ~297.4 of %MEM, while ./rtspsvr takes ~86.4 of %MEM. When I am starting avworker-min the out of memory killer kills it. I was able to stream HD, when I killed all processes except rmm and rtspsrv (killall log_server && killall watch_process && killall led_ctl && killall tcpsvd && killall telnetd), but it cannot be treated as a solution. Perhaps you will find a solution for this.