TheCrypt0 / yi-hack-v4

New Custom Firmware for Xiaomi Cameras based on Hi3518e Chipset. It features RTSP, SSH, FTP and more!
GNU General Public License v3.0
1.53k stars 219 forks source link

RTSP for mstar platform #128

Open roleoroleo opened 4 years ago

roleoroleo commented 4 years ago

I correctly compiled all sources for the 6FUS (fw 4.5.0) camera. Now I would like to enable RTSP server. Since it is closed source, is there a binary compiled for mstar platform?

marcotuna commented 4 years ago

Hello @roleoroleo, can you provide the files to flash the camera (6FUS)? Or explain the steps you took? I have this camera and I would like to contribute Thanks!

roleoroleo commented 4 years ago

I don't have a final solution yet, but if you want to try I can give you a rootfs file system with a telnet access: https://repository.ilpuntotecnico.com/files/roleo/public/yi_home_1080p/sys_y203c.zip My version is 4.5.0.0A_201902261502 Unzip and copy it to the SD card, the name of the file must be sys_y203c. U-boot will copy the content in flash. I have also a home partition with dropbear, ftpd etc... but it's work in progress.

The steps I followed: 1 - I have unsoldered the qh128a flash and dumped it 2 - I got the various partitions and unpacked them 4 - I installed the SDK https://drive.google.com/file/d/1DnTe8G4FV4rMuopYFrdX6sx_ZeFv9YMD/view?usp=sharing 5 - I downloaded the git yi-hack-v4 and modified everything I needed to compile correctly 6 - I repacked the jff2 file system and loaded via SD

steef84 commented 4 years ago

Very nice, do you have an eta for the next version?

15goudreau commented 4 years ago

I'm also interested in this topic

HectorBravo commented 4 years ago

Me too. Please post updates

roleoroleo commented 4 years ago

I'm working on it following ideas from https://github.com/shadow-1/yi-hack-v3/issues/126 and https://github.com/xmflsct/yi-hack-1080p/issues/5#issuecomment-294326131 But the streaming buffer is different from previous versions. And my knowledge about h264 is not good. There is a /dev/fshare_frame_buf file that contains the stream (a circular buffer). But low res and high res streams are not separeted. Now I'm able to detect iframes but no pframes.

roleoroleo commented 4 years ago

I completed a first beta release: https://github.com/roleoroleo/yi-hack-6FUS_4.5.0 USE AT YOUR OWN RISK.

15goudreau commented 4 years ago

@roleoroleo Really great work you're doing! My main purpose is getting RTSP which seems like it is locked behind closed doors. So it doesn't seem like that is going to change any time soon correct? If that is the case, I'm going to look into other cameras like Wyze to get cheap RTSP.

roleoroleo commented 4 years ago

In this first beta, RTSP is working but not perfectly. Sometimes a frame is wrong and then the video breaks until the next i-frame.

The problem is that I'm not a video encoding expert. The frames of the high resolution video and those of the low resolution video are mixed. I can distinguish i-frames thanks to the SPS, but not p-frames. Assuming that the hi-res frame video comes before the low-res one I manage to extract them by looking at the poc field. But this procedure is not error free.

If someone wants to help me the code is in the ByteStreamFileSource.cpp file.

SurfingSpider commented 4 years ago

I know there is a fork that has it working with the 6fus cameras, but do you plan on integrating this into the yi-hack-v4? I really like this project and how it is being actively developed and would like to stick with it on all my cameras

roleoroleo commented 4 years ago

I don't know. I created a new project because I think it is very complicated to prepare a tree that compiles for two different hardware platforms. There are many different things: uClibc, uClibc++, RTSP...

skylarhays commented 4 years ago

Why isnt this working on 6fus 4.6 firmware can you please get this working for that?