blakeblackshear / frigate

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

[Support]: (WebUI) playing of some clips is interupted by error message / "The media playback was aborted due to a corruption problem or because the media used features your browser did not support." #5413

Closed salabur closed 1 year ago

salabur commented 1 year ago

Describe the problem you are having

"The media playback was aborted due to a corruption problem or because the media used features your browser did not support."

Error is shown when viewing some (like 5%) of the recorded events in the WebUI. The event will start to play and at some (100% reproducible) time will interrupt and show the error. The file(s) containing the event can be viewed with vnc on win 10 64bit without any error shown. Even if the recorded files are corrupt in some mater (I cant say for sure), maybe the process used for playing the clips can be set to ignore errors if possible and continue from the next keyframe or something like that?
I have attached one of the relevant files, the playback is interrupted at about 2 seconds into the clip.

There are some errors in the logs, but none correspond to the time of the recording or playback.

Version

0.12.0-66881EB (0.12.0-beta7)

Frigate config file

# yaml-language-server: $schema=http://192.168.1.230:5000/api/config/schema

mqtt:
  host: 192.168.1.230
  #user: <username>
  #password: <password>
  topic_prefix: frigate
  stats_interval: 60

detectors:
  coral:
    type: edgetpu
    device: usb

# Optional: Database configuration
database:
  # The path to store the SQLite DB (default: shown below)
  path: /media/frigate/frigate.db

# Optional: model modifications
model:
  # Optional: path to the model (default: automatic based on detector)
  # path: /edgetpu_model.tflite
  path: /edgetpu_model.tflite
  # Optional: path to the labelmap (default: shown below)
  labelmap_path: /labelmap.txt
  # Required: Object detection model input width (default: shown below)
  width: 320
  # Required: Object detection model input height (default: shown below)
  height: 320
  # Optional: Label name modifications. These are merged into the standard labelmap.
  labelmap:
    1: vehicle
    2: vehicle
    3: vehicle
    5: vehicle
    6: vehicle
    7: vehicle

# Optional: logger verbosity settings
logger: 
  # Optional: Default log verbosity (default: shown below) warning / error / info
  default: info
  #warning
  # Optional: Component specific logger overrides
  # logs:
  #   frigate.event: warning
  #   frigate.edgetpu: warning
  #   frigate.app: warning

# # Optional: set environment variables
# environment_vars:
#   #EXAMPLE_VAR: value

# Optional: birdseye configuration
# NOTE: Can (enabled, mode) be overridden at the camera level
birdseye:
  # Optional: Enable birdseye view (default: shown below)
  enabled: False
  # Optional: Width of the output resolution (default: shown below)
  width: 1280
  # Optional: Height of the output resolution (default: shown below)
  height: 720
  # Optional: Encoding quality of the mpeg1 feed (default: shown below)
  # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
  quality: 8
  # Optional: Mode of the view. Available options are: objects, motion, and continuous
  #   objects - cameras are included if they have had a tracked object within the last 30 seconds
  #   motion - cameras are included if motion was detected in the last 30 seconds
  #   continuous - all cameras are included always
  mode: objects

# Optional: ffmpeg configuration

ffmpeg:
  hwaccel_args: preset-rpi-64-h264
  output_args:
    record: preset-record-generic-audio-copy
    #preset-record-generic-audio

go2rtc:
  streams:
    eingang: rtsp://frigate_user:frigate_pwd@192.168.1.70:554/h264Preview_01_main
    eingang_sub: rtsp://frigate_user:frigate_pwd@192.168.1.70:554//h264Preview_01_sub

    front1: rtsp://frigate_user:frigate_pwd@192.168.1.71:554/h264Preview_01_main
    front1_sub: rtsp://frigate_user:frigate_pwd@192.168.1.71:554/h264Preview_01_sub

    front2: rtsp://frigate_user:frigate_pwd@192.168.1.72:554/h264Preview_01_main
    front2_sub: rtsp://frigate_user:frigate_pwd@192.168.1.72:554/h264Preview_01_sub

  webrtc:
    listen: ":8555"
    candidates:
      - 192.168.1.230:8555
      - stun:8555

# Optional: Detect configuration
# NOTE: Can be overridden at the camera level
detect:
  # Optional: width of the frame for the input with the detect role (default: shown below)
  width: 640
  # Optional: height of the frame for the input with the detect role (default: shown below)
  height: 480
  # Optional: desired fps for your camera for the input with the detect role (default: shown below)
  # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
  fps: 7
  # Optional: enables detection for the camera (default: True)
  # This value can be set via MQTT and will be updated in startup based on retained value
  enabled: True
  # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
  max_disappeared: 49
  # Optional: Configuration for stationary object tracking
  stationary:
    # Optional: Frequency for confirming stationary objects (default: shown below)
    # When set to 0, object detection will not confirm stationary objects until movement is detected.
    # If set to 10, object detection will run to confirm the object still exists on every 10th frame.
    interval: 50
    # Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s)
    threshold: 100
    # Optional: Define a maximum number of frames for tracking a stationary object (default: not set, track forever)
    # This can help with false positives for objects that should only be stationary for a limited amount of time.
    # It can also be used to disable stationary object tracking. For example, you may want to set a value for person, but leave
    # car at the default.
    # WARNING: Setting these values overrides default behavior and disables stationary object tracking.
    #          There are very few situations where you would want it disabled. It is NOT recommended to
    #          copy these values from the example config into your config unless you know they are needed.
    # max_frames:
    #   # Optional: Default for all object types (default: not set, track forever)
    #   default: 3000
    #   # Optional: Object specific values
    #   objects:
    #     person: 3000

# Optional: Object configuration
# NOTE: Can be overridden at the camera level
objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
    - vehicle

  # Optional: mask to prevent all object types from being detected in certain areas (default: no mask)
  # Checks based on the bottom center of the bounding box of the object.
  # NOTE: This mask is COMBINED with the object type specific mask below
  mask: 0,0,1000,0,1000,200,0,200
  # Optional: filters to reduce false positives for specific object types
  filters:
    person:
      # Optional: minimum width*height of the bounding box for the detected object (default: 0)
      min_area: 5000
      # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
      max_area: 24000000
      # Optional: minimum width/height of the bounding box for the detected object (default: 0)
      min_ratio: 0.2
      # Optional: maximum width/height of the bounding box for the detected object (default: 24000000)
      max_ratio: 8.0
      # Optional: minimum score for the object to initiate tracking (default: shown below)
      min_score: 0.5
      # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
      threshold: 0.6
      # Optional: mask to prevent this object type from being detected in certain areas (default: no mask)
      # Checks based on the bottom center of the bounding box of the object
      mask: 0,0,1000,0,1000,200,0,200

# Optional: Motion configuration
# NOTE: Can be overridden at the camera level
motion:
  # Optional: The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. (default: shown below)
  # Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive.
  # The value should be between 1 and 255.
  threshold: 40
  # Optional: Minimum size in pixels in the resized motion image that counts as motion (default: 30)
  # Increasing this value will prevent smaller areas of motion from being detected. Decreasing will
  # make motion detection more sensitive to smaller moving objects.
  # As a rule of thumb:
  #  - 15 - high sensitivity
  #  - 30 - medium sensitivity
  #  - 50 - low sensitivity
  contour_area: 30
  # Optional: Alpha value passed to cv2.accumulateWeighted when averaging the motion delta across multiple frames (default: shown below)
  # Higher values mean the current frame impacts the delta a lot, and a single raindrop may register as motion.
  # Too low and a fast moving person wont be detected as motion.
  delta_alpha: 0.2
  # Optional: Alpha value passed to cv2.accumulateWeighted when averaging frames to determine the background (default: shown below)
  # Higher values mean the current frame impacts the average a lot, and a new object will be averaged into the background faster.
  # Low values will cause things like moving shadows to be detected as motion for longer.
  # https://www.geeksforgeeks.org/background-subtraction-in-an-image-using-concept-of-running-average/
  frame_alpha: 0.2
  # Optional: Height of the resized motion frame  (default: 50)
  # This operates as an efficient blur alternative. Higher values will result in more granular motion detection at the expense
  # of higher CPU usage. Lower values result in less CPU, but small changes may not register as motion.
  frame_height: 50
  # Optional: motion mask
  # NOTE: see docs for more detailed info on creating masks
  #mask: 
  #  - 410,0,411,24,224,24,221,0
  # Optional: improve contrast (default: shown below)
  # Enables dynamic contrast improvement. This should help improve night detections at the cost of making motion detection more sensitive
  # for daytime.
  improve_contrast: False
  # Optional: Delay when updating camera motion through MQTT from ON -> OFF (default: shown below).
  mqtt_off_delay: 30

# Optional: Record configuration
# NOTE: Can be overridden at the camera level
record:
  # Optional: Enable recording (default: shown below)
  # WARNING: If recording is disabled in the config, turning it on via
  #          the UI or MQTT later will have no effect.
  # WARNING: Frigate does not currently support limiting recordings based
  #          on available disk space automatically. If using recordings,
  #          you must specify retention settings for a number of days that
  #          will fit within the available disk space of your drive or Frigate
  #          will crash.
  enabled: True
  # Optional: Number of minutes to wait between cleanup runs (default: shown below)
  # This can be used to reduce the frequency of deleting recording segments from disk if you want to minimize i/o
  expire_interval: 240
  # Optional: Retention settings for recording
  retain:
    # Optional: Number of days to retain recordings regardless of events (default: shown below)
    # NOTE: This should be set to 0 and retention should be defined in events section below
    #       if you only want to retain recordings of events.
    days: 3
    # Optional: Mode for retention. Available options are: all, motion, and active_objects
    #   all - save all recording segments regardless of activity
    #   motion - save all recordings segments with any detected motion
    #   active_objects - save all recording segments with active/moving objects
    # NOTE: this mode only applies when the days setting above is greater than 0
    mode: all
  # Optional: Event recording settings
  events:
    # Optional: Number of seconds before the event to include (default: shown below)
    pre_capture: 5
    # Optional: Number of seconds after the event to include (default: shown below)
    post_capture: 30
    # Optional: Objects to save recordings for. (default: all tracked objects)
    # objects:
    #   - person
    #   - vehicle

    # Optional: Restrict recordings to objects that entered any of the listed zones (default: no required zones)
    required_zones: []
    # Optional: Retention settings for recordings of events
    retain:
      # Required: Default retention days (default: shown below)
      default: 90
      # Optional: Mode for retention. (default: shown below)
      #   all - save all recording segments for events regardless of activity
      #   motion - save all recordings segments for events with any detected motion
      #   active_objects - save all recording segments for event with active/moving objects
      #
      # NOTE: If the retain mode for the camera is more restrictive than the mode configured
      #       here, the segments will already be gone by the time this mode is applied.
      #       For example, if the camera retain mode is "motion", the segments without motion are
      #       never stored, so setting the mode to "all" here won't bring them back.
      mode: motion
      # Optional: Per object retention days
      objects:
        person: 180

# Optional: Configuration for the jpg snapshots written to the clips directory for each event
# NOTE: Can be overridden at the camera level
snapshots:
  # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
  # This value can be set via MQTT and will be updated in startup based on retained value
  enabled: True
  # Optional: save a clean PNG copy of the snapshot image (default: shown below)
  clean_copy: True
  # Optional: print a timestamp on the snapshots (default: shown below)
  timestamp: True
  # Optional: draw bounding box on the snapshots (default: shown below)
  bounding_box: True
  # Optional: crop the snapshot (default: shown below)
  crop: True #False
  # Optional: height to resize the snapshot to (default: original size)
  #height: 350
  # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
  required_zones: []
  # Optional: Camera override for retention settings (default: global values)
  retain:
    # Required: Default retention days (default: shown below)
    default: 90
    # Optional: Per object retention days
    objects:
      person: 180

# Optional: RTMP configuration
# NOTE: Can be overridden at the camera level
# rtmp:
#   # Optional: Enable the RTMP stream (default: True)
#   enabled: True

# # Optional: Live stream configuration for WebUI
# # NOTE: Can be overridden at the camera level
# live:
#   # Optional: Set the height of the live stream. (default: 720)
#   # This must be less than or equal to the height of the detect stream. Lower resolutions
#   # reduce bandwidth required for viewing the live stream. Width is computed to match known aspect ratio.
#   height: 640
#   # Optional: Set the encode quality of the live stream (default: shown below)
#   # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
#   quality: 31

# # Optional: in-feed timestamp style configuration
# NOTE: Can be overridden at the camera level
timestamp_style:
  # Optional: Position of the timestamp (default: shown below)
  #           "tl" (top left), "tr" (top right), "bl" (bottom left), "br" (bottom right)
  position: "tl"
  # Optional: Format specifier conform to the Python package "datetime" (default: shown below)
  #           Additional Examples:
  #             german: "%d.%m.%Y %H:%M:%S"
  #             default: #"%m/%d/%Y %H:%M:%S"
  format: "%d.%m.%Y %H:%M:%S" 
  # Optional: Color of font
  color:
    # All Required when color is specified (default: shown below)
    red: 255
    green: 255
    blue: 255
  # Optional: Line thickness of font (default: shown below)
  thickness: 1
  # Optional: Effect of lettering (default: shown below)
  #           None (No effect),
  #           "solid" (solid background in inverse color of font)
  #           "shadow" (shadow for font)
  effect: shadow

# cameras
# Required
cameras:
  # Required: name of the camera
  eingang:
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # input_args: preset-rtsp-generic
      #input_args: preset-http-reolink
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        # NOTE: path may include environment variables, which must begin with 'FRIGATE_' and be referenced in {}
        - path: rtsp://127.0.0.1:8554/eingang?video=copy&audio=copy
          input_args: preset-rtsp-restream
          roles:
            - record

        - path: rtsp://127.0.0.1:8554/eingang_sub?video=copy # <--- the name here must match the name of the camera in restream rtsp://frigate:frigate@192.168.1.70:554/h264Preview_01_sub
          input_args: preset-rtsp-restream
          roles:
            - detect

    # Optional: timeout for highest scoring image before allowing it
    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60

    motion:
      mask:
        - 0,32,199,32,192,0,0,0
        - 640,0,496,0,493,63,482,226,534,212,640,376

    # Optional: zones for this camera
    #zones:
      # Required: name of the zone
      # NOTE: This must be different than any camera names, but can match with another zone on another
      #       camera.
      # front_steps:
      #   # Required: List of x,y coordinates to define the polygon of the zone.
      #   # NOTE: Presence in a zone is evaluated only based on the bottom center of the objects bounding box.
      #   coordinates: 545,1077,747,939,788,805
      #   # Optional: List of objects that can trigger this zone (default: all tracked objects)
      #   objects:
      #     - person
      #   # Optional: Zone level object filters.
      #   # NOTE: The global and camera filters are applied upstream.
      #   filters:
      #     person:
      #       min_area: 5000
      #       max_area: 100000
      #       threshold: 0.7

    # Optional: Configuration for the jpg snapshots published via MQTT
    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: True
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: True
      # Optional: height to resize the snapshot to (default: shown below)
      height: 500
      # Optional: jpeg encode quality (default: shown below)
      quality: 95
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []
    # rtmp:
    #   enabled: True # <-- RTMP should be disabled if your stream is not H264

    detect:
      width: 640
      height: 480
      fps: 7

    # Optional: Configuration for how camera is handled in the GUI.
    ui:
      # Optional: Adjust sort order of cameras in the UI. Larger numbers come later (default: shown below)
      # By default the cameras are sorted alphabetically.
      order: 0
      # Optional: Whether or not to show the camera in the Frigate UI (default: shown below)
      dashboard: True

  front1:
    # Required: ffmpeg settings for the camera
    ffmpeg:
      inputs:
        # Required: the path to the stream
        # NOTE: path may include environment variables, which must begin with 'FRIGATE_' and be referenced in {}
        #- path: http://192.168.1.71/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=frigate_user&password=frigate_pwd
        - path: rtsp://127.0.0.1:8554/front1?video=copy&audio=copy
          input_args: preset-rtsp-restream
          roles:
            - record

        - path: rtsp://127.0.0.1:8554/front1_sub?video=copy # <--- the name here must match the name of the camera in restream rtsp://frigate_user:frigate_pwd@192.168.1.70:554/h264Preview_01_sub
          input_args: preset-rtsp-restream
          roles:
            - detect

    # Optional: timeout for highest scoring image before allowing it
    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60

    motion:
      mask:
        - 0,25,196,23,197,0,0,0
        - 640,87,609,59,640,23

    # Optional: Configuration for the jpg snapshots published via MQTT
    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: False
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: True
      # Optional: height to resize the snapshot to (default: shown below)
      height: 500
      # Optional: jpeg encode quality (default: shown below)
      quality: 90
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []

    detect:
      width: 640
      height: 480
      fps: 7

    # Optional: Configuration for how camera is handled in the GUI.
    ui:
      # Optional: Adjust sort order of cameras in the UI. Larger numbers come later (default: shown below)
      # By default the cameras are sorted alphabetically.
      order: 0
      # Optional: Whether or not to show the camera in the Frigate UI (default: shown below)
      dashboard: True

  front2:
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        # NOTE: path may include environment variables, which must begin with 'FRIGATE_' and be referenced in {}
        - path: rtsp://127.0.0.1:8554/front2?video=copy&audio=copy
          input_args: preset-rtsp-restream
          roles:
            - record

        - path: rtsp://127.0.0.1:8554/front2_sub?video=copy # <--- the name here must match the name of the camera in restream rtsp://frigate:frigate@192.168.1.70:554/h264Preview_01_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
    # Optional: timeout for highest scoring image before allowing it
    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60

    motion:
      mask:
        - 447,23,640,24,640,0,446,0

    # Optional: Configuration for the jpg snapshots published via MQTT
    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: False
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: True
      # Optional: height to resize the snapshot to (default: shown below)
      height: 500
      # Optional: jpeg encode quality (default: shown below)
      quality: 90
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []

    detect:
      width: 640
      height: 480
      fps: 7

    # Optional: Configuration for how camera is handled in the GUI.
    ui:
      # Optional: Adjust sort order of cameras in the UI. Larger numbers come later (default: shown below)
      # By default the cameras are sorted alphabetically.
      order: 0
      # Optional: Whether or not to show the camera in the Frigate UI (default: shown below)
      dashboard: True

Relevant log output

2023-02-05 02:17:44.558121610  [2023-02-05 02:17:44] frigate.app                    INFO    : Starting Frigate (0.12.0-66881eb)
2023-02-05 03:00:15.728624006  [2023-02-05 03:00:15] ffmpeg.front2.record           ERROR   : [segment @ 0x55ab253dc0] Non-monotonous DTS in output stream 0:1; previous: 7621632, current: 7621606; changing to 7621633. This may result in incorrect timestamps in the output file.
2023-02-05 03:00:25.760271593  [2023-02-05 03:00:25] ffmpeg.front2.record           ERROR   : rtsp://127.0.0.1:8554/front2?video=copy&audio=copy: Invalid data found when processing input
2023-02-05 03:00:55.944388485  [2023-02-05 03:00:55] frigate.video                  ERROR   : front2: Unable to read frames from ffmpeg process.
2023-02-05 03:00:55.944481198  [2023-02-05 03:00:55] frigate.video                  ERROR   : front2: ffmpeg process is not running. exiting capture thread...
2023-02-05 03:01:05.968014974  [2023-02-05 03:01:05] watchdog.front2                ERROR   : Ffmpeg process crashed unexpectedly for front2.
2023-02-05 03:01:05.970867602  [2023-02-05 03:01:05] watchdog.front2                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-02-05 03:01:05.971196067  [2023-02-05 03:01:05] ffmpeg.front2.detect           ERROR   : [rtsp @ 0x5590a1d0d0] RTP: PT=60: bad cseq d4a1 expected=9c4b
2023-02-05 18:53:55.105747771  [2023-02-05 18:53:55] frigate.video                  ERROR   : front1: Unable to read frames from ffmpeg process.
2023-02-05 18:53:55.107238969  [2023-02-05 18:53:55] frigate.video                  ERROR   : front1: ffmpeg process is not running. exiting capture thread...
2023-02-05 18:54:05.118385571  [2023-02-05 18:54:05] watchdog.front1                ERROR   : Ffmpeg process crashed unexpectedly for front1.
2023-02-05 18:54:05.119199109  [2023-02-05 18:54:05] watchdog.front1                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-02-05 19:21:56.468625945  [2023-02-05 19:21:56] frigate.video                  ERROR   : front2: Unable to read frames from ffmpeg process.
2023-02-05 19:21:56.471175151  [2023-02-05 19:21:56] frigate.video                  ERROR   : front2: Unable to read frames from ffmpeg process.
2023-02-05 19:21:56.472291241  [2023-02-05 19:21:56] frigate.video                  ERROR   : front2: Unable to read frames from ffmpeg process.
2023-02-05 19:21:56.474911652  [2023-02-05 19:21:56] frigate.video                  ERROR   : front2: Unable to read frames from ffmpeg process.
2023-02-05 19:21:56.475306751  [2023-02-05 19:21:56] frigate.video                  ERROR   : front2: Unable to read frames from ffmpeg process.
2023-02-05 19:21:56.477629404  [2023-02-05 19:21:56] frigate.video                  ERROR   : front2: Unable to read frames from ffmpeg process.
2023-02-05 19:21:56.477824899  [2023-02-05 19:21:56] frigate.video                  ERROR   : front2: ffmpeg process is not running. exiting capture thread...
2023-02-05 19:22:06.481308556  [2023-02-05 19:22:06] watchdog.front2                ERROR   : Ffmpeg process crashed unexpectedly for front2.
2023-02-05 19:22:06.483439546  [2023-02-05 19:22:06] watchdog.front2                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-02-06 11:29:44.398809757  [2023-02-06 11:29:44] frigate.video                  ERROR   : front1: Unable to read frames from ffmpeg process.
2023-02-06 11:29:44.400567396  [2023-02-06 11:29:44] frigate.video                  ERROR   : front1: ffmpeg process is not running. exiting capture thread...
2023-02-06 11:29:54.404820484  [2023-02-06 11:29:54] watchdog.front1                ERROR   : Ffmpeg process crashed unexpectedly for front1.
2023-02-06 11:29:54.404834995  [2023-02-06 11:29:54] watchdog.front1                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-02-06 11:30:06.255549555  [2023-02-06 11:30:06] frigate.video                  ERROR   : front2: Unable to read frames from ffmpeg process.
2023-02-06 11:30:06.258171392  [2023-02-06 11:30:06] frigate.video                  ERROR   : front2: ffmpeg process is not running. exiting capture thread...
2023-02-06 11:30:16.296276489  [2023-02-06 11:30:16] watchdog.front2                ERROR   : Ffmpeg process crashed unexpectedly for front2.
2023-02-06 11:30:16.301600123  [2023-02-06 11:30:16] watchdog.front2                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-02-06 12:19:24.828098808  [2023-02-06 12:19:24] frigate.video                  ERROR   : eingang: Unable to read frames from ffmpeg process.
2023-02-06 12:19:24.831348423  [2023-02-06 12:19:24] frigate.video                  ERROR   : eingang: Unable to read frames from ffmpeg process.
2023-02-06 12:19:24.833286972  [2023-02-06 12:19:24] frigate.video                  ERROR   : eingang: Unable to read frames from ffmpeg process.
2023-02-06 12:19:24.833301447  [2023-02-06 12:19:24] frigate.video                  ERROR   : eingang: ffmpeg process is not running. exiting capture thread...
2023-02-06 12:19:34.837110145  [2023-02-06 12:19:34] watchdog.eingang               ERROR   : Ffmpeg process crashed unexpectedly for eingang.
2023-02-06 12:19:34.837481089  [2023-02-06 12:19:34] watchdog.eingang               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.

2023-02-05 02:17:41.194114827  02:17:41.193 INF go2rtc version 1.1.1 linux/arm64
2023-02-05 02:17:41.195016728  02:17:41.194 INF [api] listen addr=:1984
2023-02-05 02:17:41.196542428  02:17:41.196 INF [rtsp] listen addr=:8554
2023-02-05 02:17:41.198011193  02:17:41.197 INF [srtp] listen addr=:8443
2023-02-05 02:17:41.199016357  02:17:41.198 INF [webrtc] listen addr=:8555
2023-02-05 02:59:59.369126134  02:59:59.368 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:132 > error=EOF url=rtsp://frigate_user:frigate_pwd@192.168.1.72:554/h264Preview_01_sub
2023-02-05 02:59:59.369308413  02:59:59.368 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:132 > error=EOF url=rtsp://frigate_user:frigate_pwd@192.168.1.72:554/h264Preview_01_main
2023-02-05 03:00:21.044695767  03:00:21.044 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="dial tcp 192.168.1.72:554: i/o timeout" url=rtsp://frigate_user:frigate_pwd@192.168.1.72:554/h264Preview_01_main
2023-02-05 03:00:26.045473420  03:00:26.045 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="dial tcp 192.168.1.72:554: i/o timeout" url=rtsp://frigate_user:frigate_pwd@192.168.1.72:554/h264Preview_01_main
2023-02-05 03:00:26.045532409  03:00:26.045 WRN [rtsp] error="source 0 error: dial tcp 192.168.1.72:554: i/o timeout" stream=front2

FFprobe output from your camera

root@bf9b6977a4af:/opt/frigate# ffprobe rtsp://frigate_user:frigate_pwd@192.168.1.72:554/h264Preview_01_main
ffprobe version 4.3.5-0+deb11u1+rpt3 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u1+rpt3 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-mmal --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --enable-sand --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, rtsp, from 'rtsp://frigate_user:frigate_pwd@192.168.1.72:554/h264Preview_01_main':
  Metadata:
    title           : Session streamed by "preview"
    comment         : h264Preview_01_main
  Duration: N/A, start: 0.000188, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 2560x1920, 30 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp
root@bf9b6977a4af:/opt/frigate#

Frigate stats

{"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"0.3"},"1":{"cpu":"0.0","mem":"0.0"},"111":{"cpu":"0.0","mem":"0.1"},"128":{"cpu":"0.0","mem":"0.4"},"129":{"cpu":"0.0","mem":"0.4"},"130":{"cpu":"0.0","mem":"0.3"},"131":{"cpu":"0.0","mem":"0.4"},"15":{"cpu":"0.0","mem":"0.0"},"17":{"cpu":"0.0","mem":"0.0"},"205210":{"cpu":"8.3","mem":"0.6"},"207241":{"cpu":"8.0","mem":"0.6"},"210431":{"cpu":"7.3","mem":"0.6"},"236837":{"cpu":"0.3","mem":"0.0"},"236841":{"cpu":"1.3","mem":"0.0"},"24":{"cpu":"0.0","mem":"0.0"},"25":{"cpu":"0.0","mem":"0.0"},"26":{"cpu":"0.0","mem":"0.0"},"27":{"cpu":"0.0","mem":"0.0"},"273":{"cpu":"0.0","mem":"1.0"},"279":{"cpu":"1.3","mem":"0.1"},"28":{"cpu":"0.0","mem":"0.0"},"280":{"cpu":"0.0","mem":"1.2"},"281":{"cpu":"3.3","mem":"1.1"},"285":{"cpu":"3.0","mem":"1.2"},"286":{"cpu":"0.0","mem":"0.8"},"288":{"cpu":"2.3","mem":"1.2"},"289":{"cpu":"2.7","mem":"1.2"},"29":{"cpu":"0.0","mem":"0.0"},"290":{"cpu":"4.0","mem":"1.1"},"292":{"cpu":"0.0","mem":"0.8"},"293":{"cpu":"5.0","mem":"1.1"},"294":{"cpu":"4.7","mem":"1.1"},"297":{"cpu":"0.0","mem":"0.8"},"30":{"cpu":"0.0","mem":"0.0"},"31":{"cpu":"0.0","mem":"0.0"},"313":{"cpu":"3.3","mem":"0.6"},"317":{"cpu":"4.0","mem":"0.6"},"3431":{"cpu":"4.0","mem":"0.6"},"40":{"cpu":"0.0","mem":"0.0"},"41":{"cpu":"0.0","mem":"0.0"},"78":{"cpu":"0.0","mem":"0.0"},"81":{"cpu":"0.0","mem":"0.0"},"82":{"cpu":"0.0","mem":"0.0"},"88":{"cpu":"28.6","mem":"0.3"},"97":{"cpu":"13.0","mem":"2.8"},"MiB":{"cpu":"4601.3","mem":"avail"},"PID":{"cpu":"%CPU","mem":"%MEM"},"Tasks:":{"cpu":"stopped,","mem":"0"},"top":{"cpu":"users,","mem":"load"}},"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":17.49,"pid":280}},"eingang":{"camera_fps":7.1,"capture_pid":290,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":210431,"pid":285,"process_fps":7.1,"skipped_fps":0.0},"front1":{"camera_fps":7.1,"capture_pid":293,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":207241,"pid":288,"process_fps":7.1,"skipped_fps":0.0},"front2":{"camera_fps":7.1,"capture_pid":294,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":205210,"pid":289,"process_fps":7.1,"skipped_fps":0.0},"gpu_usages":{"rpi-v4l2m2m":{"gpu":-1,"mem":-1}},"service":{"last_updated":1675765355,"latest_version":"0.11.1","storage":{"/dev/shm":{"free":528.9,"mount_type":"tmpfs","total":536.9,"used":7.9},"/media/frigate/clips":{"free":119911.4,"mount_type":"ext4","total":503946.0,"used":363533.0},"/media/frigate/recordings":{"free":119911.4,"mount_type":"ext4","total":503946.0,"used":363533.0},"/tmp/cache":{"free":991.1,"mount_type":"tmpfs","total":1000.0,"used":8.9}},"temperatures":{},"uptime":205490,"version":"0.12.0-66881eb"}}

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

3x Reolink RLC-520A / Firmware with Interframe Space Setting (1) and fixed framerate

Any other information that may be helpful

Raspi 4B @1.9Ghz 512GB SSD for sys and media (powered USB-Hub together with coral) DietPi 64bit Docker

snapshot

salabur commented 1 year ago

as you can see in the uploaded clip I lied and the error is at 4 seconds in... and also present in this viewer ;(

salabur commented 1 year ago

docker file

version: "3.9"

# volumes:

#   env_files:
#     driver_opts:
#       type: "nfs"
#       o: "addr=192.168.1.222,nolock,soft,rw" 
#       device: ":/docker/docker-compose_files/env/"

  # frigate_config:
  #   driver_opts:
  #     type: "nfs"
  #     o: "addr=192.168.1.222,nolock,soft,ro" 
  #     device: ":/docker/frigate/config/" #config.yml"

networks:
  frigate_network:
    # external: false
    # driver: bridge

services:
  frigate:
    image: ghcr.io/blakeblackshear/frigate:0.12.0-beta7
    container_name: frigate
    environment:
      - TZ=Europe/Berlin
    privileged: true # this may not be necessary for all setups
    shm_size: "512mb"
    #environment:
    #  FRIGATE_RTSP_PASSWORD: "frigate"
    # devices:
    #   - /dev/bus/usb:/dev/bus/usb
    #   - /dev/dri:/dev/dri # for intel hwaccel, needs to be updated for your hardware
      # - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
      # - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
      # - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /media/nvr/config/config.yml:/config/config.yml #:ro
      - /media/nvr/media:/media/frigate

      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000

      # - /media/nvr/config/frigate/frigate-go2rtc.yaml:/config/frigate-go2rtc.yaml
      # - type: volume
      #   source: frigate_config
      #   target: /config/config.yml
      #   volume:
      #     nocopy: true

      # - .:/lab/frigate:cached
      - /dev/bus/usb:/dev/bus/usb
      - /dev/video10:/dev/video10
      - /dev/video11:/dev/video11
      - /dev/video12:/dev/video12
      - /dev/video18:/dev/video18
      - /dev/video19:/dev/video19
      - /dev/video31:/dev/video31

      - /dev/media0:/dev/media0
      - /dev/media2:/dev/media2

    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp

    restart: unless-stopped
    networks:
        - frigate_network
NickM-27 commented 1 year ago

What browser are you using? We already tell the viewer to skip and try playing again. However, we have to rely on the browser to playback and if it can't handle the corrupt section then it can't. The errors could definitely be the issue. I've seen this happen with bad data from a cheap camera and chrome couldn't play it back but safari could no problem.

salabur commented 1 year ago

I´m using mainly the ha app on android (iframe) All pcs use chrome as default. These two options do not work same as edge browse. Firefox and Safari on ios work fine. I try to reduce the bitrate from the cameras.

NickM-27 commented 1 year ago

Yes in that case it could very well be a device issue.

pszafer commented 1 year ago

Hi, I have same issue with one Hikvision camera. In my case it's definetely Frigate or Go2RTC issue, as with Frigate 0.11 it can play recorded media, with 0.12 recorded data can't be played. Audio is definetely AAC.

this is go2rtc info:

{
  "producers": [
    {
      "type": "RTSP source",
      "url": "rtsp://192.168.51.12:554/cam/realmonitor?channel=1\u0026subtype=0/",
      "remote_addr": "192.168.51.12:554",
      "user_agent": "go2rtc/1.1.1",
      "medias": [
        "video, sendonly, 96 H264/90000",
        "audio, sendonly, 97 MPEG4-GENERIC/8000",
        "audio, recvonly, 8 PCMA/8000"
      ],
      "tracks": [
        "96 H264/90000, sinks=1",
        "97 MPEG4-GENERIC/8000, sinks=1"
      ],
      "recv": 1078882189
    }
  ],
  "consumers": [
    {
      "type": "RTSP client",
      "url": "rtsp://localhost:8554/go_garaz",
      "remote_addr": "127.0.0.1:38568",
      "user_agent": "FFmpeg Frigate/0.12.0-66881eb",
      "medias": [
        "video, recvonly, 96 H264/90000",
        "audio, recvonly, 97 MPEG4-GENERIC/8000"
      ],
      "tracks": [
        "96 H264/90000, sinks=1",
        "97 MPEG4-GENERIC/8000, sinks=1"
      ],
      "send": 1075756813
    }
  ]
}

As you can see receive is higher than send.

NickM-27 commented 1 year ago

@pszafer looks like you are running an older beta, I'd suggest updating.

salabur commented 1 year ago

Changing the bitrate has not made any difference. Also tried changing rtsp://user:pass@192.168.1.70:554/h264Preview_01_main to ffmpeg:http://192.168.1.70/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=user&password=pass#video=copy#audio=copy and different variants of video=copy#audio=copy / video=copy#audio=aac / video=copy None of this seemed to have any effect. Re-encoding of the stream would be not very effective.

Anybody has any idea or direction I could try? Also to other users of the Reolink RLC-520A, everything fine for you? Changing the browser is not good for the WAF and everything is integrated into home assistant and consequently viewed embedded within the app.

Please also comment if I should close this issue as this is in my understanding not an direct frigate problem.

NickM-27 commented 1 year ago

I'd suggest asking reolink for better firmware

github-actions[bot] commented 1 year ago

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.

Islautopia commented 10 months ago

Hi. I see there has been no activity on this thread for a while now, Has anyone found something to fix this problem? I have the same problem on one of my cameras (reolink doorbell POE). The rest of the cameras (different Reolkink and TAPO models) work perfectly. The problem with the camera is always playing back recordings. The real time video does not give any problem.

bbccdd commented 8 months ago

Similar problem, same error message. Happens in the Home Assistant app (using the Frigate Proxy add-in and Home Assistant OS) whereas the recordings stream just fine from the latest stable Opera mobile browserbon android.

oleost commented 5 months ago

Same issue here, running Reolink doorbell camera, stream works fine. Also downloading the clip works.

Running Chrome on windows browser