question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Support]: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures

See original GitHub issue

Describe the problem you are having

This is a new Frigate installation. I have already read a lot in old problems in the last few weeks and know that the Annke camera can only do H.265. Therefore I have to use:

rtmp:
      Enabled: False

Nevertheless, I have an error in there somewhere that all streams, no matter if H264 or H265 have the error “ffmpeg sent a broken frame”. Apparently I have “invalid args defined for this camera.” somewhere, but unfortunately I can’t find it. If someone could help me, I would be very grateful. image

Version

2.3 as Home Assistant Add On in VMM on DSM 7.0.1

Frigate config file

mqtt:
  host: 10.20.60.79
  port: 1883
  user: *****
  password: ***********

detectors:
  coral:
    type: edgetpu
    device: usb

cameras:
  camera_1:
    ffmpeg:
      inputs:
        - path: rtsp://****:******@10.20.60.27:554
          roles:
            - detect
            - rtmp

  Annke_C800:
    rtmp:
      enabled: False
    ffmpeg:
      inputs:
        - path: rtsp://****:*******@10.20.60.87:554/Streaming/Channels/102
          roles:
            - detect


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

Relevant log output

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2021-11-04 14:00:03] frigate.app                    INFO    : Starting Frigate (0.9.4-26ae608)
[2021-11-04 14:00:03] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2021-11-04 14:00:03] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2021-11-04 14:00:03] peewee_migrate                 INFO    : There is nothing to migrate
[2021-11-04 14:00:03] frigate.mqtt                   INFO    : MQTT connected
[2021-11-04 14:00:03] frigate.app                    INFO    : Output process started: 216
[2021-11-04 14:00:03] ws4py                          INFO    : Using epoll
[2021-11-04 14:00:03] frigate.app                    INFO    : Camera processor started for camera_1: 221
[2021-11-04 14:00:03] detector.coral                 INFO    : Starting detection process: 215
[2021-11-04 14:00:03] frigate.app                    INFO    : Camera processor started for Annke_C800: 223
[2021-11-04 14:00:03] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2021-11-04 14:00:06] frigate.video                  INFO    : Annke_C800: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-04 14:00:03] frigate.app                    INFO    : Capture process started for camera_1: 226
[2021-11-04 14:00:06] frigate.video                  INFO    : Annke_C800: ffmpeg process is not running. exiting capture thread...
[2021-11-04 14:00:03] frigate.app                    INFO    : Capture process started for Annke_C800: 231
[2021-11-04 14:00:03] ws4py                          INFO    : Using epoll
[2021-11-04 14:00:03] frigate.video                  INFO    : camera_1: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-04 14:00:03] frigate.video                  INFO    : camera_1: ffmpeg process is not running. exiting capture thread...
[2021-11-04 14:00:06] frigate.edgetpu                INFO    : TPU found
[2021-11-04 15:24:16] watchdog.Annke_C800            ERROR   : You may have invalid args defined for this camera.
[2021-11-04 15:24:16] ffmpeg.Annke_C800.detect       ERROR   : [AVHWDeviceContext @ 0x557a6cad00c0] No VA display found for device /dev/dri/renderD128.
[2021-11-04 15:24:16] ffmpeg.Annke_C800.detect       ERROR   : Device creation failed: -22.
[2021-11-04 15:24:16] ffmpeg.Annke_C800.detect       ERROR   : [mjpeg @ 0x557a6ca99e00] No device available for decoder: device type vaapi needed for codec mjpeg.
[2021-11-04 15:24:16] ffmpeg.Annke_C800.detect       ERROR   : Device setup failed for decoder on input stream #0:0 : Invalid argument
[2021-11-04 15:24:16] frigate.video                  INFO    : camera_1: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-04 15:24:16] frigate.video                  INFO    : camera_1: ffmpeg process is not running. exiting capture thread...
[2021-11-04 15:24:19] frigate.video                  INFO    : Annke_C800: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-11-04 15:24:19] frigate.video                  INFO    : Annke_C800: ffmpeg process is not running. exiting capture thread...
[2021-11-04 15:24:26] watchdog.camera_1              ERROR   : FFMPEG process crashed unexpectedly for camera_1.
[2021-11-04 15:24:26] watchdog.camera_1              ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-11-04 15:24:26] watchdog.camera_1              ERROR   : You may have invalid args defined for this camera.
[2021-11-04 15:24:26] ffmpeg.camera_1.detect         ERROR   : rtsp://****:*****@10.20.60.27:554: Invalid data found when processing input
[2021-11-04 15:24:26] watchdog.Annke_C800            ERROR   : FFMPEG process crashed unexpectedly for Annke_C800.
[2021-11-04 15:24:26] watchdog.Annke_C800            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-11-04 15:24:26] watchdog.Annke_C800            ERROR   : You may have invalid args defined for this camera.

FFprobe output from your camera

Annkes C800:
C:\Users\....>ffprobe rtsp://******:*****@10.20.60.87:554/Streaming/Channels/102
ffprobe version 2021-11-03-git-08a501946f-essentials_build-www.gyan.dev Copyright (c) 2007-2021 the FFmpeg developers
  built with gcc 11.2.0 (Rev1, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      57.  7.100 / 57.  7.100
  libavcodec     59. 12.100 / 59. 12.100
  libavformat    59.  8.100 / 59.  8.100
  libavdevice    59.  0.101 / 59.  0.101
  libavfilter     8. 16.101 /  8. 16.101
  libswscale      6.  1.100 /  6.  1.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
Input #0, rtsp, from 'rtsp://****:****@10.20.60.87:554/Streaming/Channels/102':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 640x480 [SAR 1:1 DAR 4:3], 14.99 tbr, 90k tbn
  Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

I

Frigate stats

{"Annke_C800":{"camera_fps":0.0,"capture_pid":230,"detection_fps":0.0,"pid":224,"process_fps":0.0,"skipped_fps":0.0},"camera_1":{"camera_fps":0.0,"capture_pid":227,"detection_fps":0.0,"pid":220,"process_fps":0.0,"skipped_fps":0.0},"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":10.0,"pid":216}},"service":{"storage":{"/dev/shm":{"free":3113.1,"mount_type":"tmpfs","total":3113.5,"used":0.4},"/media/frigate/clips":{"free":103502.6,"mount_type":"ext4","total":126073.0,"used":17420.7},"/media/frigate/recordings":{"free":103502.6,"mount_type":"ext4","total":126073.0,"used":17420.7},"/tmp/cache":{"free":3113.5,"mount_type":"tmpfs","total":3113.5,"used":0.0}},"uptime":794,"version":"0.9.4-26ae608"}}

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Annke C800, IPC360

Any other information that may be helpful

Host: Synology 920+ DSM 7.0.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:25 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Multipagecommented, Nov 4, 2021

ffprobe isn’t telling the FPS so i think you’ve set the fps to variable in the cam. I had that problem too! I had to switch to a the 3rd substream of the my camera to get it working and get rid of the error and green screens

1reaction
Multipagecommented, Nov 4, 2021

Your camera resolution AND fps don’t match and that’s because you didn’t specify it My Camera rtsp output is 1024 x 768 with 20fps So that’s what is specified in the config file

Example of my config:

    ffmpeg:
      input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -codec:a aac
      hwaccel_args:
        - -hwaccel
        - vaapi
        - -hwaccel_device
        - /dev/dri/renderD128
        - -hwaccel_output_format
        - yuv420p
      inputs:
        - path: rtsp://xxx:xxx@192.168.0.92:554/Streaming/Channels/103
          roles:
            - detect
            - rtmp
    detect:
      width: 1280
      height: 720
      fps: 20
Read more comments on GitHub >

github_iconTop Results From Across the Web

ffmpeg sent a broken frame. memoryview assignment: lvalue ...
Describe the bug. Unable to capture camera frames via ffmpeg on RPI 3B . On the webserver green color appears instead of actual...
Read more >
Frigate FFMPEG Parameter Help : r/homeassistant - Reddit
... ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures frigate.video INFO : entrance_cam: ffmpeg ...
Read more >
Local realtime person detection for RTSP cameras
frigate.video INFO : porch_beta: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures ...
Read more >
[SUPPORT] blakeblackshear - Frigate - Page 12
video INFO : front_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures [2021-11-20 16:48:56] ...
Read more >
0.8 beta 2: ffmpeg sent a broken frame. memoryview assignment
0.8 beta 1 -> 0.8 beta 2: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures,
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found