RTSP camera pixelated view in GUI, but normal in ffmpeg

Hi Folks!

I’m having an issue with my Tapo camera, which supports ONVIF and RTSP. When I stream the feed using ffplay or ffmpeg directly, the image is sharp and clean.

However, when I add the same camera to Home Assistant via either:

  • The ONVIF integration
  • The Generic Camera (FFmpeg)

…the stream becomes very pixelated with artifacts.

At first, I thought this might be due to **ffmpeg or CPU usage ** on my Home Assistant host. But to rule that out, I logged into the host and recorded the RTSP feed using ffmpeg—and the recorded video was crystal clear.

Has anyone encountered this before? Could Home Assistant be applying lower-quality settings or transcoding the stream?
The problem I observe is visible on both web browser and android app.

Here are some samples how it does look like:
image


Screenshot_20250130_081010

I’ve tried using lower resolution /stream2 but in fact I see no difference when it comes to those artifacts.

Any ideas on how to fix this?
Thanks in advance! :rocket:

Actually it’s not connected to TAPO at all. Connected frigate RTSP and it’s similar.

I believe it’s just a problem with lovelace video player :frowning:

I am having the same issue using ONVIF on Tapo cameras. I transferred the recorded files to other machines (one Ubuntu and one Windows) and the same motion artifacts appear when played back there. So it appears to be in the recording.

I also looked at the media details of the file and it shows 1920x1080, 9.93 fps, 1.468Mbps. The file was 761KB and lasted 9 seconds. It indicated no dropped frames.

As another test, I recorded the camera using VLC (on a Windows PC) to a file (using RTSP) then copied the file to the HA media folder. The file had no motion artifacts and played back fine on both the PC that recorded it and in HA.

The camera is a Tapo C310 and the recording media info was H.264, 1920x1080, 15.2fps (video data rate was not given). The file was 2.65MB and lasted 15 seconds.

It’s strange and buggy.
I’ve tried to update pyav module to 14.0, as latest HA ships with pyav==13.1 but at the end of the day I installed WebRTC extension from HACS and it works like a charm…

Can you give me more details about using WebRTC. I am using ONVIF rather the Frigate. Does WebRTC work with the ONVIF integration? Is WebRTC standalone, or is it intended to work with other camera integrations?

The problem I am experiencing is not related to playback, it is related to the recording. A good file captured in another system plays back fine in HA. The HA recorded file is bad in HA and other systems.

Perhaps we are experiencing different issues. Did you try either of the the cross-platform tests?

@morf, I opened a similar case here:

The solution was to use UDP as the transport (instead of TCP) in the ONVIF integration. This problem was on all three of my Tapo cameras, but not on my SimiCam camera.

As I said earlier, for me it was never a problem with lovelace rendering – it was always in the file itself wherever I played it. So it may be something different than what you found. Also, I found the WebRTC did not fix it.

I am curious if you are using UDP or TCP. I found that ffmpeg with TCP gave constant non-monotonic DTS errors, but it did record the file properly (without the artifacts anyway). The warnings ceased when I chose UDP.

Thanks.

I don’t have any of these issues with BlueIris cameras, so I don’t think the issue is with the Lovelace video player.

Not terribly helpful, I know - but thought perhaps I could at least help to rule something out for you. :slight_smile: