homebridge-plugins / homebridge-camera-ffmpeg

Homebridge Plugin Providing FFmpeg-based Camera Support
https://homebridge-plugins.github.io/homebridge-camera-ffmpeg/
Apache License 2.0
1.09k stars 227 forks source link

AI Thinker ESP32Cam Help #1403

Closed robboz4 closed 1 year ago

robboz4 commented 1 year ago

Describe The Problem: Trying to add the ESP32Cam to Homebridge. The model is an AI Thinker. It it strain video that can be seen with just the URL and a browser. I have tried just adding it and then as a child bridge. I get the same type of error messages:

[Office Cam] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info.

I have tried different code on the ESP32. Currently trying ESPVideoCam32. Homebridge is running on a RaspberryPi 3 with all the latest code loaded today. I turned on debug lofting and was able to see connection timeouts in the log. The Pi is hard wired and the ESP is only 3' away from the WiFi router. And you can see streaming video on URL 192.168.1.134 in a web browser. Any help would be appreciated in getting this running.

To Reproduce: Added code to ESP32 board, change config and restarted Homebridge. Repeated for different ESP32 code.

Logs: [6/24/2023, 4:03:58 PM] [Camera-ffmpeg] Initializing Camera-ffmpeg platform... [6/24/2023, 4:03:58 PM] [Camera-ffmpeg] Initializing child bridge 0E:5A:87:DE:77:7D .. . . 6/24/2023, 4:04:56 PM] [Camera-ffmpeg] [Office Cam] Snapshot requested: 1280 x 720 [6/24/2023, 4:04:56 PM] [Camera-ffmpeg] [Office Cam] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -i http://192.168.1.134 -frames:v 1 -f image2 - -hide_banner -loglevel error [Office Cam] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info. [6/24/2023, 4:05:12 PM] [Camera-ffmpeg] [Office Cam] Snapshot requested: 1280 x 720 [Office Cam] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info. [Office Cam] The image snapshot handler for the given accessory didn't respond at all! See https://homebridge.io/w/JtMGR for more info. . . . [Office Cam] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info. [6/24/2023, 4:05:45 PM] [Hue] Lamp 2: set homekit status fault from 1 to 0 [Office Cam] The image snapshot handler for the given accessory didn't respond at all! See https://homebridge.io/w/JtMGR for more info. [6/24/2023, 4:06:10 PM] [Hue] Lamp 3: set homekit status fault from 0 to 1 [6/24/2023, 4:06:10 PM] [Camera-ffmpeg] [Office Cam] Snapshot requested: 1280 x 720 [6/24/2023, 4:06:15 PM] [Hue] Lamp 1: set homekit status fault from 1 to 0 [Office Cam] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info. [6/24/2023, 4:06:30 PM] [Hue] Lamp 1: set homekit status fault from 0 to 1 [6/24/2023, 4:06:30 PM] [Hue] Lamp 3: set homekit status fault from 1 to 0 [Office Cam] The image snapshot handler for the given accessory didn't respond at all! See https://homebridge.io/w/JtMGR for more info. [6/24/2023, 4:06:53 PM] [Camera-ffmpeg] [Office Cam] Snapshot requested: 1280 x 720 [Office Cam] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info. [Office Cam] The image snapshot handler for the given accessory didn't respond at all! See https://homebridge.io/w/JtMGR for more info. [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] Video stream requested: 1280 x 720, 30 fps, 299 kbps [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] Starting video stream: 1280 x 720, 30 fps, 299 kbps [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] Stream command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -i http://192.168.1.134 -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 30 -f rawvideo -preset ultrafast -tune zerolatency -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)2:trunc(ih/2)2 -b:v 299k -payload_type 99 -ssrc 1041248 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params X1t/goltbSjd7oeHkJrdeP6MC+e80QgOj3YVBd/N srtp://192.168.1.196:60753?rtcpport=60753&pkt_size=1316 -loglevel level+verbose -progress pipe:1 [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] ffmpeg version 5.0 Copyright (c) 2000-2022 the FFmpeg developers [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516 [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] configuration: --pkgconfigdir=/build/workspace/lib/pkgconfig --prefix=/build/workspace --pkg-config-flags=--static --extra-cflags=-I/build/workspace/include --extra-ldflags=-L/build/workspace/lib --extra-libs='-lpthread -lm' --enable-static --disable-debug --disable-shared --disable-ffplay --disable-doc --enable-openssl --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-libspeex --enable-demuxer=rtsp --enable-omx-rpi --enable-mmal --enable-indev=alsa --enable-outdev=alsa [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] libavutil 57. 17.100 / 57. 17.100 [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] libavcodec 59. 18.100 / 59. 18.100 [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] libavformat 59. 16.100 / 59. 16.100 [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] libavdevice 59. 4.100 / 59. 4.100 [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] libavfilter 8. 24.100 / 8. 24.100 [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] libswscale 6. 4.100 / 6. 4.100 [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] libswresample 4. 3.100 / 4. 3.100 [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [info] libpostproc 56. 3.100 / 56. 3.100 [6/24/2023, 4:07:15 PM] [Camera-ffmpeg] [Office Cam] [tcp @ 0x34d0980] [verbose] Starting connection attempt to 192.168.1.134 port 80 [6/24/2023, 4:07:20 PM] [Camera-ffmpeg] [Office Cam] [tcp @ 0x34d0980] [verbose] Connection attempt to 192.168.1.134 port 80 failed: Connection timed out [6/24/2023, 4:07:20 PM] [Camera-ffmpeg] [Office Cam] [tcp @ 0x34d0980] [error] Connection to tcp://192.168.1.134:80 failed: Connection timed out [6/24/2023, 4:07:20 PM] [Camera-ffmpeg] [Office Cam] [error] http://192.168.1.134: Connection timed out [6/24/2023, 4:07:20 PM] [Camera-ffmpeg] [Office Cam] FFmpeg exited with code: 1 and signal: null (Error) [6/24/2023, 4:07:20 PM] [Camera-ffmpeg] [Office Cam] Stopped video stream.

\

Homebridge Config: "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:35", "port": 51826, "pin": "031-45-154", "manufacturer": "@nfarina", "model": "Homebridge", "serialNumber": "0.4.20", "advertiser": "ciao", "bind": [ "wlan0" ] },

{ "name": "Camera-ffmpeg", "cameras": [ { "name": "Office Cam", "manufacturer": "AI Thinker Module", "unbridge": false, "videoConfig": { "source": "-i http://192.168.1.134", "stillImageSource": "-i http://192.168.1.134", "debug": true } } ], "platform": "Camera-ffmpeg", "_bridge": { "username": "0E:5A:87:DE:77:7D", "port": 36394 } } (These are the bridge and FFMpeg config sections only. The json file works perfectly with all other devices configured and has done for several l years. There is only Hue bridge and two Wemo devices.) Screenshots:

Environment:

github-actions[bot] commented 1 year 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.