'ffmpeg: transmission problems / artifacts in rtsp screen grab - might be a WiFi problem
In short: Is there a way to "force" ffmpeg to not save a grabbed frame if there are transmission problems? Or any other software that does the same and I just don't know of?
Long story:
Updating my house surveillance from almost 10 years old DCS-932L cameras to Tapo C100 Cameras, I changed the image delivery method from ftp push to rtsp grab via ffmpeg.
I had written a program in C++ to check for "bad" pictures from the old cameras, where parts of the picture tended to be simply black once every minute or so (I'm grabbing a pic every 2 seconds). The Tapo C100 doesn't feature ftp-push, thus I tried (after a few days trying)
ffmpeg.exe -y -i rtsp://user:[email protected].%ld:554/stream1 -vframes 1 %scamera\rtsp.jpg -loglevel quiet
This works absolutely perfect in my main house, which features a Fritz!Box 7590 and a set of Fritz!Powerline (510/and two 540e) repeaters, plus one WiFi repeater Fritz 600) as my phone line and the router are in the basement.
In my holiday home, though, it doesn't. The Wifi is managed by a Hybrid DSL/5G - box I have no alternative to, which is a Huawei DN9245W and works as DHCP Server, because this is almost impossible to change. Everything "real" is managed by another Fritz!Box 7590, connected via ethernet, and another set of Fritz!Powerline 510 and two 540e repeaters plus half a dozen Wifi Repeaters, mostly Fritz! 310, 450E and 600. The house was partially built with local stones, which are very iron-y, and there's a lot of metallized glass. Full set is show in Image
Now, this does produce different artifacts, about two per minute or in every 15th picture, see Image with artifacts No. 1
Thinking this might be a transmission problem, I tried forcing the streamgrab via TCP, because while rtsp doesn't have error correction, TCP does:
ffmpeg.exe -rtsp_transport tcp -i
rtsp://user:[email protected].%ld:554/stream1 -y -f image2 -update 1 -r
1 -vframes 1 -qscale:v 30 %scamera\rtsp.jpg -loglevel quiet
Which didn't change the artifacts much, see Image with artifacts No. 2
The house now has a total of 12 Cameras, six of which are each "managed" by an older Dell Optiplex Desktop bought used off ebay with an i3 or i5 processor from about 2015, which goes to about 65% load. My software will check if the grabbed picture is finished saving (to RAMdisk), rename it, check if there are artifacts, if so, drop it, if not, convert to bitmap and then compare it to previous image, guess if there's a change, mark that change with a rhombus and rate it, save that as a jpeg file, and then some other stuff that's not relevant here. See: Image of my program running with six cameras
I did try grabbing keyframes only, but a bunny or deer or burglar hopping through my property doesn't produce a keyframe, so that turned out to be missing the point.
I'm out of ideas here. It does work flawlessly in the main house. It doesn't in the holiday house. I can hardly install more repeaters; I already tried mesh and not-mesh, and the problem isn't exactly wifi overload, because even with just one camera running, it still persists. In certain places. Some have no problems. Reasons? No clue. I really hope someone has a good idea.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
