blakeblackshear / frigate

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

[Support]: ffmpeg sent a broken frame. #2361

Closed SweatyToast closed 2 years ago

SweatyToast commented 2 years ago

Describe the problem you are having

I am not able to get any of my cameras working since I updated before the major breaking changed. I went back to 0.84 and work like a dream but when updating its saying that its sending a broken frame. My understanding is that is due to a incorrect resolution. But I know %100 that its correct I checked in VLC and its working in the older version still.

I have multiple brands of cameras all working with older version, all will not work in the newer I get the same error on all cameras.

Version

0.9.4-26AE608

Frigate config file

mqtt:
  host: 172.30.16.25
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: ha
  password: notmypassword
  stats_interval: 60

detectors:
  coral:
    type: edgetpu
    device: pci

cameras:
  frontyard:
    ffmpeg:
      inputs:
        - path: rtsp://admin:NotMyPassword@172.30.16.247:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp
    detect:
      width: 704
      height: 480

---------------------------------

OLD CONFIG

mqtt:
  host: 172.30.16.25
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: ha
  password: notmypassword
  stats_interval: 60

cameras:
  frontyard:
    ffmpeg:
      inputs:
        - path: rtsp://admin:NotMyPassword@172.30.16.247:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif
          roles:
            - detect
        - path: rtsp://admin:NotMyPassword@172.30.16.247:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif
          roles:
#           - detect
            - clips
#    width: 3840
#    height: 2160
    width: 704
    height: 480
    fps: 10
  frontright:
    ffmpeg:
      inputs:
        - path: rtsp://admin:NotMyPassword@172.30.16.249:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif
          roles:
            - detect
        - path: rtsp://admin:NotMyPassword@172.30.16.249:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif
          roles:
#           - detect
            - clips
#    width: 3840
#    height: 2160
    width: 704
    height: 480
    fps: 10
  doorbell:
    ffmpeg:
      inputs:
        - path: rtsp://admin:NotMyPassword@172.30.16.58:554/cam/realmonitor?channel=1&subtype=1&authbasic=64
          roles:
            - detect
        - path: rtsp://admin:NotMyPassword@172.30.16.58:554/cam/realmonitor?channel=1&subtype=1&authbasic=64
          roles:
#            - detect
            - clips
#    width: 3840
#    height: 2160
    width: 720
    height: 576
    fps: 10

    rtmp:
      enabled: false
    clips:
      enabled: True
      pre_capture: 5
      post_capture: 5
      objects:
        - person
        - car
      retain:
        default: 10
        objects:
          person: 15
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: False
      retain:
        default: 10
        objects:
          person: 15
    objects:
      track:
        - person
        - cat
        - dog
        - car    

detectors:
  coral:
    type: edgetpu
    device: pci

Relevant log output

[2021-12-01 12:44:35] frigate.video INFO : frontyard: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-12-01 12:44:35] frigate.video INFO : frontyard: ffmpeg process is not running. exiting capture thread...
[2021-12-01 12:44:43] watchdog.frontyard ERROR : FFMPEG process crashed unexpectedly for frontyard.

[2021-12-01 12:44:43] watchdog.frontyard ERROR : The following ffmpeg logs include the last 100 lines prior to exit.

[2021-12-01 12:44:43] watchdog.frontyard ERROR : You may have invalid args defined for this camera.

[2021-12-01 12:44:43] ffmpeg.frontyard.detect ERROR : [flv @ 0x558278e95a00] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly

[2021-12-01 12:44:43] ffmpeg.frontyard.detect ERROR : [flv @ 0x558278e95a00] Packet is missing PTS

[2021-12-01 12:44:43] ffmpeg.frontyard.detect ERROR : av_interleaved_write_frame(): Invalid argument

[2021-12-01 12:44:43] ffmpeg.frontyard.detect ERROR : Finishing stream 1:0 without any data written to it.

[2021-12-01 12:44:43] ffmpeg.frontyard.detect ERROR : [flv @ 0x558278e95a00] Failed to update header with correct duration.

[2021-12-01 12:44:43] ffmpeg.frontyard.detect ERROR : [flv @ 0x558278e95a00] Failed to update header with correct filesize.

[2021-12-01 12:44:45] frigate.video INFO : frontyard: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-12-01 12:44:45] frigate.video INFO : frontyard: ffmpeg process is not running. exiting capture thread...
[2021-12-01 12:44:53] watchdog.frontyard ERROR : FFMPEG process crashed unexpectedly for frontyard.

FFprobe output from your camera

sorry im not sure how to run this exactly.

Frigate stats

No response

Operating system

UNRAID

Install method

Docker CLI

Coral version

M.2

Network connection

Wired

Camera make and model

dahua DH-IPC-HDW2831, lorex E891AB, amcrest AD410

Any other information that may be helpful

Please if there is anymore info needed I will gladly give it! Also, this is an amazing I'd gladly donate $50

Thanks!!

blakeblackshear commented 2 years ago

It's not the detect resolution. Those don't have to match anymore. Messages about flv are related to rtmp, so that's why it is erroring out. I don't see an error message explaining why in the logs. Try disabling rtmp for the cameras causing issues.

SweatyToast commented 2 years ago

Oh wow I though that was just to stream external to like home assistant. I didn't know if would effect the display of cameras. That was it thank you so much! Keep up the great work! Greatly appreciated, thanks for the quick response!

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.