roleoroleo / yi-hack-Allwinner-v2

Custom firmware for Yi 1080p camera based on Allwinner platform
MIT License
844 stars 96 forks source link

Support Request: Yi/Xiaoyi Camera Y4 #712

Closed gaochunmeng closed 1 year ago

gaochunmeng commented 1 year ago

I have a Yi/Xiaoyi Camera Y4 in my hand

Version: 9.0.09.06, 202103291039

ID: IFCNY39YFQ**

What should I do?

roleoroleo commented 1 year ago

Use y29ga

gaochunmeng commented 1 year ago

After using y29ga hack, I saw the Factory.done folder, and now the device is always on with a yellow light when turned on, regardless of whether I have inserted an SD card or not

roleoroleo commented 1 year ago

Did you fix the problem with yellow light?

boer0327 commented 1 year ago

In my case, I saw Factory.done folder too. but the camera will keep restarting. when I try to remove the SD card, it will go to normal without hack.

my version is 9.0.58.00_202206211052

Could you help me with this? thx

boer0327 commented 1 year ago

log_no_wifi_dev.tar.gz btw this is my log file, is it caused by no wifi issue? but I think it should not auto restart even if there is no wifi connected. but actually, I have configured Yi app and wifi working fine.

roleoroleo commented 1 year ago

my version is 9.0.58.00_202206211052

Sorry but your cam is not supported at the moment. Please send me a backup of the original firmware.

boer0327 commented 1 year ago

thx roleoroleo. please refer to the original firmware below. any update, please let me know, thx.

LINK REMOVED

roleoroleo commented 1 year ago

Please try this beta: y213ga_0.2.9.tar.gz

If RTSP and snapshot don't work, send me a copy of the file /dev/shm/fshare_frame_buf

boer0327 commented 1 year ago

Thx Roleroleo. this version partal working.

  1. High res stream, just show green. see screenshot image
  2. High res snapshot is not working, show a blank screen.
  3. Low res snapshot is working good

here is /dev/shm/fshare_frame_buf file fshare_frame_buf.zip

roleoroleo commented 1 year ago

Your cam uses hevc. I need time to add the support.

boer0327 commented 1 year ago

ok, thx. let me know if you have further update for this. is there anyway I can downgrade camera to old version?

roleoroleo commented 1 year ago

Old fw version or old hack version?

Try these binaries: bins.tar.gz

boer0327 commented 1 year ago

Thx reoleoroleo. I mean old fw version. I was thinking you may not be that quick to finish the new version. so I am trying to downgrade to old fw version and it may can temp to solve this issue. But you are amazing. very quick to get this update. thank you so much. I will try it later today. and will let you know, if there still has any issue.

boer0327 commented 1 year ago

Thx reoleoroleo. good news, High res stream is working. Low res snapshot work as well. But High res snapshot still not working. this is main feature what I wanted. because I am using MJPEG-Streamer connect. please help. thx

roleoroleo commented 1 year ago

Thx reoleoroleo. I mean old fw version. I was thinking you may not be that quick to finish the new version. so I am trying to downgrade to old fw version and it may can temp to solve this issue. But you are amazing. very quick to get this update. thank you so much. I will try it later today. and will let you know, if there still has any issue.

It's possible to downgrade to another fw version (if you have it) but this will not help to run this hack. This model (y213ga) is new and it's not supported.

But High res snapshot still not working. this is main feature what I wanted. because I am using MJPEG-Streamer connect. please help. thx

I will check the code.

boer0327 commented 1 year ago

ahh, that makes sense. I saw this model support H265, in yi app, I can switch mode between h264/h265.

thank you so much, let me know if any updates. :)

roleoroleo commented 1 year ago

Ok, try these binaries: bins.tar.gz

boer0327 commented 1 year ago

thx roleoroleo. everything is working now. but there are still has big problem, video update very slow. it is about 30s delay for every move. this is almost cannot use on any place. :( . But when I try use yi APP. everything is sync without any problem. I think there are still has something wrong. please have look. Let me know if you need any log or something. thx so much for you update. I think almost there.

boer0327 commented 1 year ago
image

here is top command given result. CPU looks much higher, but Yi App video looks ok. so I am not sure what happen. just give you for refer.

roleoroleo commented 1 year ago

I don't understand. Is video low in terms of fps? Is there too much delay?

boer0327 commented 12 months ago

yes, it is too much delay. for example, if you wave your handle in the camera, normally it will wave your handle just in time in the app/stream. actually, Yi app is just in time. I am using the RTSP stream play on VLC, it will be delayed about 15s. If I am using MJPG stream and check it on the website. it will delay about 30s. Is this clear for this issue?

roleoroleo commented 12 months ago

yes, it is too much delay. for example, if you wave your handle in the camera, normally it will wave your handle just in time in the app/stream. actually, Yi app is just in time. I am using the RTSP stream play on VLC, it will be delayed about 15s.

Please, try another client, for example WebRTC, if you have Home Assistant.

If I am using MJPG stream and check it on the website. it will delay about 30s. Is this clear for this issue?

MJPEG?!? The cam doesn't stream with MJPEG, only h264/hevc. What do you mean exactly?

boer0327 commented 12 months ago
image

sorry for confusing you. see what I have attached doc. why I cannot use WebRTC, because it is only support Raspberry device. So I have to use Adaptive MJPEG-Streamer. this uses a snapshot URL and pulls individual images. see the above screenshot.

so in the hacker page, it has high res snapshot (http://192.168.0.46/cgi-bin/snapshot.sh?res=high&watermark=yes). I use it add to system. so I use this high res snapshot to add it to the system. It looks working. but the problem is the picture lag is very serious. I am trying to figure out if it is caused by a system issue or a snapshot issue. I am trying to open the snapshot url on Chrome. refresh the page every 2 sec. I saw this image update is dealy. so I think it is caused by the snapshot feature issue.

I hope this makes sense for you. the key problem should be snapshot slow and dealy.

boer0327 commented 12 months ago

https://github.com/roleoroleo/yi-hack-Allwinner-v2/assets/1627892/cf8e6e73-8754-4c33-af01-a70a74e1dbd8

let me give you an example, you can see the above video, the left one is using high res snapshot(Adaptive MJPEG-Streamer). and the right side is RTSP stream play on VLC. you can see how delay for the left screen. almost not working.

boer0327 commented 12 months ago

and I am sure this is not cause by mainsail(it is printer manage sysytem which you see left UI) issue. because I have use another camera using same way, everything is working correctly. RTSP looks ok, but it is still dealy than Yi app output.

I think snapshot issue should be cause by imggrabber in bin folder? I am not familiar with this. just some guess. :)

Let me know if you get any feedback, thx

roleoroleo commented 12 months ago

Sorry but you can't fix this problem. Snapshot feature is very expensive in terms of cpu/memory resources and the process to take a snapshot requires a lot of time. So, if you create a stream with a snapshot sequence, it will be delayed. You have to use the rtsp protocol, with the rtsp url or through the onvif protocol.

boer0327 commented 12 months ago

ok, got it. thx. but seems rtsp protocol looks still delay than Yi APP and some time it will frezon, you can check the above video. but YI app will don't have this problem. could you optimize it. or if you can build a H265 version? I think it will much fast than H264.

roleoroleo commented 12 months ago

Yi app uses a custom protocol to deliver the stream. The delay of the rtsp protocol is higher than the delay of the app but it's not so big. And it depends on the client, for example if you use WebRTC component in ha, the delay is very low. About h265 I can't change the codec because the stream is produced by the hw accelerator inside the soc. There is an experimental setting https://github.com/roleoroleo/yi-hack-Allwinner-v2/issues/484#issuecomment-1251916480 that changes codec from h264 to h265 and viceversa but it's tested only for r30gb.

boer0327 commented 12 months ago

thx roleoroleo for explain this. that's all make sense.

I think I find delay issue. if I am try to disable movement event feature on YI app, everything will much fast than before. and all dealy is acceptable.

I try to bypass snapshot feature. I am use a docker container to convert rstp to jpg on my router(because my router is much powerful device). use this way snapshot dealy also been fixed.

so I think your solution basic working for this camera. :)