frigate: [Support]: The media could not be loaded, either because the server or network failed or because the format is not supported.

Describe the problem you are having

Hello,

I have two Annke C800 cameras, the streams are in h265.

Before I converted the streams to h264, but it uses a lot of cpu resources, now, as chrome can read hevc, I wanted to disable the conversion, except I have this error when I go to recordings:

The media could not be loaded, either because the server or network failed or because the format is not supported.

what is wrong with my configuration?

Version

0.11.1-2eada21

Frigate config file

mqtt:
  host: 192.168.0.2

detectors:
  coral:
    type: edgetpu
    device: usb

record:
  enabled: True
  retain:
    days: 7
    mode: all
  events:
    retain:
      default: 10

birdseye:
  enabled: False

snapshots:
  enabled: True
  retain:
    default: 5

objects:
 track:
   - car
   - person

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p

cameras:
  Entree: # <------ Name the camera
    ffmpeg:
      input_args: -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -strict experimental -rtsp_transport tcp -timeout 5000000
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
        #record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -vf format=nv12,hwupload,scale_vaapi=w=1920:h=1080 -c:v h264_vaapi -b:v 6M -c:a aac

      inputs:
        - path: rtsp://admin:<password>@192.168.0.10:554/Streaming/Channels/1
          roles:
            - record
        - path: rtsp://admin:<password>@192.168.0.10:554/Streaming/Channels/2
          roles:
            - detect

    rtmp:
      enabled: False # <-- RTMP should be disabled if your stream is not H264
    detect:
      width: 640 # <---- update for your camera's resolution
      height: 480 # <---- update for your camera's resolution
      fps: 6

  Garage: # <------ Name the camera
    ffmpeg:
      input_args: -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -strict experimental -rtsp_transport tcp -timeout 5000000
      #input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
        #record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -vf format=nv12,hwupload,scale_vaapi=w=1920:h=1080 -c:v h264_vaapi -b:v 6M -c:a aac

      inputs:
        - path: rtsp://admin:<password>@192.168.0.11:554/Streaming/Channels/1
          roles:
            - record
        - path: rtsp://admin:<password>@192.168.0.11:554/Streaming/Channels/2
          roles:
            - detect

    rtmp:
      enabled: False # <-- RTMP should be disabled if your stream is not H264
    detect:
      width: 640 # <---- update for your camera's resolution
      height: 480 # <---- update for your camera's resolution
      fps: 6

Relevant log output

Plus API Key is not formatted correctly.
[2022-12-01 23:35:52] frigate.app                    INFO    : Starting Frigate (0.11.1-2eada21)
Starting migrations
[2022-12-01 23:35:52] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-12-01 23:35:53] peewee_migrate                 INFO    : There is nothing to migrate
[2022-12-01 23:35:53] detector.coral                 INFO    : Starting detection process: 232
[2022-12-01 23:35:53] frigate.app                    INFO    : Output process started: 234
[2022-12-01 23:35:53] ws4py                          INFO    : Using epoll
[2022-12-01 23:35:53] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2022-12-01 23:35:53] frigate.app                    INFO    : Camera processor started for Entree: 238
[2022-12-01 23:35:53] frigate.app                    INFO    : Camera processor started for Garage: 242
[2022-12-01 23:35:53] frigate.app                    INFO    : Capture process started for Entree: 244
[2022-12-01 23:35:53] frigate.app                    INFO    : Capture process started for Garage: 247
[2022-12-01 23:35:53] ws4py                          INFO    : Using epoll
[2022-12-01 23:35:55] frigate.edgetpu                INFO    : TPU found
[2022-12-01 23:36:03] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:37390]
[2022-12-01 23:36:06] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:37390]
[2022-12-01 23:36:06] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:33452]

FFprobe output from your camera

ffprobe version n5.1-2-g915ef932a3-20220731 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-mbedtls --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs='-ldl -lgomp' --extra-version=20220731
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, rtsp, from 'rtsp://admin:<password>@192.168.0.10:554/Streaming/Channels/1':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: hevc (Main), yuvj420p(pc), 3840x2160 [SAR 1:1 DAR 16:9], 12.50 tbr, 90k tbn
  Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s

Frigate stats

{"Entree":{"camera_fps":6.0,"capture_pid":244,"detection_fps":0.0,"pid":238,"process_fps":6.0,"skipped_fps":0.0},"Garage":{"camera_fps":6.1,"capture_pid":247,"detection_fps":0.0,"pid":242,"process_fps":6.1,"skipped_fps":0.0},"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":8.46,"pid":232}},"service":{"latest_version":"0.11.1","storage":{"/dev/shm":{"free":266.5,"mount_type":"tmpfs","total":268.4,"used":2.0},"/media/frigate/clips":{"free":6316188.8,"mount_type":"fuse.shfs","total":11996500.4,"used":5680311.6},"/media/frigate/recordings":{"free":6316188.8,"mount_type":"fuse.shfs","total":11996500.4,"used":5680311.6},"/tmp/cache":{"free":990.3,"mount_type":"tmpfs","total":1000.0,"used":9.7}},"temperatures":{},"uptime":78,"version":"0.11.1-2eada21"}}

Operating system

UNRAID

Install method

Docker CLI

Coral version

USB

Network connection

Wired

Camera make and model

Annke C800

Any other information that may be helpful

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve been able to work around this by patching nginx-vod-module to skip the trailing bits test, rebuilding nginx and copying the new /usr/local/nginx/sbin/nginx binary into my v0.12.0-beta3 container.

nginx-vod-module/vod/avc_hevc_parser.c

bool_t
avc_hevc_parser_rbsp_trailing_bits(bit_reader_state_t* reader)
{
        return TRUE;
}

It seems that the presence of these trailing bits is technically against spec, but usually ignored without consequence.

I also came across this ffmpeg patch: https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200709192022.9412-5-andreas.rheinhardt@gmail.com/ Seems that ffmpeg should be stripping these bits when converting to .mp4, but currently ignores them.

Postel’s law says that software should be conservative in what it sends and liberal in what it accepts. ffmpeg and nginx-vod-module seem to have this backwards 😃