blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
17.67k stars 1.62k forks source link

[Config Support]: Stream is getting upscaled for some reason #4975

Closed MrPlatnum closed 1 year ago

MrPlatnum commented 1 year ago

Describe the problem you are having

What is the minimum resolution for a stream with the "detect" role.

Version

0.11.1-2EADA21

Frigate config file

mqtt:
  host: 192.11.11.1
  port: 1883
  topic_prefix: frigate
  user: frigate
  password: /
detectors:
  coral:
    type: edgetpu
    device: usb
cameras:
  balkon:
    ffmpeg:
      input_args:
        - -fflags
        - +genpts+discardcorrupt
        - -rtsp_transport 
        - udp
        - -loglevel
        - info
      inputs:
      - path: rtsp://admin:password@192.11.11.1:554/h265Preview_01_main
        hwaccel_args: -hwaccel drm -hwaccel_device /dev/dri/card0 -c:v hevc_rkmpp
        roles:
        - record
      - path: rtsp://admin:password@192.11.11.1:554/h264Preview_01_sub
        hwaccel_args: -hwaccel drm -hwaccel_device /dev/dri/card0 -c:v h264_rkmpp
        roles:
        - rtmp
        - detect
    rtmp:
      enabled: True
    detect:
      width: 896
      height: 512
      fps: 30
    record:
      enabled: True
      retain:
        days: 2
        mode: motion
      events:
        retain:
         default: 3
    snapshots:
      enabled: True
    motion:
      mask:
      - 407,72,727,101,896,162,896,0,559,0,0,0,0,144

Relevant log output

None

Frigate stats

No response

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Any other information that may be helpful

image I get very high CPU usage in my frigate container. Not from stream decoding but from upscaling for the detector as it seems. I dont quite understand why my input stream gets upscaled like that. Is there an option or input/output arg to omit this?

NickM-27 commented 1 year ago

The stream is always resizes to whatever is in

    detect:
      width: 896
      height: 512

also you have your fps at 30 which is not recommended as there is no need. 5 is the default and usually enough for most people. The fps set in frigate config does not need to match the fps of the camera stream.

MrPlatnum commented 1 year ago

But my input is 896x512 so i dont get why it is getting upscaled to 1260x720. I changed it to 5 fps but that did not really have any impact on performance. image

NickM-27 commented 1 year ago

What you're seeing there is the stream being scaled for the live view. This is set with the live configuration settings.

MrPlatnum commented 1 year ago

Ah okay i will try to change that then

MrPlatnum commented 1 year ago

Okay thank you that was indeed the solution. Thank you very much!