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

ESP32-CAM not streaming video in Homebridge #1412

Closed robboz4 closed 1 year ago

robboz4 commented 1 year ago

Describe The Problem: In homebridge video from ESP32-CAM shows stills and counts to 10, then says now, and restarts the count. Clicking on the video brings up window with the current image and the endless spinning wheel eventually saying no response. I need to restart the IOS app to get the connection back to the camera.

I have looked at other reported issues like this but haven't found a solution for the ESP32-CAM.

To Reproduce: Install ESP32-CAM as per config page. Using the ESP32 sever example code as suggested. Everything worked first time.

Logs:

[9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] Video stream requested: 1280 x 720, 30 fps, 299 kbps [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] Starting video stream: 1280 x 720, 25 fps, 299 kbps [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] Stream command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -f mjpeg -i http://192.168.1.133:81/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 25 -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 11007804 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params FBqWZYpam3YkvACM/wq2/f3CBJPsQSTC1AJJ90SU srtp://192.168.1.147:65316?rtcpport=65316&pkt_size=1316 -loglevel level+verbose -progress pipe:1 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] ffmpeg version 5.0 Copyright (c) 2000-2022 the FFmpeg developers [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-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 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] libavutil 57. 17.100 / 57. 17.100 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] libavcodec 59. 18.100 / 59. 18.100 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] libavformat 59. 16.100 / 59. 16.100 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] libavdevice 59. 4.100 / 59. 4.100 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] libavfilter 8. 24.100 / 8. 24.100 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] libswscale 6. 4.100 / 6. 4.100 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] libswresample 4. 3.100 / 4. 3.100 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] libpostproc 56. 3.100 / 56. 3.100 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [tcp @ 0x23f7a20] [verbose] Starting connection attempt to 192.168.1.133 port 81 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [tcp @ 0x23f7a20] [verbose] Successfully connected to 192.168.1.133 port 81 [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] Input #0, mjpeg, from 'http://192.168.1.133:81/stream': [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] Duration: N/A, bitrate: N/A [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [info] Stream #0:0: Video: mjpeg (Baseline), 1 reference frame, yuvj422p(pc, bt470bg/unknown/unknown, center), 320x240, 25 tbr, 1200k tbn [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [NULL @ 0x2409330] [error] Unable to find a suitable output format for '' [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [error] : Invalid argument [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] [AVIOContext @ 0x2407c40] [verbose] Statistics: 9963 bytes read, 0 seeks [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] FFmpeg exited with code: 1 and signal: null (Error) [9/5/2023, 5:03:32 PM] [Camera FFmpeg] [ESP32-Cam] Stopped video stream.

[9/5/2023, 5:04:24 PM] [Camera FFmpeg] [ESP32-Cam] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -f mjpeg -i http://192.168.1.133/capture -frames:v 1 -f image2 - -hide_banner -loglevel error [9/5/2023, 5:04:24 PM] [Camera FFmpeg] [ESP32-Cam] Fetching snapshot took 0.282 seconds. [9/5/2023, 5:04:24 PM] [Camera FFmpeg] [ESP32-Cam] Sending snapshot: 1280 x 720 [9/5/2023, 5:04:24 PM] [Camera FFmpeg] [ESP32-Cam] Resize command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -i pipe: -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease -f image2 - [9/5/2023, 5:04:34 PM] [Camera FFmpeg] [ESP32-Cam] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -f mjpeg -i http://192.168.1.133/capture -frames:v 1 -f image2 - -hide_banner -loglevel error [9/5/2023, 5:04:34 PM] [Camera FFmpeg] [ESP32-Cam] Fetching snapshot took 0.29 seconds. [9/5/2023, 5:04:34 PM] [Camera FFmpeg] [ESP32-Cam] Sending snapshot: 1280 x 720 [9/5/2023, 5:04:34 PM] [Camera FFmpeg] [ESP32-Cam] Resize command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -i pipe: -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease -f image2 - [9/5/2023, 5:04:44 PM] [Camera FFmpeg] [ESP32-Cam] Snapshot requested: 1280 x 720 [9/5/2023, 5:04:44 PM] [Camera FFmpeg] [ESP32-Cam] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -f mjpeg -i http://192.168.1.133/capture -frames:v 1 -f image2 - -hide_banner -loglevel error [9/5/2023, 5:04:45 PM] [Camera FFmpeg] [ESP32-Cam] Fetching snapshot took 0.321 seconds. [9/5/2023, 5:04:45 PM] [Camera FFmpeg] [ESP32-Cam] Sending snapshot: 1280 x 720 [9/5/2023, 5:04:45 PM] [Camera FFmpeg] [ESP32-Cam] Resize command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -i pipe: -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease -f image2 -

Homebridge Config: {             "name": "Camera FFmpeg",             "cameras": [                 {                     "name": "ESP32-Cam",                     "manufacturer": "expressive",                     "model": "ESP32-Cam",                     "serialNumber": "1234567890",                     "videoConfig": {                         "source": " -f mjpeg -i http://xx.xx.xx.xx81/stream",                         "stillImageSource": "-f mjpeg -i http://xx.xx.xx.xx/capture",                         "maxStreams": 2,                         "maxWidth": 1600,                         "maxHeight": 1200,                         "maxFPS": 25,                         "debug": true                     }                 }             ],             "platform": "Camera-ffmpeg"         }

Screenshots:

OS Raspbian GNU/Linux Buster (10)
Hostname Homebridge
IPv4 (wlan0) xxxxxxxxx
Node.js Version v18.17.0
User root
Storage Path /var/homebridge
Config Path /var/homebridge/config.json

IMG_5791 IMG_5792

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.