blakeblackshear / frigate

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

[Support]: View recordings in browser fails #3051

Closed Langelus closed 2 years ago

Langelus commented 2 years ago

Describe the problem you are having

Just installed Frigate (Docker ) on a Ubuntu 20.0.4 LTS running in VirtualBox on Windows, everthing seems to work excellent except that I can not view recordings in the webinterface. I get error message "The media could not be loaded, either because the server or network failed or because the format is not supported." but the files have clearly been recorded and I have no problem viewing them with VLC.

Version

0.10.1-83481AF

Frigate config file

mqtt:
  host: 192.168.0.73
  #user: mqtt
  #password: 1234

cameras:
  Hallen:
    ffmpeg:
      inputs:
        - path: rtsp://langelus:<<pw redacted>>@192.168.20.65:554/stream1
          roles:
            - detect
            - record
            - rtmp
    motion:
      mask:
        - 1432,0,1227,1080,1920,1080,1920,0
    detect:
      width: 1920
      height: 1080
      fps: 10
    record:
      enabled: True
#      events:
#        retain:
#          default: 10
    rtmp:
      enabled: True

detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu

Relevant log output

No errors in the log

FFprobe output from your camera

ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  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
[rtsp @ 0x557d84e61b80] method SETUP failed: 406 Not Acceptable
rtsp://langelus:<<pw redacted>>@192.168.20.65:554/stream1: Server returned 4XX Client Error, but not one of 40{0,1,3,4}

Frigate stats

No response

Operating system

Other Linux

Install method

Docker CLI

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

TP Link Tapo C100

Any other information that may be helpful

No response

NickM-27 commented 2 years ago

I can't tell from the ffprobe, is your camera H.265 or H.264? H.265 isn't supported by most browsers.

Langelus commented 2 years ago

Camera output is H.264

Langelus commented 2 years ago

VLC Codec Ouput (Recorded file)

Codec: H264 - MPEG-4 AVC (part 10) (avc1) Type: Video Video resolution: 1920x1080 Buffer dimensions: 1920x1090 Frame rate: 14.9032397 Decoded format: Planar 4:2:0 YUV full scale Orientation: Top left Color primaries: ITU-R BT.709 Color transfer function: ITU-R BT.709 Color space: ITU-R BT.709 Range Chroma location: Left

trythatagain commented 2 years ago

detect: width: 1920 height: 1080 fps: 10 ### Perhaps changing this 5 or less as in frigate docs I've put my Amcrest thru VLC and have these that are different to yours Decoded format:

Plus I have this in my config.yml as I have a I5-4570 ffmpeg: hwaccel_args:

I think trying the fps is probably your best bet first, and if possible try a lower resolution stream if possible

NickM-27 commented 2 years ago

@Langelus If you go to the recordings for that camera, are you able to view the event there?

Langelus commented 2 years ago

@trythatagain 5 FPS made no difference

@NickM-27 Nope, same error there, it wont even load the media list.

NickM-27 commented 2 years ago

@trythatagain 5 FPS made no difference

@NickM-27 Nope, same error there, it wont even load the media list.

Do you see anything under the logs from nginx at /usr/local/nginx/logs/error.log inside the container when it fails to playback.

trythatagain commented 2 years ago

Just a thought can you view it from VLC in the VM you created?

Langelus commented 2 years ago

@NickM-27 2022/04/04 17:16:23 [crit] 195#195: *359 aio read "/media/frigate/recordings/2022-04/04/16/Hallen/54.20.mp4" failed (95: Operation not supported) while reading media header, client: 192.168.0.220, server: , request: "GET /vod/event/1649084052.866185-atvvgv/index.m3u8 HTTP/1.1", host: "192.168.0.14:5000", referrer: "http://192.168.0.14:5000/events

@trythatagain No, it's headless

trythatagain commented 2 years ago

Is there actually files in the recording folder? Will the display over the network or if you pull them on to a system with a monitor?

NickM-27 commented 2 years ago

Is there actually files in the recording folder? Will the display over the network or if you pull them on to a system with a monitor?

In the OP they state the files exist and can be watched using VLC

NickM-27 commented 2 years ago

@blakeblackshear will know more about the nginx error and what it entails. I'll try to do some research, but am not super familiar with nginx errors yet.

trythatagain commented 2 years ago

OK, just reread message, I was fixated on his VLC codec output, I stand corrected.

blakeblackshear commented 2 years ago

Can you post your docker run command or compose file? This looks like an issue with nginx when it's trying to read the header information on recorded files. I'm guessing you are storing the recordings on a network share or something.

Langelus commented 2 years ago

Haven't really got those commands handy since I created it in Portainer directly, but you were spot on, I removed the bind for the external storage and that made it work so it seems like some sorts of permission issue for the container and mounted storage

edasque commented 2 years ago

I have the same problem (docker, ubuntu, 0.10.1) on a local volume: - /docker/frigate/storage:/media/frigate

I cannot view the video and when I download it, it's 50 bytes only. In that directory, the recordings directory is empty (while the clips directory isn't).

NickM-27 commented 2 years ago

I have the same problem (docker, ubuntu, 0.10.1) on a local volume: - /docker/frigate/storage:/media/frigate

I cannot view the video and when I download it, it's 50 bytes only. In that directory, the recordings directory is empty (while the clips directory isn't).

If you're having issues with this and it's a local volume please create your own issue as it's unrelated to OPs

stale[bot] commented 2 years 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.

Deckoz2302 commented 1 year ago

I have the same issue as the OP. I have 24/7 recording enabled. I get detections, and recordings. But within frigate, for this one camera it shows image

All of my camera's are h264, They're all recording to the same disk, not a permission issue. RTMP works fine(which is the same as the detect stream). Recording works fine, as I can watch back events from the media tab of HA, or directly from the disk. But, all the events within frigate will not play.

image

ffmpeg:
  global_args: -hide_banner -loglevel warning
  hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000
  output_args:
   detect: -f rawvideo -pix_fmt yuv420p
   record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
   rtmp: -c copy -f flv

rtmp:
  enabled: True

environment_vars:
  LIBVA_DRIVER_NAME: i965

cameras:
  front_doorbell: 
    ui:
      order: 5
    ffmpeg:
      inputs:
        - path: rtsp://username:pass@192.168.5.101:554/cam/realmonitor?channel=1&subtype=0 
          roles:
            - record
        - path: rtsp://username:pass@192.168.5.101:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp
    rtmp:
      enabled: true
    objects:
      track:
        - person
    detect:
      width: 720 
      height: 576
      fps: 10
    record:
      enabled: true
      events:
        required_zones:
          - front_porch
    snapshots:
      enabled: true
      bounding_box: true
      crop: true
      timestamp: false
      height: 500
      retain:
        default: 5
      required_zones:
        - front_porch
    mqtt:
      timestamp: false
      bounding_box: false
      crop: true
      quality: 100
      height: 500
    zones:
      front_porch:
        coordinates: 127,576,720,576,720,92,625,125,227,44,215,384
        objects:
          - person
    motion:
      mask:
        - 0,384,0,576,72,576,177,392
cjnatan commented 1 year ago

I have the same issue as the OP. I have 24/7 recording enabled. I get detections, and recordings. But within frigate, for this one camera it shows image

All of my camera's are h264, They're all recording to the same disk, not a permission issue. RTMP works fine(which is the same as the detect stream). Recording works fine, as I can watch back events from the media tab of HA, or directly from the disk. But, all the events within frigate will not play.

image

ffmpeg:
  global_args: -hide_banner -loglevel warning
  hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000
  output_args:
   detect: -f rawvideo -pix_fmt yuv420p
   record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
   rtmp: -c copy -f flv

rtmp:
  enabled: True

environment_vars:
  LIBVA_DRIVER_NAME: i965

cameras:
  front_doorbell: 
    ui:
      order: 5
    ffmpeg:
      inputs:
        - path: rtsp://username:pass@192.168.5.101:554/cam/realmonitor?channel=1&subtype=0 
          roles:
            - record
        - path: rtsp://username:pass@192.168.5.101:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp
    rtmp:
      enabled: true
    objects:
      track:
        - person
    detect:
      width: 720 
      height: 576
      fps: 10
    record:
      enabled: true
      events:
        required_zones:
          - front_porch
    snapshots:
      enabled: true
      bounding_box: true
      crop: true
      timestamp: false
      height: 500
      retain:
        default: 5
      required_zones:
        - front_porch
    mqtt:
      timestamp: false
      bounding_box: false
      crop: true
      quality: 100
      height: 500
    zones:
      front_porch:
        coordinates: 127,576,720,576,720,92,625,125,227,44,215,384
        objects:
          - person
    motion:
      mask:
        - 0,384,0,576,72,576,177,392

Did you ever resolve this issue? I seem to encounter a similar issue when I map a shared drive via vboxsf; when I moved it back to a local folder, it works with no issues.

Like in your set up, the recordings were available, snapshots are shown, just no video playback.

2023-09-18 09:39:12.680893757 2023/09/18 09:39:12 [crit] 134#134: *101 aio read "/media/frigate/recordings/2023-09-18/08/front/26.53.mp4" failed (95: Operation not supported) while reading media header,