hoobs-org / HOOBS

Build your Smart Home with HOOBS. Connect over 2,000 Accessories to your favorite Ecosystem.
https://hoobs.org
GNU General Public License v3.0
552 stars 51 forks source link

Camera FFMPEG #553

Closed resgroupmsr closed 4 years ago

resgroupmsr commented 4 years ago

Description Fresh HOOBS install. Fresh install of Camera FFMPEG plug in.

Expected behavoir On the Configuration screen there are a number of items for Camera FFMPEG that I do not know how to fill in. I previously had FFMPEG working properly with Homebridge but this interface is different. I've tried to get it to work but no luck. Have even tried copying the old working config items for one camera into HOOBS, still no luck.

Plugin name Camera FFMPEG 0.1.17 published 4/14/2020 • 3 days ago

Please report the issue to the plugin developer We like to help the community, however some issues are out of our control. Please report this to the plugin developer and include a link here. https://www.npmjs.com/package/homebridge-camera-ffmpeg

Version Please include the version of HOOBS you are using.

Did you upgrade Please let us know if you upgraded from a previous version.

Did you orginally upgrade to HOOBS 3 from HOOBS 2.1.1? Did you perform an upgrade from HOOBS 2.1.1? Some things are different.

What device are you using? Please let us know the device you are running HOOBS on.

If this is a custom install, what's your operating system? running on Raspberry PI 4

Post your config This can be found in the interface, Configuration -> Advanced or you can get it via SSH cat ~/.hoobs/etc/config.json

POST CONFIG HERE

{ "server": { "port": 8080, "origin": "*", "autostart": 0, "home_setup_id": "X-HM://0023ISYWYIBD0", "polling_seconds": 5 }, "client": { "default_route": "status", "inactive_logoff": 30, "theme": "hoobs-light", "locale": "en", "temp_units": "celsius", "country_code": "CA", "postal_code": "L0G1N0" }, "bridge": { "name": "HOOBS", "port": 51826, "pin": "031-45-154", "username": "B4:96:2E:97:FE:45" }, "description": "", "ports": {}, "accessories": [], "platforms": [ { "platform": "Nest", NOTE I'VE REMOVED ALL THE NEST ITEMS - IT IS WORKING PROPERLY }, { "platform": "Camera-ffmpeg", "plugin_map": { "plugin_name": "homebridge-camera-ffmpeg" }, "name": "Driveway", "uploader": false, "model": "RLC-410W", "manufacturer": "Reolink", "cameras": [ { "name": "Driveway", "videoConfig": { "source": "-re -i rtsp://admin:xxxxxx@192.168.1.241:554/h264Preview_01_sub", "stillImageSource": "-i http://192.168.1.241/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=XXXXX", "maxStreams": 5, "maxWidth": 1280, "maxHeight": 720, "maxFPS": 15, "maxBitrate": 300, "vcodec": "copy", "packetSize": 1316, "audio": false, "debug": true } } ], "videoProcessor": "" } ] } Post your log [Homebridge] [4/17/2020, 5:42:32 PM] Loaded config.json with 0 accessories and 2 platforms. [Homebridge] [4/17/2020, 5:42:33 PM] Loaded plugin "homebridge-camera-ffmpeg". [Homebridge] [4/17/2020, 5:42:33 PM] Registering platform "homebridge-camera-ffmpeg.Camera-ffmpeg" [Homebridge] [4/17/2020, 5:42:33 PM] Loaded plugin "nest". [Homebridge] [4/17/2020, 5:42:33 PM] Registering platform "nest.Nest" [Homebridge] [4/17/2020, 5:42:33 PM] Loading 2 platforms... [Homebridge] [4/17/2020, 5:42:33 PM] [Nest] Initializing Nest platform... [Homebridge] [4/17/2020, 5:42:33 PM] [Nest] Fetching Nest devices. [Homebridge] [4/17/2020, 5:42:33 PM] [Driveway] Initializing Camera-ffmpeg platform... [Homebridge] [4/17/2020, 5:42:33 PM] Loading 0 accessories... [Homebridge] [4/17/2020, 5:42:33 PM] Driveway is running on port 43351. [Homebridge] [4/17/2020, 5:42:37 PM] [Nest] initing thermostat "Living Room Thermostat": deviceId: 02AA01AC111506QF structureId: 643bbfb0-5c3b-11e3-b83d-1231390f08f1 [Homebridge] [4/17/2020, 5:42:37 PM] [Nest] initing home_away_sensor "Home Occupied": deviceId: 643bbfb0-5c3b-11e3-b83d-1231390f08f1 structureId: 643bbfb0-5c3b-11e3-b83d-1231390f08f1 [Homebridge] [4/17/2020, 5:42:37 PM] [Nest] initing protect "Bedroom Hall": deviceId: 18B43000002077AA structureId: 643bbfb0-5c3b-11e3-b83d-1231390f08f1 [Homebridge] [4/17/2020, 5:42:37 PM] [Nest] initing protect "Main Floor": deviceId: 18B430000020986F structureId: 643bbfb0-5c3b-11e3-b83d-1231390f08f1 [Homebridge] [4/17/2020, 5:42:37 PM] [Nest] Initializing platform accessory "Living Room Thermostat"... [Homebridge] [4/17/2020, 5:42:37 PM] [Nest] Initializing platform accessory "Home Occupied"... [Homebridge] [4/17/2020, 5:42:37 PM] [Nest] Initializing platform accessory "Bedroom Hall"... [Homebridge] [4/17/2020, 5:42:37 PM] [Nest] Initializing platform accessory "Main Floor"... [Homebridge] [4/17/2020, 5:42:37 PM] Homebridge is running on port 51826.

POST LOG HERE

Additional context Add any other context about the problem here.

askovi commented 4 years ago

Please follow this video tutorial: https://youtube.com/watch?v=LdcP0j9lyrw

resgroupmsr commented 4 years ago

Please follow this video tutorial: https://youtube.com/watch?v=LdcP0j9lyrw

I did follow the tutorial but the tutorial does not match either the current version of HOOBS or the plug in. Regardless, I've tried multiple different edits of the ffmpeg configuration - nothing is working in Homekit. Any thoughts to fix it would be greatly appreciated.

askovi commented 4 years ago

In order for cameras to show up in Homekit, you must add them from the Add Accessory in the Home app then tap Don't have code or cannot scan. If they don't show up there, that means you need to reset the Homekit connection. Head over to the HOOBS UI, go to the top right menu, click Help then click on Reset Connection. Rescan the QR code from the HOOBS Dashboard to re-pair it with Homekit then repeat the Add Accessory step for the cameras.

Also make sure the HOOBS Service is running and there are no errors in the logs before doing any of that.

resgroupmsr commented 4 years ago

In order for cameras to show up in Homekit, you must add them from the Add Accessory in the Home app then tap Don't have code or cannot scan. If they don't show up there, that means you need to reset the Homekit connection. Head over to the HOOBS UI, go to the top right menu, click Help then click on Reset Connection. Rescan the QR code from the HOOBS Dashboard to re-pair it with Homekit then repeat the Add Accessory step for the cameras.

Also make sure the HOOBS Service is running and there are no errors in the logs before doing any of that.

I did all of this but eventually just wiped all the cameras out and started again. They are working now but not perfectly. Have two running as 'copy' for vcodec (they are fine), and five running as 'libx264' as vcodec - these are choppy. Here's the new config entries: }, { "platform": "Camera-ffmpeg", "cameras": [ { "name": "Camera Driveway", "videoConfig": { "source": "-rtsp_transport tcp -re -i rtsp://REMOVED@192.168.1.241:554/h264Preview_01_main", "stillImageSource": "-i http://192.168.1.241/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=REMOVED", "maxStreams": 2, "maxWidth": 1280, "maxHeight": 720, "maxFPS": 15, "maxBitrate": 300, "vcodec": "copy", "packetSize": 1316, "audio": false, "debug": true } } ] }, { "platform": "Camera-ffmpeg", "cameras": [ { "name": "Camera Living Room", "videoConfig": { "source": "-xerror -rtsp_transport tcp -re -i rtsp://REMOVED@192.168.1.221/cam/realmonitor?channel=1&subtype=00&authbasic=YWRtaW46bG9sYTk2OTg=", "stillImageSource": "-i http://admin:REMOVED@192.168.1.221/cgi-bin/snapshot.cgi?1", "maxStreams": 2, "maxWidth": 1280, "maxHeight": 720, "maxFPS": 15, "maxBitrate": 300, "vcodec": "libx264", "packetSize": 1316, "audio": false, "debug": true } } ] },

askovi commented 4 years ago

Change the vcodec to: h264_omx

The best is vcodec: copy but that one doesn’t always work, the stream must be compatible with Homekit directly to use it because it doesn’t transcode the video unlike the others.

resgroupmsr commented 4 years ago

Thought h264_omx was being phased out? I will give it a try now though.

resgroupmsr commented 4 years ago

[Homebridge] [graph 0 input from stream 0:0 @ 0x2db4420] w:2304 h:1296 pixfmt:yuvj420p tb:1/90000 fr:10/1 sar:1/1 [Homebridge] [format @ 0x2f36cb0] Setting 'pix_fmts' to value 'yuv420p' [Homebridge] [auto_scaler_0 @ 0x2f24990] Setting 'flags' to value 'bicubic' [Homebridge] [auto_scaler_0 @ 0x2f24990] w:iw h:ih flags:'bicubic' interl:0 [Homebridge] [format @ 0x2f36cb0] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_null_0' and the filter 'format' [Homebridge] [AVFilterGraph @ 0x2db40e0] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed [Homebridge] [swscaler @ 0x319b020] deprecated pixel format used, make sure you did set range correctly [Homebridge] [auto_scaler_0 @ 0x2f24990] w:2304 h:1296 fmt:yuvj420p sar:1/1 -> w:2304 h:1296 fmt:yuv420p sar:1/1 flags:0x4 [Homebridge] [h264_omx @ 0x2db6150] Using OMX.broadcom.video_encode [Homebridge] [h264_omx @ 0x2db6150] OMX error 80001000 [Homebridge] [h264_omx @ 0x2db6150] err 80001018 (-2147479528) on line 561 [Homebridge] Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height [Homebridge] [AVIOContext @ 0x2ef1450] Statistics: 0 seeks, 0 writeouts [Homebridge] Conversion failed! [Homebridge] [4/18/2020, 3:13:04 PM] [Camera-ffmpeg] ERROR: FFmpeg exited with code 1

resgroupmsr commented 4 years ago

I went back to "vcodec": "libx264 -preset ultrafast" AND this has made it all REMARKABLY BETTER. I am done tinkering for the day, things are stable and working for now!