[Camera Support]: Unable to read frames from ffmpeg process

See original GitHub issue

Describe the problem you are having

Hi! I am just trying to get my camera to work but all i get is this:

frigate | [2022-07-25 15:43:39] watchdog.kitchen ERROR : Ffmpeg process crashed unexpectedly for kitchen. frigate | [2022-07-25 15:43:39] watchdog.kitchen ERROR : The following ffmpeg logs include the last 100 lines prior to exit. frigate | [2022-07-25 15:43:39] ffmpeg.kitchen.detect ERROR : [tcp @ 0x55fa9db67380] Connection to tcp://192.168.0.12:554?timeout=5000000 failed: Connection refused frigate | [2022-07-25 15:43:39] ffmpeg.kitchen.detect ERROR : rtsp://admin:xx@192.168.0.12:554/tcp/av0_1: Connection refused frigate | [2022-07-25 15:43:39] ffmpeg.kitchen.record ERROR : [tcp @ 0x558d3f61c3c0] Connection to tcp://192.168.0.12:554?timeout=5000000 failed: Connection refused frigate | [2022-07-25 15:43:39] ffmpeg.kitchen.record ERROR : rtsp://admin:xx@192.168.0.12:554/tcp/av0_0: Connection refused frigate | [2022-07-25 15:43:39] watchdog.kitchen INFO : Terminating the existing ffmpeg process… frigate | [2022-07-25 15:43:39] watchdog.kitchen INFO : Waiting for ffmpeg to exit gracefully… frigate | [2022-07-25 15:43:39] frigate.video ERROR : kitchen: Unable to read frames from ffmpeg process. frigate | [2022-07-25 15:43:39] frigate.video ERROR : kitchen: ffmpeg process is not running. exiting capture thread…

As well as

- path: rtsp://admin:{FRIGATE_KITCHEN_PASSWORD}@192.168.0.12:554/udp/av0_1
roles:
- detect
- rtmp
- path: rtsp://admin:{FRIGATE_KITCHEN_PASSWORD}@192.168.0.12:554/udp/av0_0
roles:
- record

I have also tried:

- path: rtsp://admin:{FRIGATE_KITCHEN_PASSWORD}@192.168.0.12:554/tcp/av0_1
roles:
- detect
- rtmp
- path: rtsp://admin:{FRIGATE_KITCHEN_PASSWORD}@192.168.0.12:554/tcp/av0_0
roles:
- record

Thanks!!

Version

0.10.1-83481af

Frigate config file

# https://docs.frigate.video/configuration/index

mqtt:
  host: 192.168.0.7

birdseye:
  mode: motion

ffmpeg:
  # https://docs.frigate.video/configuration/hardware_acceleration
  hwaccel_args:
    - -hwaccel
    - qsv
    - -qsv_device
    - /dev/dri/renderD128

objects:
  track:
    - person
    - dog

record:
  enabled: true
  retain:
    days: 1
    mode: motion
  events:
    objects:
      - person
      - dog
    retain:
      default: 1

cameras:
  kitchen:
    ffmpeg:
      inputs:
        - path: rtsp://admin:{FRIGATE_KITCHEN_PASSWORD}@192.168.0.12:554/udp/av0_1
          roles:
            - detect
            - rtmp
        - path: rtsp://admin:{FRIGATE_KITCHEN_PASSWORD}@192.168.0.12:554/udp/av0_0
          roles:
            - record
    detect:
      width: 640
      height: 360
      fps: 7

detectors:
  cpu:
    type: cpu
    num_threads: 1
#  coral:
#    type: edgetpu
#    device: pci
#    num_threads: 3

Relevant log output

[2022-07-25 15:42:58] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
Starting migrations
[2022-07-25 15:42:58] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-07-25 15:42:58] peewee_migrate                 INFO    : There is nothing to migrate
[2022-07-25 15:42:58] detector.cpu                   INFO    : Starting detection process: 217
[2022-07-25 15:42:58] frigate.app                    INFO    : Output process started: 219
[2022-07-25 15:42:58] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-07-25 15:42:58] ws4py                          INFO    : Using epoll
[2022-07-25 15:42:58] frigate.app                    INFO    : Camera processor started for kitchen: 223
[2022-07-25 15:42:58] frigate.app                    INFO    : Capture process started for kitchen: 225
[2022-07-25 15:42:58] ws4py                          INFO    : Using epoll
[2022-07-25 15:42:59] frigate.video                  ERROR   : kitchen: Unable to read frames from ffmpeg process.
[2022-07-25 15:42:59] frigate.video                  ERROR   : kitchen: ffmpeg process is not running. exiting capture thread...
[2022-07-25 15:43:19] watchdog.kitchen               ERROR   : Ffmpeg process crashed unexpectedly for kitchen.
[2022-07-25 15:43:19] watchdog.kitchen               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-07-25 15:43:19] ffmpeg.kitchen.detect          ERROR   : [tcp @ 0x55f816c5b380] Connection to tcp://192.168.0.12:554?timeout=5000000 failed: Connection refused
[2022-07-25 15:43:19] ffmpeg.kitchen.detect          ERROR   : rtsp://admin:xx@192.168.0.12:554/tcp/av0_1: Connection refused
[2022-07-25 15:43:19] ffmpeg.kitchen.record          ERROR   : [tcp @ 0x55892e8e03c0] Connection to tcp://192.168.0.12:554?timeout=5000000 failed: Connection refused
[2022-07-25 15:43:19] ffmpeg.kitchen.record          ERROR   : rtsp://admin:xx@192.168.0.12:554/tcp/av0_0: Connection refused
[2022-07-25 15:43:19] watchdog.kitchen               INFO    : Terminating the existing ffmpeg process...
[2022-07-25 15:43:19] watchdog.kitchen               INFO    : Waiting for ffmpeg to exit gracefully...
[2022-07-25 15:43:19] frigate.video                  ERROR   : kitchen: Unable to read frames from ffmpeg process.
[2022-07-25 15:43:19] frigate.video                  ERROR   : kitchen: ffmpeg process is not running. exiting capture thread...
[2022-07-25 15:43:29] watchdog.kitchen               ERROR   : Ffmpeg process crashed unexpectedly for kitchen.
[2022-07-25 15:43:29] watchdog.kitchen               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-07-25 15:43:29] ffmpeg.kitchen.detect          ERROR   : [tcp @ 0x55a3916ba380] Connection to tcp://192.168.0.12:554?timeout=5000000 failed: Connection refused
[2022-07-25 15:43:29] ffmpeg.kitchen.detect          ERROR   : rtsp://admin:xx@192.168.0.12:554/tcp/av0_1: Connection refused
[2022-07-25 15:43:29] ffmpeg.kitchen.record          ERROR   : [tcp @ 0x561c2d4563c0] Connection to tcp://192.168.0.12:554?timeout=5000000 failed: Connection refused
[2022-07-25 15:43:29] ffmpeg.kitchen.record          ERROR   : rtsp://admin:xx@192.168.0.12:554/tcp/av0_0: Connection refused
[2022-07-25 15:43:29] watchdog.kitchen               INFO    : Terminating the existing ffmpeg process...
[2022-07-25 15:43:29] watchdog.kitchen               INFO    : Waiting for ffmpeg to exit gracefully...
[2022-07-25 15:43:29] frigate.video                  ERROR   : kitchen: Unable to read frames from ffmpeg process.
[2022-07-25 15:43:29] frigate.video                  ERROR   : kitchen: ffmpeg process is not running. exiting capture thread...
[2022-07-25 15:43:39] watchdog.kitchen               ERROR   : Ffmpeg process crashed unexpectedly for kitchen.
[2022-07-25 15:43:39] watchdog.kitchen               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-07-25 15:43:39] ffmpeg.kitchen.detect          ERROR   : [tcp @ 0x55fa9db67380] Connection to tcp://192.168.0.12:554?timeout=5000000 failed: Connection refused
[2022-07-25 15:43:39] ffmpeg.kitchen.detect          ERROR   : rtsp://admin:x@192.168.0.12:554/tcp/av0_1: Connection refused
[2022-07-25 15:43:39] ffmpeg.kitchen.record          ERROR   : [tcp @ 0x558d3f61c3c0] Connection to tcp://192.168.0.12:554?timeout=5000000 failed: Connection refused
[2022-07-25 15:43:39] ffmpeg.kitchen.record          ERROR   : rtsp://admin:x@192.168.0.12:554/tcp/av0_0: Connection refused
[2022-07-25 15:43:39] watchdog.kitchen               INFO    : Terminating the existing ffmpeg process...
[2022-07-25 15:43:39] watchdog.kitchen               INFO    : Waiting for ffmpeg to exit gracefully...
[2022-07-25 15:43:39] frigate.video                  ERROR   : kitchen: Unable to read frames from ffmpeg process.
[2022-07-25 15:43:39] frigate.video                  ERROR   : kitchen: ffmpeg process is not running. exiting capture thread...

FFprobe output from your camera

ffprobe rtsp://admin:xx@192.168.0.12:554/udp/av0_1
ffprobe version 5.0.1 Copyright (c) 2007-2022 the FFmpeg developers
  built with Apple clang version 13.0.0 (clang-1300.0.29.30)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/5.0.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
[tcp @ 0x7faa310040c0] Connection to tcp://192.168.0.12:554?timeout=0 failed: Network is unreachable
rtsp://admin:xx@192.168.0.12:554/udp/av0_1: Network is unreachable

Frigate stats

{
   "detection_fps":0,
   "detectors":{
      "cpu":{
         "detection_start":0,
         "inference_speed":10,
         "pid":217
      }
   },
   "kitchen":{
      "camera_fps":0,
      "capture_pid":225,
      "detection_fps":0,
      "pid":223,
      "process_fps":0,
      "skipped_fps":0
   },
   "service":{
      "storage":{
         "/dev/shm":{
            "free":66.8,
            "mount_type":"tmpfs",
            "total":67.1,
            "used":0.3
         },
         "/media/frigate/clips":{
            "free":639785.7,
            "mount_type":"ext4",
            "total":3935282.7,
            "used":3095519.1
         },
         "/media/frigate/recordings":{
            "free":639785.7,
            "mount_type":"ext4",
            "total":3935282.7,
            "used":3095519.1
         },
         "/tmp/cache":{
            "free":8196.9,
            "mount_type":"tmpfs",
            "total":8196.9,
            "used":0
         }
      },
      "temperatures":{
         
      },
      "uptime":816,
      "version":"0.10.1-83481af"
   }
}

Operating system

Debian

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Mixed

Camera make and model

vstarcam C7824WIP

Any other information that may be helpful

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Jleaglecommented, Jul 25, 2022

Ah got it to work using the right port.

        - path: rtsp://admin:{FRIGATE_KITCHEN_PASSWORD}@192.168.0.12:10554/tcp/av0_1
          roles:
            - detect
            - rtmp
        - path: rtsp://admin:{FRIGATE_KITCHEN_PASSWORD}@192.168.0.12:10554/tcp/av0_0
          roles:
            - record
0reactions
NickM-27commented, Jul 25, 2022

Awesome, glad it is working now. This should be closable then 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Support]: Unable to read frames from ffmpeg process #2808
Ffmpeg is struggling to maintain a connection to your camera. It is receiving lots of bad data in the stream. Typically this happens...
Read more >
Frequently Asked Questions - Frigate Docs
I am seeing a solid green image for my camera.#. A solid green image means that frigate has not received any frames from...
Read more >
ffmpeg Documentation
Before encoding, ffmpeg can process raw audio and video frames using filters from the libavfilter library. Several chained filters form a filter graph....
Read more >
Local realtime person detection for RTSP cameras
I have 6 dahua cameras every single one come back with FFMPEG process crashed unexpectedly, …You may have invalid args defined for this...
Read more >
Frigate FFMPEG Parameter Help : r/homeassistant - Reddit
video INFO : garden_cam: ffmpeg sent a broken frame. read of closed file frigate.video INFO : garden_cam: ffmpeg process is not running. exiting ......
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