Skip to content

Unifi G3 Flex picture tearing

edited June 2020 in SecuritySpy
I'm not quite sure how to describe this, but every 10 seconds or so a part of the frame smears / tears on two of my Flex cameras. I have the latest build of SS, and I can see this occurring on both the Mac and the App.
I have just removed a couple of Hickvision cameras that were quite old, but I must admit didn't do this!
At the moment I don't have the Protect controller running so these were both in their standalone mode with everything set to max.
They were set up with the Unifi profile
Also every now and again the picture is delayed by 5-10 seconds....
If I monitor them directly in a browser they are perfect.
I have a third Hickvision bullet camera also running and that is perfectly stable
Before I start a load of testing, has anyone seen anything similar, or got any suggestions where to start?
Thanks
«1

Comments

  • It's difficult to imaging exactly what you are seeing, so when this happens could you please take a screenshot and email it to us at support@bensoftware.com. A screenshot either from the Mac or the iOS app would be fine.

    A network issue is a common cause of these types of problem. How is your Mac and this camera connected? Ideally they should both be wired into the same Gigabit Ethernet switch, is this the case?
  • I have suffered similar with the Unfi G3. The only fix (sadly for me) was to reduce frame rate and connection speed down to around 1mb. These run fine at full connection speed and frame rate in unifi protect software. I suspect it's something to do with how the RSTP is fed from the camera as it needs to be in stand alone to work in security spy. ? I have tried the preset profile in security spy - and manually yet still the only fix seems connection and frame rate related. In my setup they have dedicated cat6 ethernet yet running them throttled. real shame.
  • They’re connected on Gb switch, and yes lowering the frame rate to 10 seems to have cured it, enough to be useable. I have a G3 and G3 pro coming So will try them soon an see if I get the same.
    Also got a UDM pro coming so will run protect and then try streaming from protect, that may work better?
  • Unfortunately running from udmpro had zero affect for me. still had to be low frame rate and throttled connection speed. I have not a clue why. I wonder if Ben can help?
  • edited June 2020
    Been trying to catch it but it doesn't happen very often and last only about a second. But usually the bottom third of the picture blanks out or goes fuzzy and it freezes for a few moments.
    I can confirm I've now added UDM Pro and I still see it if I bump up the frame rate, its annoying mostly because it triggers the movement alert
  • I am convinced its how Security Spy looks at the incoming RSTP feed as running on Unifi I can run uptp 30Fps and 3Mbs with zero issues. but on security Spy am in the 10fps and under 1mb just to get stability. Ben can unifi be doing something with the RSTP to affect it in this way? thanks
  • I’ve also noticed high latency using the UniFi cameras. I’m pretty sure it’s SS as when I restart the app it catches up.
    I’ve got three G3 cameras and display the time on the screens and can often see one camera in particular be 40 seconds plus delayed. I’m using a quad core Mac Mini and it doesn’t appear to have high cpu usage. Any suggestions?
  • Ben any ideas what can be causing the loss of sync / need to have low frame rates and connection speed to work? Any pointers would be useful.
  • I'm not sure what could be going wrong here. Issues with delay usually only happen with the Mac's CPU is overloaded and can't process frames as fast as they are arriving.

    @evansgo are all your cameras the "G3 Flex" model?

    @jeff444 do you also have the "Flex" cameras, or some other G3 model?
  • edited June 2020
    Hi Ben the model is UVC G3 I have checked the CPU and its only 11% on this stream with hardware decoding and H264. It never goes past 15%. Really confusing as other streams using cheap cameras are doing higher frame rates and connection speed with no drop in sync/stuttering etc.
    In addition I have tried running from theRSTP stream in unifi protect and using the camera in standalone mode with the same issues. makes no sense to me at all why this should not work in a stable way? Also tried 2 separate cameras with same results. its weird.

    UVC-G3-Bullet / UVC-G3-AF
    • 1080p Full HD, 30 FPS
    • EFL 3.6 mm, ƒ/1.8
    • Outdoor Weather Resistant
    • 802.3af PoE or 24V Passive PoE
    • Built-in Microphone
    • Wall, Ceiling, or Pole Mount
    • High-Power IR Range Extender
  • Hi Ben, currently I have 2 x G3 flex and 1 x G3 pro. Nothing is looking overloaded, the mac mini is not close to working hard. The delay seems to have got better the longer its all left running and I noticed this exact same thing when I only had one G3 flex in standalone mode, for the first day or so it was awful, but then the lag slowly vanished. Never saw it with the hickvision cameras
  • Thanks for the info. I agree, it's very strange, there is no reason for such problems if the Mac's CPU is not overloaded. We've ordered one of these cameras to test with, and when it arrives I hope we will be able to improve things (if there is anything we can do on our side).
  • Thanks so much I have a few of these and would love to use them to replace my cheap china grey market cameras but at moment they are pretty much too unreliable. Thanks ben!
  • Brilliant thanks, let me know if I can help do any testing, I have 5 cams now so can load it up a bit to test stuff
  • I have noticed over time that although one camera connected direct to poe switch over time it slowly drops out of clock sync. Then it starts to have a loss of over 80%. tried different ports / cables and switches. The same slow degradation. I power reset on the camera resets and drift starts after a few hours again.
  • We have received our UniFi camera and have been testing with it, and we have seen a problem that manifests after 10-30 minutes or so, whereby the camera's data rate drops dramatically, the video is delayed, and there is significant packet loss resulting in corrupt video.

    As far as we can tell this is not something that SecuritySpy is doing - the actual data coming in is compromised at this point, and nothing can be done to decode it properly.

    One solution we have found is to use UDP transport rather than TCP transport. TCP is usually more reliable, but we do come across cameras from time to time that have problems with TCP for whatever reason, and operate much more reliably over UDP. UDP should work well provided you have a fast, reliable, wired network in place (not WiFi).

    So, in the latest 5.2.4b12 beta version of SecuritySpy, we have enabled an "RTSP UDP" Format option, which can be selected under Preferences -> Cameras -> Setup.

    So could you please all try this and report back.
  • edited July 2020
    OK have tried it but it wont connect. Tried it with a G3 Flex and a G3 Pro, I get timeouts.
    I am connecting via Unifi Protect though and not with the Cams in standalone mode, not sure if thats making the difference.
    The only format I can get to work is RTSP-over-HTTP, RTSP on its own doesn't work either, maybe I have something incorrectly set up?
    IP is the UDM Pro
    HTTP set to 7447
    RTSP set to 554
    USername and password are correct
    Manual Config
    Format is RTSP-overoHTTP
    Request has the designated code in it.
  • Connected fine - power cycled cameras and will run for a day and see the results on UDP.
    Normally the daily report highlights the packet loss so will wait to see what it throws up over the next reporting period. Thanks.
  • edited July 2020
    Camera 1 with Beta release 12 UDP
    - 105 movie files recorded
    - 0 image files recorded
    - 609 MB of data recorded
    - 29 errors
    - 99.8% camera uptime

    Camera 2 Beta with release 12 UDP
    - 178 movie files recorded
    - 0 image files recorded
    - 1.6 GB of data recorded
    - 34 errors
    - 99.6% camera uptime

    Beta Release 10 and running on TCP

    Camera 1
    - 67 movie files recorded
    - 0 image files recorded
    - 246 MB of data recorded
    - 63 errors
    - 99.7% camera uptime

    Camera 2
    - 251 movie files recorded
    - 0 image files recorded
    - 1.0 GB of data recorded
    - 60 errors
    - 99.9% camera uptime

    - 6 of 6 cameras currently online
    - 5605 movie files recorded in total
    - 0 image files recorded in total
    - 51.7 GB of data recorded in total
    - 99.9% software uptime
    - 12% average CPU usage
    - Normal memory pressure

    A decrease in ERRORS and both have remained in clock sync - will have a real 24 hour result tomorrow

    Looking much better so far!

  • What quality stream are you using in Protect? I just cannot get the stream to start in SS on any settings apart from RTSP over HTTP? I tried a camera restart but no luck
  • OK I found the problem, in case it helps anyone else I had the ports wrong. The RSTP needs to be 7447 in this configuration.
  • Good to hear you found the solution @evansgo. Is it working better with UDP?

    The best way to compare is to use the Dashboard feature (either in SecuritySpy's macOS interface itself or via its web interface) and look at packet loss for these specific cameras when using TCP vs. using UDP. Are you both seeing a significant difference here? We certainly are with our test camera.
  • Looking really good today but I have noticed a new issue :-

    motion capture mode has been disarmed. (Failed to record video frame 5575,818 The key frame interval from the network device is too high, locate and change this setting in the device (may be called I-frame interval / I-frame rate / GOV length / Intra frame period))

    Regards
  • Well I wasn't seeing the packet loss problem myself, but since I installed the beta and found the port issue, its all working really well. I've upped the frame rate back to where I wanted it and everything is looking good and perfectly in sync across four cameras
  • edited July 2020
    ZERO Errors on my 2 G3 cameras in last 24 hours ! Brilliant.

    30FPS and 6Mb connection perfect.
  • edited July 2020
    OH just decided to bin the feed from unifi - reconfigured the camera into stand alone mode and running in Manual config in SPY, with unifi cam profile selected . Am unable to get UDP to run on stream 0 (s0 is 1080P) at high connection speeds 6mb (direct cat6e connection) Works on TCP if i login to camera and set connection speed below 2MB Really confused. I would have expected to be able to set higher than this. Was set at 6mb (max selectable) when was running in unifi and streaming out to security spy
    I may be doing something incorrect?
  • edited July 2020
    Further testing - I can remain error free in standalone mode at 30FPS if i select connection rate at 1.2Mbs and UDP. Any higher and the strange degradation returns.
    Really weird, seeing as the camera works at 6Mb within a unifi CCTV. I suspect the RSTP feed maybe lowered in this config hence always looks ok in a unifi setup
  • Thanks @jeff444 for pointing me to this thread after I posted slightly different issues with a similar setup.

    I'm running 15 UniFi cameras currently, a mix of G3, G3 Micro and G3 Dome, with a single G3 Pro and G3 Flex. They run in managed mode with Protect running on a UCKG2+.

    I started with SS 3.x and three cheapo Foscams, but moved to UniFi after being impressed with their network gear, starting with a couple of cameras and building out. I tried them standalone connected directly to SS on my late 2012 Mac mini with 2.5GHz CPU and 8GB RAM, but at least back then (SS4 and no UniFi profile) it wasn't great and the cameras didn't let me use some functionality in standalone mode.

    Soon after, I hooked them up to a UniFi NVR and Ben helped me set up an RTSP feed from there on port 7447 using RTSP (video and audio). It was rock solid and over time I've upgraded to the latest versions of everything involved.

    I forget the sequence, but I've moved from UniFi NVR and UniFI Video to Protect on the CloudKey+, and SS of course moved to V5, which I upgraded to literally within minutes of seeing it released. The AI motion detection was an awesome improvement.

    Aside the Micros which are WiFi only my cameras are all connected to one of 3 UniFi gigabit switches, except one camera (that also happens to be a Micro) which is in a different building that connects over a wireless PTP bridge of about 115m distance back to the main building. I get about 190Mbps each way over that link.

    I had zero issues until 5.2.2 when I started to get several emails a day about excessive packet loss, pretty much from any camera. It was just bearable enough I could ignore it, but it 100% for sure started immediately after the upgrade to 5.2.2.

    This past Sunday I upgraded to 5.2.3, and immediately I started getting slammed with hundreds of excessive packet loss emails within the first day - almost a round robin around my 15 cameras with something from 1 - 20 minutes between emails. I also started to get spurious alerts of vehicle motion from both G3 Domes in my closed and locked garage, or from the "remote" Micro.

    While I absolutely have nothing but respect for the SS product and I have found Ben extremely patient and helpful this second issue was once more an immediate impact of the SS upgrade - nothing changed about the UniFi setup at all.

    Anyway I just downloaded 5.2.4b12 and I had no interrupted connections nor any issue switching to use UDP, so I'll run that for a period and see what difference it brings, and of course report back here.

    I had turned off email error notifications and will quickly know if part of the issue is resolved having re-enabled them just now. Nothing for a few minutes so far so fingers crossed...
  • edited July 2020
    An update after around 15 hours is that the issues seem to have been resolved.

    I moved 14 of the cameras over to UDP, leaving one as it was previously (presumably using TCP?). I received on email about excessive packet loss around 30 minutes ago, and it was from the camera that has not ben moved over to UDP.

    I also have had no spurious alerts / motion detections in that period.

    Although early days that is very powerful evidence that the issue is resolved by using UDP as I had most definitely seen multiple issues within any 15 hour period since I updated to 5.2.3.

    I have now moved the G3 Dome that was generating most of the spurious motion detections back to a TCP RTSP stream to see if it reverts to previous behaviour and will report back later.

    Further to the above as I didn't hit the post button apparently, I have had a couple of email alerts and one spurious motion detection from the G3 Dome, way better than it had been over the previous 3 days, but still not as it should be.

    I think therefore that 5.2.4b12 seems less noisy with the cameras running in TCP than 5.2.3 was, but with UDP in place of TCP it seems to be spot on.

    What is odd is that it was an SS update that made a step change in the behaviour, not a UniFi one. Anyway, thanks Ben for your awesome support in assisting the two users above to confirm the fix which seems to have resolved my issue entirely.
  • I will agree that I don't understand where the instability has come from. I have an error rate of 0.5-1.5% annoying - yes. But they do work and remain pretty stable. I have to set the camera to no more than 1.6mb connection (max in camera menu is 6mb).As i say ..they are working at 30FPS HW decoded at approx 20-30%. data rate approx 200kb's. Would love to solve the last issue of upping connection speed to the default 6Mb if at all possible.
Sign In or Register to comment.