blakeblackshear / frigate

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

[Support]: Recordings of Events are unplayable in Browser #3706

Closed maginator closed 2 years ago

maginator commented 2 years ago

Describe the problem you are having

Hi, my problem is that smoe recorded events are not playable in the Browser. I use Opera as browser but Opera is just based on Chromium. These Clips i can download normaly and then play them so the Media Files exists. But i got the Message : "The media could not be loaded, either because the server or network failed or because the format is not supported." With other Recorded Events its working and i can play them in a Browser. and at a third i have some events with only snapshots and no recordings beeing saved. Does anyone know why this happend?

Version

0.11.0-37325C7

Frigate config file

database:
  path: /db/frigate.db

mqtt:
  host: broker.fritz.box
  port: 1883
  topic_prefix: frigate

cameras:
  vorne:
    ffmpeg:
      input_args: -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts+discardcorrupt -use_wallclock_as_timestamps 1
      inputs:
        - path: http://raspicam3.fritz.box/html/cam_pic_new.php?
          roles:
            - record
            - detect
      output_args:
        #record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -an
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -r 10
        #record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -preset veryfast -r 10
        detect: -f rawvideo -pix_fmt yuv420p
        rtmp: -c:v libx264 -an -f flv
    detect:
      enabled: True
      width: 1280
      height: 720
      fps: 5
    objects:
      track:
      - person
      filters:
        person:
      # Optional: minimum score for the object to initiate tracking (default: shown below)
          min_score: 0.6

detectors:
  cpu1:
    type: cpu
    num_threads: 2

birdseye:
  # Optional: Enable birdseye view (default: shown below)
  enabled: True
  # 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: motion

logger:
  default: info
  logs:
    frigate.mqtt: error
    frigate.app: debug
    frigate.zeroconf: info

record:
  enabled: true
  expire_interval: 60
  retain:
    days: 0
    mode: active_objects
  events:
    # Optional: Maximum length of time to retain video during long events. (default: shown below)
    # NOTE: If an object is being tracked for longer than this amount of time, the retained recordings
    #       will be the last x seconds of the event unless retain->days under record is > 0.
    #max_seconds: 300
    # Optional: Number of seconds before the event to include (default: shown below)
    pre_capture: 10
    # Optional: Number of seconds after the event to include (default: shown below)
    post_capture: 20
    # Optional: Objects to save recordings for. (default: all tracked objects)
    objects:
      - person
    # 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: 10
      # 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: active_objects
      # Optional: Per object retention days
      objects:
        person: 15

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: 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: False
  height: 720
  # 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: 10
    # Optional: Per object retention days
    objects:
      person: 15

motion:
  threshold: 20
  mask:
    - 981,0,977,74,536,76,534,0

Relevant log output

[2022-08-24 12:11:57] frigate.http ERROR : No recordings found for the requested time range

FFprobe output from your camera

Input #0, mpjpeg, from 'http://raspicam3.fritz.box/html/cam_pic_new.php?':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 512x288, 25 tbr, 25 tbn

Frigate stats

{"detection_fps":0.0,"detectors":{"cpu1":{"detection_start":0.0,"inference_speed":103.27,"pid":217}},"service":{"latest_version":"0.10.1","storage":{"/dev/shm":{"free":65.1,"mount_type":"tmpfs","total":67.1,"used":2.0},"/media/frigate/clips":{"free":8079.3,"mount_type":"overlay","total":41082.7,"used":30890.4},"/media/frigate/recordings":{"free":8079.3,"mount_type":"overlay","total":41082.7,"used":30890.4},"/tmp/cache":{"free":996.5,"mount_type":"tmpfs","total":1000.0,"used":3.5}},"temperatures":{},"uptime":54032,"version":"0.11.0-37325c7"},"vorne":{"camera_fps":5.0,"capture_pid":224,"detection_fps":0.0,"pid":222,"process_fps":5.0,"skipped_fps":0.0}}

Operating system

Debian

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

mjpeg Rasperry Pi Cam

Any other information that may be helpful

No response

hawkeye217 commented 2 years ago

I have been occasionally seeing this error message with some of my recorded events in the UI on 0.11.x. But if I reload my browser window, the event will play successfully. The issue may be different from yours, however.

NickM-27 commented 2 years ago

There must be more relevant logs than this, most likely there's recording errors happening

Also can you provide your docker compose file?

maginator commented 2 years ago

Docker Compose File: version: "3.9" services: frigate: container_name: frigate privileged: true # this may not be necessary for all setups restart: unless-stopped image: blakeblackshear/frigate:0.11.0-rc1 labels:

networks: traefik: name: traefik_web external: true

Maybe I need to change some Log settings to see more erros because i looked in to the log while the Event was recorded and i see nothing. And dont be confused by the Labels i dont use traefik as a reverse proxy right now.

NickM-27 commented 2 years ago

@maginator when the error occurs can you please use inspect element to get the browser logs?

maginator commented 2 years ago

@NickM-27 This is what i get as Logs: videojs-seek-buttons.e0f6dbbe.js:31 VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported. Ve {code: 4, message: 'The media could not be loaded, either because the …rk failed or because the format is not supported.'} (anonymous) @ videojs-seek-buttons.e0f6dbbe.js:31 Ud.n.error @ videojs-seek-buttons.e0f6dbbe.js:31 i.error @ videojs-seek-buttons.e0f6dbbe.js:45 i.handleTechError_ @ videojs-seek-buttons.e0f6dbbe.js:45 (anonymous) @ videojs-seek-buttons.e0f6dbbe.js:43 Ze.n.dispatcher.n.dispatcher @ videojs-seek-buttons.e0f6dbbe.js:33 error (async) Ze @ videojs-seek-buttons.e0f6dbbe.js:33 Qt @ videojs-seek-buttons.e0f6dbbe.js:33 on @ videojs-seek-buttons.e0f6dbbe.js:33 Qt @ videojs-seek-buttons.e0f6dbbe.js:33 on @ videojs-seek-buttons.e0f6dbbe.js:33 t @ videojs-seek-buttons.e0f6dbbe.js:63 handleSource @ videojs-seek-buttons.e0f6dbbe.js:63 a.setSource @ videojs-seek-buttons.e0f6dbbe.js:33 t @ videojs-seek-buttons.e0f6dbbe.js:33 i.loadTech_ @ videojs-seek-buttons.e0f6dbbe.js:43 i.src_ @ videojs-seek-buttons.e0f6dbbe.js:45 (anonymous) @ videojs-seek-buttons.e0f6dbbe.js:45 Jt @ videojs-seek-buttons.e0f6dbbe.js:33 Jt @ videojs-seek-buttons.e0f6dbbe.js:33 (anonymous) @ videojs-seek-buttons.e0f6dbbe.js:33 (anonymous) @ videojs-seek-buttons.e0f6dbbe.js:33 setTimeout (async) t.setTimeout @ videojs-seek-buttons.e0f6dbbe.js:33 Fv @ videojs-seek-buttons.e0f6dbbe.js:33 i.handleSrc_ @ videojs-seek-buttons.e0f6dbbe.js:45 i.src @ videojs-seek-buttons.e0f6dbbe.js:45 t @ videojs-seek-buttons.e0f6dbbe.js:33 t.addChild @ videojs-seek-buttons.e0f6dbbe.js:33 s @ videojs-seek-buttons.e0f6dbbe.js:33 t.initChildren @ videojs-seek-buttons.e0f6dbbe.js:33 t @ videojs-seek-buttons.e0f6dbbe.js:34 L @ videojs-seek-buttons.e0f6dbbe.js:45 (anonymous) @ VideoPlayer.2d88c6da.js:1 Rt @ vendor.153a2319.js:1 Si @ vendor.153a2319.js:1 setTimeout (async) o @ vendor.153a2319.js:1 requestAnimationFrame (async) (anonymous) @ vendor.153a2319.js:1 v.diffed @ vendor.153a2319.js:1 Bt @ vendor.153a2319.js:1 _n @ vendor.153a2319.js:1 Bt @ vendor.153a2319.js:1 _n @ vendor.153a2319.js:1 di @ vendor.153a2319.js:1 Bt @ vendor.153a2319.js:1 _n @ vendor.153a2319.js:1 di @ vendor.153a2319.js:1 Bt @ vendor.153a2319.js:1 _n @ vendor.153a2319.js:1 Bt @ vendor.153a2319.js:1 _n @ vendor.153a2319.js:1 Bt @ vendor.153a2319.js:1 _n @ vendor.153a2319.js:1 di @ vendor.153a2319.js:1 Bt @ vendor.153a2319.js:1 _n @ vendor.153a2319.js:1 di @ vendor.153a2319.js:1 Bt @ vendor.153a2319.js:1 _n @ vendor.153a2319.js:1 Bt @ vendor.153a2319.js:1 (anonymous) @ vendor.153a2319.js:1 Je @ vendor.153a2319.js:1 Promise.then (async) Ot @ vendor.153a2319.js:1 T.setState @ vendor.153a2319.js:1 n.__c.n.__ @ vendor.153a2319.js:1 onClick @ Events.1a91949d.js:14 br @ vendor.153a2319.js:1

This is what the Log look like: image

NickM-27 commented 2 years ago

There've been improvements in RC2 so please try updating to that

maginator commented 2 years ago

It seems like that this update fixes my issues. Since yesterday i didnt get any error for not loading clips. Thank you very much :) <3