Ffmpeg camera + Amcrest DVR = Screen Tearing

Does anyone know what causes this?

ScreenTearing

Running HASS.io on ODROID-XU4.

My configuration:

camera:
    - platform: ffmpeg
      name: Backyard
      input: !secret DVR_Channel03
      extra_arguments: '-q:v 1 -r 25 -vf "scale=800:600"'

This is pulling the stream from my Amcrest DVR on my local network:

DVR_Channel03: rtsp://user:pass@DVRIP:554/cam/realmonitor?channel=3&subtype=0

If I go with subtype=1 then this doesn’t happen but the image quality is very poor.

Next time it grabs a frame then it usually looks ok.

I pulled the extra arguments off the Internet somewhere. Not sure what they mean other than the scale so I am open to suggestions.

Thanks!

-Tim

Hello, did you try with the Amcrest Platform ? I have two Amcrest working fine with this platform.

Slow encoding or poor stream quality. Not really HA issue.

How it look in VLC?

This is answer.

High quality need more bandwidth.
Low quality = low bandwidth

Try from VLC? If same result maybe login camera and see if you can change/lower frame rate to improve. Ffmpeg has option to adjust frame rate from source somehow but not sure how to do this. That would help.

I will give that a try and see if it works any better (the Amcrest Platform).

Thanks!

Looks great on VLC on my computer (Windows) with that same rtsp URL.

I couldn’t get the Amcrest platform to work for me. This is an Amcrest DVR (8-channel) and I don’t see it in the list of supported devices anyway. I couldn’t figure out how to get different channels specified.

1 Like

This is how I have mine setup (Amcrest 16 channel POE system, so similar to your 8 channel):

- platform: ffmpeg
  name: Attic
  input: !secret attic_camera

No tearing on mine at all.

image

So, I did a lot of changing and testing and reading through these threads:

I see others have had the exact same problem (sorry for not finding that before I posted).

I changed the resolution of the cameras all the way down to CIF (352x240) before the phenomena would quit happening. I dropped the FPS all the way down to 1. I dropped the bitrate way down and even changed the codec from h.264H to h.264b Nothing else seemed to help.

I am resigned to believe this has to do with the hardware that my HA is running on: HASS.IO on ODROID-XU4. The ffmpeg implementation on that image probably does not have enough power with that hardware although it is a step up from a Raspberry Pi.

Ultimately, I am not running HA for the cameras. The camera integration is just an added bonus. I have better apps available to stream the camera feeds if I need to see those.

I backed the rtsp streams to the subtype=1 which is the lower resolution but at least a stable image.

Thanks for your help.

Possibly. I’m running my HA instance on a rPi4 (4gb), so a bit more horsepower.

That’s what I get for going with the cheaper version. :wink:

1 Like