EliasKotlyar / Xiaomi-Dafang-Hacks

4.17k stars 1k forks source link

Blue Iris losing RTSP connection to WyzeCam V2 #351

Closed ark-git closed 3 years ago

ark-git commented 6 years ago

I was able to connect to Blue Iris using RTSP. However after sometime it will lose connection and the only way to connect back to Blue Iris is to reboot. I also verified its not Blue Iris since it doesn't work with VLC also.

jmtatsch commented 6 years ago

Web UI still works? Look at your rtspserver.log maybe it died

ark-git commented 6 years ago

v4l2rtspserver-master.log Logs are attached. I also noticed that HTTP streaming also stopped, however I can still access through web browser but lagging.

jmtatsch commented 6 years ago

It seems to be creating a lot of sources for my taste. Can post the outputs of ps and free in such a situation?

ark-git commented 6 years ago

free.log ps.log see attached. Thanks

jmtatsch commented 6 years ago

hmm nothing extraordinary @nik0 do you see anything peculiar in the logs?

nik0 commented 6 years ago

In the server logs there are a lot of sessions creation. If you use only VLC does it also happen ?

nik0 commented 6 years ago

There is also something "strange" in logcat / logs sections ?

ark-git commented 6 years ago

@jmtatsch, btw, the logs above is from running the streaming in http mode. I will run the streaming in rtsp mode and will resend logs. attaching logs and logcat logs logcat.log logs.log

ark-git commented 6 years ago

I have disconnected the two WyzeCams from Blue Iris and running rtsp streaming only to vlc. Will update with the results later.

ark-git commented 6 years ago

VLC also loses connection after some time

nik0 commented 6 years ago

Does it recover some times, or at the first time does not recover ? Does the log looks the same? connection/disconnection/reconnection ... I suspect that many connection/disconnection lead to memory leaks ...

ark-git commented 6 years ago

If I restart the stream on VLC it will recover. Log files still look similar to before.

ark-git commented 6 years ago

Running top command shows the attached. top.log

nik0 commented 6 years ago

Does-it recover when you have the html page opened ?

ark-git commented 6 years ago

The RTSP does not disconnect when the html page is opened. Any clues?

nik0 commented 6 years ago

Yes ! The image capture and the stream were in the same thread. I don't know why, but VLC lose the connection after some time due to that. I made the correction, we have to re-publish the whole thing. There will be a lot of changements in the next release ....

EliasKotlyar commented 6 years ago

I have compiled a new v4l2server binary and pushed it here. Can someone test please if the breakups still occur?

ark-git commented 6 years ago

Cannot get image. See Video server log Contents of v4l2rtspserver-master.log

/system/sdcard/bin/v4l2rtspserver-master: can't load library 'libmp3lame.so.0' /system/sdcard/bin/v4l2rtspserver-master: can't load library 'libmp3lame.so.0'

EliasKotlyar commented 6 years ago

Ah ok, my mistake. I have updated it. There was a old library involved.

ark-git commented 6 years ago

The Html page now says "Unable to Load Image". See below for videoserver log. When I select RTSP H264 server in th edrop down menu, it goes back to not selected after some time.

Contents of v4l2rtspserver-master.log

2018-05-30 03:56:27.451 ( 2.181s) [main thread ] ImpEncoder.cpp:1180 0| Found Sensor with ID:22 i264e[info]: profile Constrained Baseline, level 3.1 2018-05-30 03:56:28.130 ( 2.860s) [main thread ] ImpEncoder.cpp:123 0| OSD pos 0,0,1279,36 2018-05-30 03:56:28.131 ( 2.862s) [main thread ] ImpEncoder.cpp:123 0| OSD pos 1240,0,1279,39 2018-05-30 03:56:29.159 ( 3.889s) [update_thread ] ImpEncoder.cpp:421 0| Changed OSD 2018-05-30 03:56:29.159 ( 3.889s) [update_thread ] ImpEncoder.cpp:485 0| Changed motion sensitivity=4 2018-05-30 03:56:29.160 ( 3.891s) [update_thread ] ImpEncoder.cpp:648 0| Detection region= ((0,0)-(1279,719)) /system/sdcard/bin/v4l2rtspserver-master: /home/ptkang/work/platform/isvp_20160504_e/proj/sdk-lv3/src/imp/ivs/ivs_move/src/filter.c: 156: Start: Assertion `filter->roi.x >= 0 && filter->roi.y >= 0 && filter->roi.width >= 0 && filter->roi.height >= 0 && filter->roi.x + filter->roi.width <= filter->wholeSize.width &&filter->roi.y + filter->roi.height <= filter->wholeSize.height' failed.

ark-git commented 6 years ago

@EliasKotlyar, any idea why its broken right now. I dont get the video feed on to the web page anymore. Am i doing something wrong. I just copied all the files from "Firmware Mod" folder onto the SD card and update wifi conf file and restart.

johnebgood commented 6 years ago

@ark-git I'm a first time user and I was having the same issue, from this other thread: https://github.com/EliasKotlyar/Xiaomi-Dafang-Software/issues/21 it appears something was compiled with 4 detection areas however it needs to be compiled with 16 detection areas. The work around is to turn off motion detection. Maybe someone will add an option to set the number of detection areas in a conf file and have some checks for failure and recommendations or auto detect?

ark-git commented 6 years ago

I was able to get RTSP streaming to work again by disabling "Motion Detection". However the stream stopped after some time even if I leave the Html page opened. See logs v4l2rtspserver-master.log

nik0 commented 6 years ago

Did you test with the really last version that have just been pushed ?

ark-git commented 6 years ago

I tested with the " Corrected #388 " released yesterday. That is why I had to disable "Motion Detection" to get it to work.

nik0 commented 6 years ago

With the last version you don’t need to deactivate the motion (hopefully) I got my camera working with VLC overnight

ark-git commented 6 years ago

I ran the "autoupdate.sh" scripts and got the following. See attached log. auto update.log

ark-git commented 6 years ago

@nik0 I just downloaded the latest from "Master Branch" and loaded the "Firmware Mod" files onto my second camera and I still had to disable "Motion Detection" for the stream to work.

nik0 commented 6 years ago

Can you run the command « env » before running the server ? env >> /tmp/error.log in run.sh script The LD_LIBRARY_PATH shall contains /system/sdcard/libs at first place...

ark-git commented 6 years ago

see below for error.log cat error.log USER=root LD_LIBRARY_PATH=/thirdlib:/system/lib HOME=/ OLDPWD=/sys/class/gpio TERM=vt102 PATH=/system/bin:/bin:/sbin:/usr/bin:/usr/sbin SHELL=/bin/sh PWD=/sys/class/gpio/gpio77 rmem=16M@0x7000000

nik0 commented 6 years ago

this is not good, you need to have D_LIBRARY_PATH=/system/sdcard/libs:/thirdlib:/system/lib Do you copy the latest run.sh ? Anyway you also need to have the https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/pull/395 merged

ark-git commented 6 years ago

I updated the "run.sh" file library path. See attached. I am not sure how to merge #395. So far all I do is download the "Firmware Mod" folder and write to the SDCARD using windows. Below is the error.log after I changed the run.sh file [root@WyzeMudroom:~]# cat /tmp/error.log USER=root LD_LIBRARY_PATH=/thirdlib:/system/lib HOME=/ OLDPWD=/sys/class/gpio TERM=vt102 PATH=/system/bin:/bin:/sbin:/usr/bin:/usr/sbin SHELL=/bin/sh PWD=/sys/class/gpio/gpio77 rmem=16M@0x7000000 run_sh_File.txt

nik0 commented 6 years ago

this is not good, you need to have D_LIBRARY_PATH=/system/sdcard/libs:/thirdlib:/system/lib try running autoupdate.sh script

ark-git commented 6 years ago

I updated my two cameras with the latest using the Autoupdate script. After a few hours both RTSP streams stopped. I also set one stream to be http and that too stopped overnight.

nik0 commented 6 years ago

What are the logs saying? Anything specific?

ark-git commented 6 years ago

Nothing much in the videoserver logs except for one error "RTCPInstance::RTCPInstance error: totSessionBW parameter should not be zero!". See attached logs v4l2rtspserver-master.log

nik0 commented 6 years ago

This error is "normal". But, there is a lot of connections (so de-connection), what is is client you are using ? VLC? And in the others logs ? logcat, and dmesg? nothing ?

ark-git commented 6 years ago

dmesg.log LogCat.log I use Blue Iris.

nik0 commented 6 years ago

can you test with VLC maybe the server does not support so many connections/disconnections

ark-git commented 6 years ago

I tested with VLC and the stream stopped by itself after a few mins. When I restart the stream it worked again. The videoserver logs just shows below repeating RTCPInstance::RTCPInstance error: totSessionBW parameter should not be zero! RTCPInstance::RTCPInstance error: totSessionBW parameter should not be zero! 2018-06-04 20:36:29.640 (1528158973.510s) [main thread ] DeviceSource.cpp:110 V4L2DeviceSource::doStopGettingFrames 2018-06-04 20:36:29.641 (1528158973.510s) [main thread ] DeviceSource.cpp:110 V4L2DeviceSource::doStopGettingFrames 2018-06-04 20:36:29.641 (1528158973.511s) [main thread ] DeviceSource.cpp:110 V4L2DeviceSource::doStopGettingFrames 2018-06-04 20:36:29.642 (1528158973.511s) [main thread ] DeviceSource.cpp:110 V4L2DeviceSource::doStopGettingFrames 2018-06-04 20:36:56.648 (1528159000.518s) [main thread ]ServerMediaSubsession.c:25 Creating Source... 2018-06-04 20:36:56.649 (1528159000.518s) [main thread ]ServerMediaSubsession.c:29 Creating H264 Source... 2018-06-04 20:36:56.649 (1528159000.518s) [main thread ]ServerMediaSubsession.c:51 Creating Sink for format : video/H264 2018-06-04 20:36:56.658 (1528159000.527s) [main thread ]ServerMediaSubsession.c:25 Creating Source... 2018-06-04 20:36:56.658 (1528159000.528s) [main thread ]ServerMediaSubsession.c:42 Creating normal Source... 2018-06-04 20:36:56.659 (1528159000.528s) [main thread ]ServerMediaSubsession.c:51 Creating Sink for format : audio/MPEG RTCPInstance::RTCPInstance error: totSessionBW parameter should not be zero! RTCPInstance::RTCPInstance error: totSessionBW parameter should not be zero!

ark-git commented 6 years ago

I also grabbed the log from VLC. See attached. The stream would run for 5mins and then stopped.

VLC Logs.log

olskar commented 6 years ago

I have the same issue running latest version from github, a reboot solves it a while

2018-06-14 19:42:52.413 (165534.849s) [main thread ]ServerMediaSubsession.c:25 0|Creating Source... 2018-06-14 19:42:52.413 (165534.849s) [main thread ]ServerMediaSubsession.c:29 0|Creating H264 Source... 2018-06-14 19:42:52.414 (165534.849s) [main thread ]ServerMediaSubsession.c:51 0|Creating Sink for format : video/H264 2018-06-14 19:42:56.744 (165539.180s) [main thread ] DeviceSource.cpp:110 0|V4L2DeviceSource::doStopGettingFrames 2018-06-14 19:43:02.388 (165544.824s) [main thread ]ServerMediaSubsession.c:25 0|Creating Source... 2018-06-14 19:43:02.389 (165544.824s) [main thread ]ServerMediaSubsession.c:29 0|Creating H264 Source... 2018-06-14 19:43:02.389 (165544.825s) [main thread ]ServerMediaSubsession.c:51 0|Creating Sink for format : video/H264 2018-06-14 19:43:06.746 (165549.181s) [main thread ] DeviceSource.cpp:110 0|V4L2DeviceSource::doStopGettingFrames 2018-06-14 19:43:12.418 (165554.854s) [main thread ]ServerMediaSubsession.c:25 0|Creating Source... 2018-06-14 19:43:12.418 (165554.854s) [main thread ]ServerMediaSubsession.c:29 0|Creating H264 Source... 2018-06-14 19:43:12.419 (165554.854s) [main thread ]ServerMediaSubsession.c:51 0|Creating Sink for format : video/H264 2018-06-14 19:43:16.764 (165559.200s) [main thread ] DeviceSource.cpp:110 0|V4L2DeviceSource::doStopGettingFrames 2018-06-14 19:43:22.425 (165564.861s) [main thread ]ServerMediaSubsession.c:25 0|Creating Source... 2018-06-14 19:43:22.426 (165564.861s) [main thread ]ServerMediaSubsession.c:29 0|Creating H264 Source... 2018-06-14 19:43:22.426 (165564.862s) [main thread ]ServerMediaSubsession.c:51 0|Creating Sink for format : video/H264 2018-06-14 19:43:26.747 (165569.183s) [main thread ] DeviceSource.cpp:110 0|V4L2DeviceSource::doStopGettingFrames

LukeRuppSr commented 6 years ago

I was able to flash the most recent firmware on my Wyze Cam v2, I am able to view the camera via the ip in a webpage. However I am not able to view it in Blue Iris. I am using RSTP. Would another BI user be willing to share their config? Thanks

ark-git commented 6 years ago

@LukeRuppSr. See attached for Blue Iris Configuration. My RTSP streaming on two cameras has been stable now. I disabled "Send RTSP Keep-Alives" in Blue Iris Configuration. I still have "No Signal" every now and then, but it recovers itself. In one camera the "No Signal" count has reached "7900" and on the other its "5770". I do not need to reboot the cameras.

camera properties network ip configuration

LukeRuppSr commented 6 years ago

I followed your BI configuration and I actually have data from the WyzeCam streaming to BI which is a big improvement. Before I did not even have an empty gray box which now I have.

Here are a couple of screenshots of my BI setup. The WyzeCam is Cam2 in my BI setup. You can see the camera appears to be connected.

[image: Capture.PNG] [image: Capture2.PNG]

At this point I am not sure if the problem is the RSTP configuration on the WyzeCam or some obscure setting i need to change in BI. I setup all the WyzeCam config files as is (default settings) with the exception of the WiFi config file.

Do you mind sharing your WyzeCam RSTP config file if your setup is not the default? Do you modify any of the other config files?

Thanks for your expertise.

Luke

On Mon, Jul 2, 2018 at 6:33 PM ark-git notifications@github.com wrote:

@LukeRuppSr https://github.com/LukeRuppSr. See attached for Blue Iris Configuration. My RTSP streaming on two cameras has been stable now. I disabled "Send RTSP Keep-Alives" in Blue Iris Configuration. I still have "No Signal" every now and then, but it recovers itself. In one camera the "No Signal" count has reached "7900" and on the other its "5770". I do not need to reboot the cameras.

[image: camera properties] https://user-images.githubusercontent.com/39158479/42189349-df56a992-7e25-11e8-9a1e-2ba4f7332428.PNG [image: network ip configuration] https://user-images.githubusercontent.com/39158479/42189350-df6b4b0e-7e25-11e8-86a5-5dbfe27d55a9.PNG

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/351#issuecomment-401957689, or mute the thread https://github.com/notifications/unsubscribe-auth/AdH_KvfmPcDZElojsFQEsHEKcRE-L4A2ks5uCp-fgaJpZM4T8jmo .

-- Luke C. Ruppersburg, Sr, Luke.Sr@Ruppersburg.net

ark-git commented 6 years ago

@LukeRuppSr I cannot see your images. My "rtspserver.conf" file is attached. I added "-vv" to the option section

rtspserver.txt

Frankster-NL commented 6 years ago

I am having the same (or similar) issue. Switching off motion detection does not resolve things. I did switch to 1080p before the issue arrived. Switching back to a lower resolution now automatically switches back to 1080p in the GUI after a second... Will try to reinstall the firmware later on.

LukeRuppSr commented 6 years ago

The rtsp config file did the trick. I have v2 working in Blue Iris. The image quality is as expected. I am surprised during the day the color rendering is actually better than my Foscam FI9900P. Thanks for the help.

Kindest Regards, Luke Sr.

On Wed, Jul 4, 2018 at 1:01 AM Frankster-NL notifications@github.com wrote:

I am having the same (or similar) issue. Switching off motion detection does not resolve things. I did switch to 1080p before the issue arrived. Switching back to a lower resolution now automatically switches back to 1080p in the GUI after a second... Will try to reinstall the firmware later on.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/351#issuecomment-402363574, or mute the thread https://github.com/notifications/unsubscribe-auth/AdH_KgzyN8Q4MZLZ0a6Be0hYo03jIrMMks5uDEwWgaJpZM4T8jmo .

-- Luke C. Ruppersburg, Sr, Luke.Sr@Ruppersburg.net

mchipser commented 6 years ago

I am having the same issue.. I have tried adding the -vv to my rtsp config and disabling motion, neither work..

ark-git commented 6 years ago

@mchipser Did you disable "Keep Alives" from Blue Iris. My two Wyzecams V2 now are working great with Blue Iris.