wz_mini_hacks icon indicating copy to clipboard operation
wz_mini_hacks copied to clipboard

RTSP video display distorted with fast moving objects in frame

Open goldenhub77 opened this issue 2 years ago • 64 comments

All V3 cameras with current firmware, running RTSP 20FPS Max bitrate 2048, target 1024 get distortion/artifacts with fast moving objects. Impacts video quality but not audio. This is not occurring in Wyze app or if using Wyze's RTSP firmware.

goldenhub77 avatar Jun 27 '22 15:06 goldenhub77

May be similar to the issue I posted here, no resolution though: https://github.com/gtxaspec/wz_mini_hacks/discussions/121

clee604 avatar Jun 27 '22 16:06 clee604

@clee604 Yes, this is exactly what I'm experiencing. It is not a connectivity issue because I have perfect signals and it only occurs when using the RTSP server loaded with wz_mini_hacks.

goldenhub77 avatar Jun 27 '22 16:06 goldenhub77

if you change the encoder mode, to 4 or 8, does this still happen?

gtxaspec avatar Jun 27 '22 16:06 gtxaspec

@gtxaspec Yes, I tried 4 and 8 and it still occurs.

goldenhub77 avatar Jun 27 '22 17:06 goldenhub77

@gtxaspec How ever Wyze programmed RTSP on their firmware it works perfect but has other bugs with their accessories like the spotlight. Is there anyway you can assess the RTSP firmware if I share it?

goldenhub77 avatar Jun 27 '22 17:06 goldenhub77

We have their firmware, and we are unable to implement it the way they are doing it without the original source code.

One other suggestion, if you disable "motion tagging" in the app does it still occur as well?

gtxaspec avatar Jun 27 '22 17:06 gtxaspec

I disabled motion tagging as one of the first things after implementing rtsp because I hated the green boxes and it still occurs.

clee604 avatar Jun 27 '22 17:06 clee604

@gtxaspec gotcha, I already have motion tagging disabled but it still occurs.

goldenhub77 avatar Jun 27 '22 17:06 goldenhub77

It's strange, because I can not reproduce this on my end. The way I test (rtsp stream)

WiFi or ethernet place the camera infront of a big tv and then run some fast motion > no artifacts place the camera in front of my and then I move around really fast > no artifacts place camera with phone upclose for testing > no artifacts

gtxaspec avatar Jun 27 '22 17:06 gtxaspec

I was able to get some artifacts just now only by changing the router to a wifi channel that is congested. The artifacts still do not happen on wired ethernet. I will continue to investigate this as a software issue on the camera

gtxaspec avatar Jun 27 '22 17:06 gtxaspec

another suggestion (for testing) disable continuous or motion recording to micro sd in the app, to test. I've found when the microsd card is slow or failing, iCamera does not like that and problems occur.

gtxaspec avatar Jun 27 '22 17:06 gtxaspec

@gtxaspec much appreciated with any support or solutions that can be found. I just came across this repository yesterday so I am not familiar with the code base at all. I disabled microSD recording as well, but still artifacts. The card I'm using is a Samsung Class 10.

goldenhub77 avatar Jun 27 '22 17:06 goldenhub77

similar results here: disabling sd card recording does not make a difference. @gtxaspec how are you viewing the RTSP stream? I noticed if I have HW acceleration on (using tinycam) there's artifacts. However using SW decoding or VLC there's no artifacts, but instead it frame skips.

clee604 avatar Jun 27 '22 17:06 clee604

i test using:

VLC recording via ffmpeg I can test via tinycam stand by

gtxaspec avatar Jun 27 '22 17:06 gtxaspec

using VLC on my pc i don't really notice any artifacts or frameskips..

VLC on my ipad shows some frameskips...

Maybe some kind of error correction is better on the PC VLC?

clee604 avatar Jun 27 '22 17:06 clee604

Ok, following up, does this happen on the 360p stream as well?

gtxaspec avatar Jun 28 '22 03:06 gtxaspec

@gtxaspec Yes

goldenhub77 avatar Jun 28 '22 04:06 goldenhub77

This is an interesting one, as I do run Ethernet-only, no Wifi, (except for backup).

I only saw this issue when I was at 20 FPS. If I knock it down to 15 FPS, the issue goes away.

I didn't really try to track anything down further, as I am OK with 15 FPS for my needs/uses.

Are the people that are seeing the blurring running at 20 FPS? Are you all on Ethernet? Wifi? Both?

skilau avatar Jun 28 '22 14:06 skilau

@skilau I am on Wifi at 20fps. I do not get any tearing or artifacts while using the RTSP firmware directly from Wyze but the audio is distorted. This implementation has perfect audio but the video is distorted.

goldenhub77 avatar Jun 28 '22 14:06 goldenhub77

I tested on both ethernet and wifi, and FPS at 15, 20, and blank; all the same issue for me

clee604 avatar Jun 28 '22 14:06 clee604

I have the same problem with three v3 cams, but they're all on Wifi. The RTSP stream was prefect before updating to the "06-24-22" update, but now I get lots of artifacts and corruption in the video feed. Of my three v3 cams, I put two back on the Wyze RTSP firmware and now they're streaming fine. I'm leaving one of the latest wz_mini to troubleshoot. I have them set to 15fps and it's hard to keep a stable feed.

Vanterax avatar Jun 28 '22 15:06 Vanterax

I'm not sure if it's related, but with the recent updates my V2 has video feed stability issues (both wyze app and RTSP). The feed seems to crash out, but the camera is still accessible by SSH.

clee604 avatar Jun 28 '22 16:06 clee604

if you revert to this release: https://github.com/gtxaspec/wz_mini_hacks/tree/cf02d1aeb96fafde1b19d5eb25a22b705e536df5

do the rtsp problems go away?

Heres what we changed on 06-24:

Enabled connection tracking in the Linux Kernel (via loadable module on v3, built-in on v2) RTL8189 WiFi Driver 5.7.9_35795.2019112 (vs the old v4.3.24.7_21113.20170208.nova.1.02)

My first thought would be, maybe one of the configuration parameters for the wireless driver are causing this, but it's mentioned it also happens on wired connections... hmm

gtxaspec avatar Jun 28 '22 16:06 gtxaspec

8189fs.ko.gz Here is an updated build of the wifi driver for the V3 (only v3), if anyone wants to test, rename the old one 8189fs.ko.old and replace it with this one after you extract it. It's located in /opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__/extra/8189fs.ko

gtxaspec avatar Jun 28 '22 17:06 gtxaspec

Reverted to the previous release fixes my issue with the RTSP feed. It's solid and consistent without artifacts or skipping. I have a 4th spare V3 that I'll be using to test the new wifi driver, but I have to wait for a new SD card coming from Amazon tomorrow. :)

Vanterax avatar Jun 28 '22 17:06 Vanterax

8189fs_v2.ko.gz @clee604 here is a new driver for the v2 if you want to test. the path to replace the driver is /opt/wz_mini/lib/modules/3.10.14/extra/8189fs.ko make sure you name it 8189fs.ko

gtxaspec avatar Jun 28 '22 17:06 gtxaspec

thanks @gtxaspec, currently on my V2 I'm rolling back and testing older releases to see if I can get ethernet to work again first. Then I'll test the rtsp stream stability and the new wifi driver after.

My V3s are in use so I don't want to touch until I'm confident i have enough time to test and fix it they stop working

clee604 avatar Jun 28 '22 17:06 clee604

thanks for the feedback and testing everyone! I have almost every camera, and with every release I make sure I test every model camera I have both wifi and Ethernet. So hopefully we can track this down and figure out what's going on

gtxaspec avatar Jun 28 '22 18:06 gtxaspec

I didn't think the wifi driver would change anything on my asix ethernet connected V3 but I tried anyways. no improvement with the artifacts. I will try rolling back the V3 to the above posted version later to see if it improves artifacts.

clee604 avatar Jun 28 '22 20:06 clee604

@clee604 if i can compile a new kernel with some changes would you be able to test it on your v2?

gtxaspec avatar Jun 28 '22 21:06 gtxaspec