Sunoo / homebridge-camera-ffmpeg

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

Appears codec won't start #853

Closed Pelonius closed 3 years ago

Pelonius commented 3 years ago

Describe The Problem: When I select the camera view in homekit, the log shows it calling for the codec to start, then it stops with no error and says the stream stopped. I have tried every setup for the camera WYZECam V2 I can find on the site. I have tried other RTSP cameras with the same result. I suspect it should work in "copy". I have tried with and without setting the force maximum settings but left what the VLC says the stream is using. I have tried forcing every setting... any direction would be grateful.

Logs: [10/21/2020, 9:14:34 PM] Got SIGINT, shutting down Homebridge... [10/21/2020, 9:14:36 PM] Loaded config.json with 0 accessories and 3 platforms. [10/21/2020, 9:14:36 PM] --- [10/21/2020, 9:14:36 PM] Loaded plugin: homebridge-camera-ffmpeg@3.0.3 [10/21/2020, 9:14:36 PM] Registering platform 'homebridge-camera-ffmpeg.Camera-ffmpeg' [10/21/2020, 9:14:36 PM] --- [10/21/2020, 9:14:36 PM] Loaded plugin: homebridge-config-ui-x@4.30.0 [10/21/2020, 9:14:36 PM] Registering platform 'homebridge-config-ui-x.config' [10/21/2020, 9:14:36 PM] --- [10/21/2020, 9:14:36 PM] Loaded plugin: homebridge-myq@2.3.2 [10/21/2020, 9:14:36 PM] Registering platform 'homebridge-myq.myQ' [10/21/2020, 9:14:36 PM] --- [10/21/2020, 9:14:36 PM] Loading 3 platforms... [10/21/2020, 9:14:36 PM] [Config] Initializing config platform... [10/21/2020, 9:14:36 PM] [Config] Spawning homebridge-config-ui-x with PID 10846 [10/21/2020, 9:14:36 PM] [Garage Door] Initializing myQ platform... [10/21/2020, 9:14:36 PM] [Camera FFmpeg] Initializing Camera-ffmpeg platform... [10/21/2020, 9:14:36 PM] [Camera FFmpeg] [Test Pelco] Configuring cached bridged accessory... [10/21/2020, 9:14:36 PM] [Camera FFmpeg] [Back Yard] Configuring cached bridged accessory... Setup Payload: X-HM://0024ALBHTE5DB Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ 498-17-457 │     
└────────────┘     

[10/21/2020, 9:14:36 PM] Homebridge is running on port 51826. [10/21/2020, 9:14:37 PM] [Garage Door] myQ API: Successfully connected to the myQ API. [10/21/2020, 9:14:38 PM] [Garage Door] myQ API: Discovered device family garagedoor: Garage Door (serial number: xxxxxxxxxxx, gateway: xxxxxxxxxxxxxx). [10/21/2020, 9:14:38 PM] [Garage Door] myQ API: Discovered device family gateway: Hub [Chamberlain WiFi Hub] (serial number: xxxxxxxxxxxxxxx). [10/21/2020, 9:14:38 PM] [Garage Door] Garage Door: Door position sensor detected. Enabling battery status support. [10/21/2020, 9:14:38 PM] [Camera FFmpeg] [Test Pelco] Snapshot requested: 1280 x 720 [10/21/2020, 9:14:38 PM] [Camera FFmpeg] [Test Pelco] Sending snapshot: 1280 x 720 [10/21/2020, 9:14:38 PM] [Camera FFmpeg] [Test Pelco] Snapshot command: ffmpeg -i http://192.168.1.100/jpg -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)2:trunc(ih/2)2 -f image2 - [10/21/2020, 9:14:38 PM] [Camera FFmpeg] [Back Yard] Snapshot requested: 1280 x 720 [10/21/2020, 9:14:38 PM] [Camera FFmpeg] [Back Yard] Sending snapshot: 1280 x 720 [10/21/2020, 9:14:38 PM] [Camera FFmpeg] [Back Yard] Snapshot command: ffmpeg -i rtsp://username:password@192.168.1.67/live -vframes 1 -r 1 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)2:trunc(ih/2)2 -f image2 - [10/21/2020, 9:15:18 PM] [Camera FFmpeg] [Test Pelco] Snapshot requested: 1280 x 720 [10/21/2020, 9:15:18 PM] [Camera FFmpeg] [Test Pelco] Sending snapshot: 1280 x 720 [10/21/2020, 9:15:18 PM] [Camera FFmpeg] [Test Pelco] Snapshot command: ffmpeg -i http://192.168.1.100/jpg -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)2:trunc(ih/2)2 -f image2 - [10/21/2020, 9:15:18 PM] [Camera FFmpeg] [Back Yard] Snapshot requested: 1280 x 720 [10/21/2020, 9:15:18 PM] [Camera FFmpeg] [Back Yard] Sending snapshot: 1280 x 720 [10/21/2020, 9:15:18 PM] [Camera FFmpeg] [Back Yard] Snapshot command: ffmpeg -i rtsp://username:password@192.168.1.67/live -vframes 1 -r 1 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)2:trunc(ih/2)2 -f image2 - [10/21/2020, 9:16:08 PM] [Camera FFmpeg] [Test Pelco] Snapshot requested: 1280 x 720 [10/21/2020, 9:16:08 PM] [Camera FFmpeg] [Test Pelco] Sending snapshot: 1280 x 720 [10/21/2020, 9:16:08 PM] [Camera FFmpeg] [Test Pelco] Snapshot command: ffmpeg -i http://192.168.1.100/jpg -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)2:trunc(ih/2)2 -f image2 - [10/21/2020, 9:16:08 PM] [Camera FFmpeg] [Back Yard] Snapshot requested: 1280 x 720 [10/21/2020, 9:16:08 PM] [Camera FFmpeg] [Back Yard] Sending snapshot: 1280 x 720 [10/21/2020, 9:16:08 PM] [Camera FFmpeg] [Back Yard] Snapshot command: ffmpeg -i rtsp://username:password@192.168.1.67/live -vframes 1 -r 1 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)2:trunc(ih/2)2 -f image2 - [10/21/2020, 9:21:32 PM] [Camera FFmpeg] [Back Yard] Snapshot requested: 1280 x 720 [10/21/2020, 9:21:32 PM] [Camera FFmpeg] [Back Yard] Sending snapshot: 1280 x 720 [10/21/2020, 9:21:32 PM] [Camera FFmpeg] [Back Yard] Snapshot command: ffmpeg -i rtsp://username:password@192.168.1.67/live -vframes 1 -r 1 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)2:trunc(ih/2)2 -f image2 - [10/21/2020, 9:21:32 PM] [Camera FFmpeg] [Test Pelco] Snapshot requested: 1280 x 720 [10/21/2020, 9:21:32 PM] [Camera FFmpeg] [Test Pelco] Sending snapshot: 1280 x 720 [10/21/2020, 9:21:32 PM] [Camera FFmpeg] [Test Pelco] Snapshot command: ffmpeg -i http://192.168.1.100/jpg -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)2:trunc(ih/2)2 -f image2 - [10/21/2020, 9:21:33 PM] [Camera FFmpeg] [Back Yard] Video stream requested: 1280 x 720, 30 fps, 299 kbps [10/21/2020, 9:21:33 PM] [Camera FFmpeg] [Back Yard] Starting video stream: native x native, native fps, ??? kbps [10/21/2020, 9:21:33 PM] [Camera FFmpeg] [Back Yard] Stream command: ffmpeg -i rtsp://username:password@192.168.1.67/live -an -sn -dn -codec:v copy -pix_fmt yuv420p -color_range mpeg -f rawvideo -payload_type 99 -ssrc 516365 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params I98AYvn3ztGimiKaIKaN9mWNSquDpMfXW7WTa8gl srtp://192.168.1.93:59806?rtcpport=59806&pkt_size=1316 -loglevel level+verbose [10/21/2020, 9:21:33 PM] [Camera FFmpeg] [Back Yard] Stopped video stream.

Show the Homebridge logs here.
Remove any sensitive information.

Homebridge Config: { "name": "Camera FFmpeg", "interfaceName": "igb0", "cameras": [ { "name": "Back Yard", "manufacturer": "WYZE", "model": "WYZECam v2", "serialNumber": "Back", "doorbell": false, "videoConfig": { "source": "-i rtsp://username:password@192.168.1.67/live", "stillImageSource": "-i rtsp://username:password@192.168.1.67/live -vframes 1 -r 1", "maxStreams": 2, "maxWidth": 1920, "maxHeight": 1080, "maxFPS": 15, "maxBitrate": 2048, "forceMax": true, "vcodec": "copy", "debug": true } }, { "name": "Test Pelco", "manufacturer": "Pelco", "model": "Sarix", "serialNumber": "this one", "firmwareRevision": "that one", "videoConfig": { "source": "-rtsp_transport tcp -i rtsp://192.168.1.100/stream1", "stillImageSource": "-i http://192.168.1.100/jpg", "vcodec": "copy", "debug": true } } ], "platform": "Camera-ffmpeg"

Sunoo commented 3 years ago

Looks like you possibly don’t have FFmpeg installed?

Pelonius commented 3 years ago

that's what I thought too, I tried directing it to the install folder, I tried installing manually.

Sunoo commented 3 years ago

Is just weird, because there should be some output after the “Stream command” line. The fast that nothing is there implies that FFmpeg isn’t there. I’m not overly familiar with FreeBSD, so I’m not sure how much I can assist there.

Pelonius commented 3 years ago

I haven't seen much documentation on this install either, I am using a hombridge plugin on FreeNAS. The other plugins in homebridge workfine, I removed most of them to try and isolate this issue.

Sunoo commented 3 years ago

On most systems, this plugin would pull in its own version of FFmpeg which includes the audio codec used by HomeKit (the ffmpeg-for-homebridge package). Unfortunately, that is not available on FreeBSD, so it relies on you having FFmpeg installed and in your path (audio will not work unless you compile it yourself). If you try to run ffmpeg from the terminal, does anything happen?

Pelonius commented 3 years ago

I havn't been able to run it, that maybe that I can't find the terminal. I am fairly new at this, but I have a strong background in commercial AV programming. I have been wondering if I should try a different os.

Sunoo commented 3 years ago

If you’re considering changing OSes, I’d recommend using one supported by ffmpeg-for-homebridge: https://github.com/homebridge/ffmpeg-for-homebridge/blob/master/README.md That’ll allow you to have working audio easily. For what it’s worth, it seems most people run Homebridge under Linux.

Pelonius commented 3 years ago

I tried the mac version... and it works.... lol smh.