frigate icon indicating copy to clipboard operation
frigate copied to clipboard

[Config Support]: how to rotate image? frigate not working

Open yuhuanfan opened this issue 2 years ago • 6 comments

Describe the problem you are having

FD49905C-5062-4A75-9619-6D9780FA5C53

Version

Current version: 3.1

Frigate config file

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-07-19 15:44:24] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
[2022-07-19 15:44:24] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2022-07-19 15:44:24] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-07-19 15:44:25] peewee_migrate                 INFO    : There is nothing to migrate
[2022-07-19 15:44:25] detector.cpu1                  INFO    : Starting detection process: 214
[2022-07-19 15:44:25] frigate.app                    INFO    : Output process started: 215
[2022-07-19 15:44:25] frigate.app                    INFO    : Camera processor started for camera_1: 218
[2022-07-19 15:44:25] frigate.app                    INFO    : Capture process started for camera_1: 219
[2022-07-19 15:44:25] ws4py                          INFO    : Using epoll
[2022-07-19 15:44:25] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-07-19 15:44:26] ws4py                          INFO    : Using epoll
[2022-07-19 15:44:45] watchdog.camera_1              INFO    : No frames received from camera_1 in 20 seconds. Exiting ffmpeg...
[2022-07-19 15:44:45] watchdog.camera_1              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-07-19 15:45:15] watchdog.camera_1              INFO    : FFmpeg didnt exit. Force killing...
[2022-07-19 15:45:16] frigate.video                  ERROR   : camera_1: Unable to read frames from ffmpeg process.
[2022-07-19 15:45:16] frigate.video                  ERROR   : camera_1: ffmpeg process is not running. exiting capture thread...
[2022-07-19 15:45:17] frigate.record                 WARNING : Discarding a corrupt recording segment: camera_1-20220719154428.mp4
[2022-07-19 15:45:26] watchdog.camera_1              ERROR   : Ffmpeg process crashed unexpectedly for camera_1.
[2022-07-19 15:45:26] watchdog.camera_1              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-07-19 15:45:26] ffmpeg.camera_1.detect         ERROR   : [rawvideo @ 0x1f9beb0] Frame rate very high for a muxer not efficiently supporting it.
[2022-07-19 15:45:26] ffmpeg.camera_1.detect         ERROR   : Please consider specifying a lower framerate, a different muxer or -vsync 2
[2022-07-19 15:45:26] ffmpeg.camera_1.detect         ERROR   : [libx264 @ 0x1f75e90] MB rate (324000000) > level limit (2073600)
[2022-07-19 15:45:26] ffmpeg.camera_1.detect         ERROR   : More than 1000 frames duplicated
[2022-07-19 15:45:46] watchdog.camera_1              INFO    : No frames received from camera_1 in 20 seconds. Exiting ffmpeg...
[2022-07-19 15:45:46] watchdog.camera_1              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-07-19 15:46:16] watchdog.camera_1              INFO    : FFmpeg didnt exit. Force killing...
[2022-07-19 15:46:16] frigate.video                  ERROR   : camera_1: Unable to read frames from ffmpeg process.
[2022-07-19 15:46:16] frigate.video                  ERROR   : camera_1: ffmpeg process is not running. exiting capture thread...
[2022-07-19 15:46:17] frigate.record                 WARNING : Discarding a corrupt recording segment: camera_1-20220719154529.mp4
[2022-07-19 15:46:26] watchdog.camera_1              ERROR   : Ffmpeg process crashed unexpectedly for camera_1.
[2022-07-19 15:46:26] watchdog.camera_1              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-07-19 15:46:26] ffmpeg.camera_1.detect         ERROR   : [rawvideo @ 0xfd6af0] Frame rate very high for a muxer not efficiently supporting it.
[2022-07-19 15:46:26] ffmpeg.camera_1.detect         ERROR   : Please consider specifying a lower framerate, a different muxer or -vsync 2
[2022-07-19 15:46:26] ffmpeg.camera_1.detect         ERROR   : [libx264 @ 0xffb820] MB rate (324000000) > level limit (2073600)
[2022-07-19 15:46:26] ffmpeg.camera_1.detect         ERROR   : More than 1000 frames duplicated
[2022-07-19 15:46:46] watchdog.camera_1              INFO    : No frames received from camera_1 in 20 seconds. Exiting ffmpeg...
[2022-07-19 15:46:46] watchdog.camera_1              INFO    : Waiting for ffmpeg to exit gracefully...

Relevant log output

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-07-19 15:44:24] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
[2022-07-19 15:44:24] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2022-07-19 15:44:24] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-07-19 15:44:25] peewee_migrate                 INFO    : There is nothing to migrate
[2022-07-19 15:44:25] detector.cpu1                  INFO    : Starting detection process: 214
[2022-07-19 15:44:25] frigate.app                    INFO    : Output process started: 215
[2022-07-19 15:44:25] frigate.app                    INFO    : Camera processor started for camera_1: 218
[2022-07-19 15:44:25] frigate.app                    INFO    : Capture process started for camera_1: 219
[2022-07-19 15:44:25] ws4py                          INFO    : Using epoll
[2022-07-19 15:44:25] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-07-19 15:44:26] ws4py                          INFO    : Using epoll
[2022-07-19 15:44:45] watchdog.camera_1              INFO    : No frames received from camera_1 in 20 seconds. Exiting ffmpeg...
[2022-07-19 15:44:45] watchdog.camera_1              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-07-19 15:45:15] watchdog.camera_1              INFO    : FFmpeg didnt exit. Force killing...
[2022-07-19 15:45:16] frigate.video                  ERROR   : camera_1: Unable to read frames from ffmpeg process.
[2022-07-19 15:45:16] frigate.video                  ERROR   : camera_1: ffmpeg process is not running. exiting capture thread...
[2022-07-19 15:45:17] frigate.record                 WARNING : Discarding a corrupt recording segment: camera_1-20220719154428.mp4
[2022-07-19 15:45:26] watchdog.camera_1              ERROR   : Ffmpeg process crashed unexpectedly for camera_1.
[2022-07-19 15:45:26] watchdog.camera_1              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-07-19 15:45:26] ffmpeg.camera_1.detect         ERROR   : [rawvideo @ 0x1f9beb0] Frame rate very high for a muxer not efficiently supporting it.
[2022-07-19 15:45:26] ffmpeg.camera_1.detect         ERROR   : Please consider specifying a lower framerate, a different muxer or -vsync 2
[2022-07-19 15:45:26] ffmpeg.camera_1.detect         ERROR   : [libx264 @ 0x1f75e90] MB rate (324000000) > level limit (2073600)
[2022-07-19 15:45:26] ffmpeg.camera_1.detect         ERROR   : More than 1000 frames duplicated
[2022-07-19 15:45:46] watchdog.camera_1              INFO    : No frames received from camera_1 in 20 seconds. Exiting ffmpeg...
[2022-07-19 15:45:46] watchdog.camera_1              INFO    : Waiting for ffmpeg to exit gracefully...
[2022-07-19 15:46:16] watchdog.camera_1              INFO    : FFmpeg didnt exit. Force killing...
[2022-07-19 15:46:16] frigate.video                  ERROR   : camera_1: Unable to read frames from ffmpeg process.
[2022-07-19 15:46:16] frigate.video                  ERROR   : camera_1: ffmpeg process is not running. exiting capture thread...
[2022-07-19 15:46:17] frigate.record                 WARNING : Discarding a corrupt recording segment: camera_1-20220719154529.mp4
[2022-07-19 15:46:26] watchdog.camera_1              ERROR   : Ffmpeg process crashed unexpectedly for camera_1.
[2022-07-19 15:46:26] watchdog.camera_1              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-07-19 15:46:26] ffmpeg.camera_1.detect         ERROR   : [rawvideo @ 0xfd6af0] Frame rate very high for a muxer not efficiently supporting it.
[2022-07-19 15:46:26] ffmpeg.camera_1.detect         ERROR   : Please consider specifying a lower framerate, a different muxer or -vsync 2
[2022-07-19 15:46:26] ffmpeg.camera_1.detect         ERROR   : [libx264 @ 0xffb820] MB rate (324000000) > level limit (2073600)
[2022-07-19 15:46:26] ffmpeg.camera_1.detect         ERROR   : More than 1000 frames duplicated
[2022-07-19 15:46:46] watchdog.camera_1              INFO    : No frames received from camera_1 in 20 seconds. Exiting ffmpeg...
[2022-07-19 15:46:46] watchdog.camera_1              INFO    : Waiting for ffmpeg to exit gracefully...

Frigate stats

No response

Operating system

Debian

Install method

HassOS Addon

Coral version

Dev Board

Any other information that may be helpful

raspberry pi2 thank u

yuhuanfan avatar Jul 19 '22 07:07 yuhuanfan

Please paste your entire frigate config. Also what happens without the custom output args?

NickM-27 avatar Jul 19 '22 11:07 NickM-27

mqtt: host: 192.168.10.157 port: 1883 user: ******* password: ****** topic_prefix: frigate client_id: frigate stats_interval: 60

birdseye: enabled: True width: 1280 height: 720 quality: 8 mode: objects

detectors: cpu1: type: cpu num_threads: 3

cameras: camera_1: ffmpeg: hwaccel_args: - -c:v - h264_mmal input_args: -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -rtsp_transport tcp -use_wallclock_as_timestamps 1 -stimeout 2000000 inputs: - path: rtsp://admin:[email protected]:554/h264/ch1/main/av_stream roles: - record - rtmp - detect # output_args: # rtmp: -vf transpose=1 -c:v libx264 -an -f flv rtmp: enabled: True

record:
  enabled: True
  expire_interval: 60
  retain:
    days: 7
    mode: motion
  events:
    max_seconds: 300
    pre_capture: 5
    post_capture: 5

objects:
  track:
    - person

timestamp_style:
  position: "bl"
  format: "%H:%M:%S"
  color:
    red: 255
    green: 255
    blue: 255
  thickness: 5
  effect: "shadow"

motion:
  threshold: 25
  mask:
    - 1222,675,1226,699,913,699,914,676
    - 496,180,335,720,301,720,212,550,116,288,66,21,116,0,490,0
    - 1280,720,986,720,941,586,998,360,1049,0,1280,0
    - 724,55,709,47,706,0,725,0

yuhuanfan avatar Jul 20 '22 12:07 yuhuanfan

What happens when you comment out the input_args ?

NickM-27 avatar Jul 20 '22 13:07 NickM-27

i m add
output_args: rtmp: -vf transpose=1 -c:v libx264 -an -f flv i use Pi2 ,maybe decode encode very slowly when i m add output_args: rtmp: -vf transpose=1 -c copy -f flv but frigate nothing to happen thank you ,from shanghai a little english do you have a idea? 下载 .

yuhuanfan avatar Jul 21 '22 12:07 yuhuanfan

You could try the following

rtmp: -vf transpose=1 -c:v libx264 -preset ultrafast -tune zerolatency -an -f flv

If that doesn't work, then the Pi2 may not be powerful enough to encode.

blakeblackshear avatar Jul 21 '22 13:07 blakeblackshear

thank u,if set ‘input_args : -vf transpose=1’ frigate
will work?

yuhuanfan avatar Jul 23 '22 02:07 yuhuanfan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 31 '22 08:08 stale[bot]

This worked for me, my config is as follows:

mqtt:
  host: 172.16.0.56
  user: frigate
  password: 5zC27DQAGQW29kyS8hk58Stxg

go2rtc:
  streams:
    door: rtsp://172.16.0.239:554/s2
    door_rotated:
      - "ffmpeg:door#video=h264#rotate=90"


cameras:
  door: 
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/door_rotated
          roles:
            - record
            - detect
            - rtmp
      hwaccel_args: preset-vaapi
    record:
      enabled: True
      events:
        retain:
          default: 10
    detect:
      width: 576
      height: 1024
    live:
      stream_name: door

CountParadox avatar Jul 12 '23 06:07 CountParadox