Closed bjornand1 closed 2 years ago
Hi, hope someone can help: I have been connecting two non-HomeKit cameras (Dafang and KingCam) through the Homebridge Camera FFmpeg plugin, and that has been working well. Wanting to get HomeKit Secure Video supported for these camera, I have now disabled that plugin and installed the homebridge-camera-ui plugin. I have used the same parameters in the config and I can now see the cameras in the camera.ui interface.
However, the cameras do not appear in HomeKit, and I see no obvious reason for this. Any ideas?
This is due to homebridge. Please change the names of the cameras and restart homebridge.
Then you can add the cameras via the Apple Home app with "+".
The PIN to add the cameras is the same as for homebridge.
Thanks, @seydx, for your quick reply! I tried this, but when I try to add an accessory with the Homebridge code, I only see the bridge. I presume it should appear as a new camera?
Followed the steps above? The camera should appear in the list as a camera.
Is "undbridged"
enabled in your config.json ?
Tried again, but went through "Other options", then it appeared, thanks! HSV for a KingCam - unbelievable!
Tried again, but went through "Other options", then it appeared, thanks! HSV for a KingCam - unbelievable!
Great :)
And Now I got my Dafang camera to work as well, sort of... It is very slow, both in the Camera UI and HomeKit. Any settings that should be tweaked to make it more responsive?
And Now I got my Dafang camera to work as well, sort of... It is very slow, both in the Camera UI and HomeKit. Any settings that should be tweaked to make it more responsive?
can you post your config.json pls
Sure, for the Dafang camera it is as follows (I should also say that the KingCam is proving to be a bit flaky, it works in the Camera UI, bit now says "No response" in HomeKit despite working earlier.
{ "name": "CatCamUI", "manufacturer": "Dafang", "model": "CatCam", "motion": true, "unbridge": true, "hsv": true, "prebuffering": true, "prebufferLength": 4, "videoConfig": { "source": "-re -i rtsp://192.168.1.50:8554/unicast", "maxStreams": 2, "vcodec": "copy", "acodec": "libfdk_aac", "audio": false, "stillImageSource": "-re -i rtsp://192.168.1.50:8554/unicast", "subSource": "-re -i rtsp://192.168.1.50:8554/unicast" },
{ "name": "CatCamUI", "manufacturer": "Dafang", "model": "CatCam", "motion": true, "unbridge": true, "hsv": true, "prebuffering": true, "prebufferLength": 4, "videoConfig": { "source": "-re -i rtsp://192.168.1.50:8554/unicast", "maxStreams": 2, "vcodec": "copy", "acodec": "libfdk_aac", "audio": false, "stillImageSource": "-re -i rtsp://192.168.1.50:8554/unicast", "subSource": "-re -i rtsp://192.168.1.50:8554/unicast" }
try this config.json
{
"name": "CatCamUI",
"manufacturer": "Dafang",
"model": "CatCam",
"motion": true,
"unbridge": true,
"hsv": true,
"prebuffering": true,
"prebufferLength": 4,
"videoConfig": {
"source": "-i rtsp://192.168.1.50:8554/unicast",
"subSource": "-i rtsp://192.168.1.50:8554/unicast",
"stillImageSource": "-i rtsp://192.168.1.50:8554/unicast",
"rtspTransport": "tcp",
"maxStreams": 2,
"vcodec": "copy",
"acodec": "libfdk_aac",
"audio": false
}
}
Thanks yet again for your help! Yes, that helped a bit, the Dafang camera now shows up in the UI, and sometimes it gets a still in HomeKit, but not video.
But now it is offline again in the UI as well, I think the problem might be the camera itself, it is quite old and very slow.
@bjornand1
try
{
"name": "CatCamUI",
"manufacturer": "Dafang",
"model": "CatCam",
"motion": true,
"unbridge": true,
"hsv": true,
"prebuffering": true,
"prebufferLength": 4,
"videoConfig": {
"source": "-i rtsp://192.168.1.50:8554/unicast",
"subSource": "-i rtsp://192.168.1.50:8554/unicast",
"stillImageSource": "-i rtsp://192.168.1.50:8554/unicast",
"rtspTransport": "tcp",
"maxStreams": 2,
"vcodec": "libx264",
"acodec": "libfdk_aac",
"audio": false
}
}
Hmm now I get this error message:
The plugin "homebridge-camera-ui" requires Node.js version of >=14.18.2 which does not satisfy the current Node.js version of v14.16.1. You may need to upgrade your installation of Node.js - see https://git.io/JTKEF
Hmm now I get this error message:
The plugin "homebridge-camera-ui" requires Node.js version of >=14.18.2 which does not satisfy the current Node.js version of v14.16.1. You may need to upgrade your installation of Node.js - see https://git.io/JTKEF
This can be ignored and its not a new "error"
OK, but I also see this:
CatCamUI: Videoanalysis timed out... killing ffmpeg session
OK, but I also see this:
CatCamUI: Videoanalysis timed out... killing ffmpeg session
can you post a screenshot from the cameras own settings pls (like fps, bitrate, resolution etc)
Does this help? Perhaps some settings here should be changed?
Does this help?
Does your stream has also a second/sub stream?
And use this settings (if possible)
Resolution: 1920x1080
FPS: 30
Keyframe Interval: 120 (Keyframe Interval = FPS x 4)
Bitrate: 2048 kbps (CBR)
OK, I changed the parameters as you suggested, but now I get this error message:
CatCamUI: FFmpeg prebuffer process exited with error! (null) - [mp3float @ 0x5638ef127300] Header missing - - [tee @ 0x5638ef164dc0] dimensions not set - Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument - -
Can you enable "debug" in your config.json pls, restart HB and post me the whole log from startup till error
Absolutely! I turned on debug mode, but where do I find the log?
[1/24/2022, 11:26:06 AM] [CameraUI] CatCamUI: Can not determine stream codecs, probe timed out [1/24/2022, 11:26:14 AM] [CameraUI] CatCamUI: FFmpeg prebuffer process exited with error! (null) - [mp3float @ 0x564dec3f9300] Header missing - - [tee @ 0x564dec437680] dimensions not set - Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument - - [1/24/2022, 11:26:22 AM] [CameraUI] CatCamUI: FFmpeg videoanalysis process exited with error! (null) - [mp3float @ 0x55922e91a300] Header missing - - Output file #0 does not contain any stream - [1/24/2022, 11:26:22 AM] [CameraUI] CatCamUI: FFmpeg videoanalysis process exited with error! (null) - [mp3float @ 0x55922e91a300] Header missing - - Output file #0 does not contain any stream - [1/24/2022, 11:26:22 AM] [CameraUI] CatCamUI: Restart videoanalysis session.. [1/24/2022, 11:26:27 AM] [Homebridge UI] Starting terminal session [1/24/2022, 11:26:30 AM] [CameraUI] CatCamUI: FFmpeg prebuffer process exited with error! (null) - [mp3float @ 0x55cb78437300] Header missing - - [tee @ 0x55cb784756c0] dimensions not set - Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument - - [1/24/2022, 11:26:30 AM] [CameraUI] CatCamUI: Prebufferring process closed [1/24/2022, 11:26:30 AM] [CameraUI] CatCamUI: Restart prebuffer session.. [1/24/2022, 11:26:34 AM] [CameraUI] CatCamUI: Videoanalysis scheduled for restart at 4AM: 993 minutes [1/24/2022, 11:26:39 AM] [CameraUI] CatCamUI: FFmpeg videoanalysis process exited with error! (null) - [mp3float @ 0x56156dd08300] Header missing - - Output file #0 does not contain any stream - [1/24/2022, 11:26:39 AM] [CameraUI] CatCamUI: FFmpeg videoanalysis process exited with error! (null) - [mp3float @ 0x56156dd08300] Header missing - - Output file #0 does not contain any stream - [1/24/2022, 11:26:39 AM] [CameraUI] CatCamUI: Restart videoanalysis session.. [CatCamUI 9BD7] The image snapshot handler for the given accessory is slow to respond! See https://git.io/JtMGR for more info. [1/24/2022, 11:26:46 AM] [CameraUI] CatCamUI: Failed to fetch snapshot. Showing "offline" image instead. [1/24/2022, 11:26:46 AM] [CameraUI] CatCamUI: [mp3float @ 0x560e7fc09300] Header missing - - Output file #0 does not contain any stream - [1/24/2022, 11:26:50 AM] [CameraUI] CatCamUI: Videoanalysis scheduled for restart at 4AM: 993 minutes [1/24/2022, 11:26:54 AM] [CameraUI] CatCamUI: FFmpeg prebuffer process exited with error! (null) - [mp3float @ 0x559b0cc99300] Header missing - - [tee @ 0x559b0ccd7700] dimensions not set - Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument - - [1/24/2022, 11:26:54 AM] [CameraUI] CatCamUI: Prebufferring process closed [1/24/2022, 11:26:54 AM] [CameraUI] CatCamUI: Restart prebuffer session..
These repeat after startup has finished
These repeat after startup has finished
can you open VLC pls and send me a screenshot from the media settings
VLC > Window > Media information
Hmm, I am on a Mac, but I do have VLC installed. Not sure how I can open camera stream there, though?
Hmm, I am on a Mac, but I do have VLC installed. Not sure how I can open camera stream there, though?
Sorry for late reply, was in a meeting. But now I get this:
I can still see the stream in the browser window, though.
Sorry for late reply, was in a meeting. But now I get this:
I can still see the stream in the browser window, though.
Stop homebridge and try again
So I restarted Homebridge, and now I don't get an error message in VLC. But there is no video showing in VLC, but I get this info:
So I restarted Homebridge, and now I don't get an error message in VLC. But there is no video showing in VLC, but I get this info:
Your stream is not a H264 stream, can you change it in your cameras own settings from mjpeg to H264? If not, you need to disable "prebuffering" in your config.json and set "vcodec" to "libx264"
Hmm, there are controls in the camera settings to start/stop the H264 RTSP and MJPEG RTSP streams, and I have tried starting the former and stopping the latter. That does not seem to help, so I turned off prebuffering and changed the vcodec setting, but with no success.
I am wondering if an issue could be safety certificate? Trying to access the camera though Chrome/Firefox, I partly get a safety warning and partly get asked a username/password (which are not required in Safari, where I can access it straight away)?
@bjornand1
if you disable prebuffering AND videoanalysis and set vcodec to „libx264“ there are still issues?
can you send me the log pls with prebuffering/videoanalysis disabled and vcodec = libx264
Sure, this message keeps repeating:
[1/24/2022, 4:03:50 PM] [CameraUI] CatCamUI: FFmpeg videoanalysis process exited with error! (null) - [tcp @ 0x560d4fd5f7c0] Connection to tcp://192.168.1.50:8554?timeout=0 failed: Connection refused - rtsp://192.168.1.50:8554/unicast: Connection refused - [1/24/2022, 4:03:50 PM] [CameraUI] CatCamUI: FFmpeg videoanalysis process exited with error! (null) - [tcp @ 0x560d4fd5f7c0] Connection to tcp://192.168.1.50:8554?timeout=0 failed: Connection refused - rtsp://192.168.1.50:8554/unicast: Connection refused -
Sure, this message keeps repeating:
[1/24/2022, 4:03:50 PM] [CameraUI] CatCamUI: FFmpeg videoanalysis process exited with error! (null) - [tcp @ 0x560d4fd5f7c0] Connection to tcp://192.168.1.50:8554?timeout=0 failed: Connection refused - rtsp://192.168.1.50:8554/unicast: Connection refused - [1/24/2022, 4:03:50 PM] [CameraUI] CatCamUI: FFmpeg videoanalysis process exited with error! (null) - [tcp @ 0x560d4fd5f7c0] Connection to tcp://192.168.1.50:8554?timeout=0 failed: Connection refused - rtsp://192.168.1.50:8554/unicast: Connection refused -
This has something to do with your camera or the camera source. FFmpeg can't connect to the camera source and that's why the errors occur.
Yes, I was starting to think so. Do you have any ideas how I could change things at the camera to make it work? It used to work with the Homebridge Camera FFmpeg plugin, before I started changing things to make it work under the Homebridge Camera Ui plugin?
I rebooted the camera and now I get a different error message:
CatCamUI: FFmpeg videoanalysis process exited with error! (null) - [mp3float @ 0x558821a46300] Header missing - - Output file #0 does not contain any stream -
Lets try something else, can you put a "video username" & "video password" and try the stream within VLC again with following source pls
Example video username: admin video password: admin
VLC source: rtsp://admin:admin@192.168.1.50:8554/unicast
Thanks, I will try that in the morning!
What do you know, that works, not the stream plays in VLC!
But now I see that this only works if I set the resolution to 1280X720, increasing it the stream fails. Here are the media information data:
But where must I add the username and password to allow access to the camera?
But now I see that this only works if I set the resolution to 1280X720, increasing it the stream fails. Here are the media information data:
But where must I add the username and password to allow access to the camera?
Just change the video source to
rtsp://admin:admin@192.168.1.50:8554/unicast
(Assuming username is admin and pw is also admin)
Ah, easy, but I still get this error:
[1/25/2022, 7:59:45 AM] [CameraUI] CatCamTest: Videoanalysis timed out... killing ffmpeg session
Followed by:
[1/25/2022, 8:00:40 AM] [CameraUI] CatCamTest: Videoanalysis timed out... killing ffmpeg session [1/25/2022, 8:00:40 AM] [CameraUI] CatCamTest: FFmpeg videoanalysis process exited with error! (SIGKILL) - [mp3float @ 0x562ef985b380] Header missing - [1/25/2022, 8:00:40 AM] [CameraUI] CatCamTest: FFmpeg videoanalysis process exited with error! (SIGKILL) - [mp3float @ 0x562ef985b380] Header missing -
OK, something happening. In the UI dashboard, I now see at least a still image from the camera! It also detects motion, but it times out trying to stream, and it shows as No response in the Home app.
And furthermore, now and then I can actually get the stream to work in the UI dashboard! But it seems a bit unstable, it can easily be interrupted. In HomeKit, however, there is always the No response message.
Perhaps some settings could be reduced in order to not put such a strain on the clearly limited capacity of this camera?
Rebooting the camera again, it seems I can get it to work now and then. It seems the problem is the camera's performance itself.
Rebooting the camera again, it seems I can get it to work now and then. It seems the problem is the camera's performance itself.
Yeah i think so too, you can disable prebuffering and videoanalysis to avoid additional load
Hi, hope someone can help: I have been connecting two non-HomeKit cameras (Dafang and KingCam) through the Homebridge Camera FFmpeg plugin, and that has been working well. Wanting to get HomeKit Secure Video supported for these camera, I have now disabled that plugin and installed the homebridge-camera-ui plugin. I have used the same parameters in the config and I can now see the cameras in the camera.ui interface.
However, the cameras do not appear in HomeKit, and I see no obvious reason for this. Any ideas?