blakeblackshear / frigate

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

ffmeg error #986

Closed cpainchaud closed 3 years ago

cpainchaud commented 3 years ago

Describe the bug ffmpeg error: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have

/api/version

Version of frigate 0.8.4-5043040

Config file Include your full config file wrapped in triple back ticks.

mqtt:
  host: core-mosquitto

detectors:
  cpu1:
    type: cpu

ffmpeg:
  hwaccel_args:
    - -c:v
    - h264_v4l2m2m
  global_args: -hide_banner -loglevel info

logger:
  default: debug

cameras:
  back:
    ffmpeg:
      inputs:
         - path: 'rtmp://192.168.0.43/bcs/channel0_sub.bcs?channel=0&stream=0&user=xxxx&password=xxxe'
           roles:
             - detect

    width: 640
    height: 480
    fps: 10

Frigate container logs

 * Starting nginx nginx
   ...done.
frigate.app                    INFO    : Creating directory: /tmp/cache
frigate.app                    WARNING : Camera back has rtmp enabled, but rtmp is not assigned to an input.
Starting migrations
peewee_migrate                 INFO    : Starting migrations
peewee                         DEBUG   : ('CREATE TABLE IF NOT EXISTS "migratehistory" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(255) NOT NULL, "migrated_at" DATETIME NOT NULL)', [])
peewee                         DEBUG   : ('SELECT "t1"."id", "t1"."name", "t1"."migrated_at" FROM "migratehistory" AS "t1" ORDER BY "t1"."id"', [])
There is nothing to migrate
peewee_migrate                 INFO    : There is nothing to migrate
frigate.mqtt                   ERROR   : MQTT Not authorized
frigate.mqtt                   INFO    : MQTT connected
frigate.app                    INFO    : Camera processor started for back: 36
detector.cpu1                  INFO    : Starting detection process: 33
frigate.app                    INFO    : Capture process started for back: 37
frigate.mqtt                   ERROR   : MQTT Not authorized
frigate.mqtt                   INFO    : MQTT connected
frigate.mqtt                   ERROR   : MQTT Not authorized
frigate.mqtt                   INFO    : MQTT connected
frigate.video                  INFO    : back: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : back: ffmpeg process is not running. exiting capture thread...
frigate.mqtt                   ERROR   : MQTT Not authorized
frigate.mqtt                   INFO    : MQTT connected
ffmpeg.back.detect             ERROR   : Option rtsp_transport not found.
frigate.video                  INFO    : back: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : back: ffmpeg process is not running. exiting capture thread...
frigate.mqtt                   ERROR   : MQTT Not authorized
frigate.mqtt                   INFO    : MQTT connected
ffmpeg.back.detect             ERROR   : Option rtsp_transport not found.
frigate.video                  INFO    : back: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have 

Frigate stats

Output from frigate's /api/stats endpoint

FFprobe from your camera

Run the following command and paste output below

root@ccab4aaf-frigate:/opt/frigate# ffprobe 'rtmp://192.168.0.43/bcs/channel0_sub.bcs?channel=0&stream=0&user=xxxxx&password=xxxx' 
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-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-omx --enable-omx-rpi --enable-mmal --enable-v4l2_m2m --enable-neon --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
Input #0, flv, from 'rtmp://192.168.0.43/bcs/channel0_sub.bcs?channel=0&stream=0&user=xxxxx&password=xxxx':
  Metadata:
    displayWidth    : 640
    displayHeight   : 480
  Duration: 00:00:00.00, start: 7705.525000, bitrate: N/A
    Stream #0:0: Data: none
    Stream #0:1: Video: h264, yuv420p(progressive), 640x480, 9 fps, 30 tbr, 1k tbn
    Stream #0:2: Audio: aac, 16000 Hz, mono, fltp
Unsupported codec with id 0 for input stream 0

Screenshots If applicable, add screenshots to help explain your problem.

Computer Hardware

Camera Info:

Additional context Add any other context about the problem here.

cpainchaud commented 3 years ago

I just realized (was i blind?) that may be this is a duplicate of https://github.com/blakeblackshear/frigate/issues/941

cpainchaud commented 3 years ago

well no it doesn't seem to be related.

Note: it works very well on VLC.

SaschaHenning commented 3 years ago

Have you tried using the input args for the reolink described here: https://blakeblackshear.github.io/frigate/configuration/cameras#reolink-410520-possibly-others ?

I had issues with broken frames before using this configuration.

cpainchaud commented 3 years ago

YOU ARE MY HERO!!!! and I feel terrible for missing this in the docs....