-
-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snapshots working but not live video #711
Comments
Your config looks fine, and it looks like the plugin is at least trying to stream. Do you have multiple network interfaces on whatever you are running Homebridge on by any chance? |
Just noticed you are using Docker, you almost certainly will need to set |
Thanks for the kind response. I believe that there is only one interface and IP assigned to the docker in question.
I'm not sure if there is a way to interrogate the network configuration from within the docker because all my usual tools from when I used to be a sysadmin 15+ years ago (ifconfig, netstat, ip, etc) are missing. Thanks, |
Yea, the fact that copy works is quite a stumper. I’m honestly not too familiar with Docker myself. I had planned to set one up and do some testing, but the tropical storm knocked my power out and the news says it is likely to be several days before it’s back... |
While I don’t know much about Docker yet, I do know that the Ring and Nest Cam plugins specifically skip over interfaces starting with ‘br’ which implies that interface is the wrong one to use? dgreif/ring@15d2ace#diff-cd6e197575f6b29fbd71877ac8a01848 I’m still at a loss to why the copy vcodec works in that scenario though, as logically it should be working with the same interface either way. |
So I have managed to get my head around dockers and done a bit of digging.
All pretty standard stuff. |
Interesting, I’ve spoken to him a bunch lately, and the only major difference I’m aware of is his method of choosing which NIC to use, which should be irrelevant when you’re specifying interfaceName. Once I have power back I’ll see about tossing his logic into a beta version of this plugin, just to see if that makes any difference. |
Now I am definitely receiving the packets to the end client for both the copied and transcoded streams. I'm starting to think that the docker interface issue is a red herring. It may be the case that my original tcpdump was broken given that I was capturing between two virtual systems using a third virtual system all on the one physical NIC. Hmmm... HomeKit just can't seem to interpret a transcoded stream... Working (-vcodec copy):
Broken (-vcodec libx264):
I can't see anything different between the two commands beyond the obvious. |
The weird thing is that transcoding typically makes things more compatible. I’ve seen more than a few cases where the camera is sending h264, but HomeKit won’t handle it until it’s been transcoded. Basically you understand correctly, HomeKit asks for the stream to be sent to an IP and port for both video and audio, but ignores the stream if it doesn’t come from the same IP address that it asked. That’s the issue we see a lot with a device with multiple NICs. I can’t think of a real way to push to VLC like that, but even if you got that set up, VLC would almost certainly be a lot less picky than HomeKit. For what it’s worth, I asked around to a few other developers to see if they had any ideas for this issue. Their best guess was that perhaps your Docker container wasn’t given enough CPU resources. I still need to play with Docker more myself, because I don’t currently have too much understanding of it. |
Not a CPU issue, my Docker has 4 cores on an AMD 3950x so a bit spoilt for CPU cycles. :) As you can see below, the transcode speed is always well above 1.0x
I'll try setting up a brand new HomeBridge on a different platform and see if I can get it to work there. If so then I can try debugging between the two platforms to see what the difference could be. I should get a chance on my days off later this week. |
Of course it isn’t, that would have made it too easy. x.x Your most recent log shows something interesting though. The transcode speed seems decently high, but you’re getting around 50% duplicate frames, which is something I’ve seen on slow systems, but could be network or other things too. I’m not the biggest expert on FFmpeg, because it is just a huge project, but my recollection is that is often seen when it can’t keep up with decoding the input. I don’t believe I was seeing dupe frame counts nearly that high in your earlier logs though, has anything changed? |
Hmmm, not sure about the dup frame issue. I have been playing around with frame rate and maybe that was from a run where I was discarding frames for a frame rate lower than 30. I always see a small amount of dup frames as in the run below. It could also be that the camera is just sending dup frames as there was no movement in the frame.
|
Try adding |
This shifted the stream between the camera and the HomeBridge to use TCP but didn't result in any change. Understandably the stream between HomeBridge and the end client is still UDP. |
I'll check his code again tomorrow, but as far as I'm aware, we should be doing basically the same encoding. |
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. |
Realize this is stale, but I've solved my own problem after hours of researching. Had to change my source stream from Turns out it was the source stream all along. |
Great, glad you got it working. |
Hi Justin, "source": "-rtsp_transport tcp -i rtsp://x:[email protected]:554/h264Preview_01_sub", |
Describe The Problem:
I'm trying to setup a bunch of Reolink cameras into HomeKit and I'm unable to get live video working to any end device.
The snapshot function works fine.
If I try to access the video feed then it just times out after 30 seconds with the message;
"No Response This camera is not responding."
If I add the command "vcodec": "copy" to the config then it does work.
I've had a quick look with tcpdump and unless I add "vcodec": "copy" then no data stream flows from the homebridge docker to my Mac.
Something about FFmpeg running breaks the operation.
The issue is, that the camera is dumping an uncompressed h264 stream which chews about 7Mb/sec so being able to manipulate the frame rate, resolution, and compression would be valuable.
Any advice would be greatly appreciated. Thanks,
To Reproduce:
Logs:
ffprobe shows the following information about the camera stream;
Homebridge Logs:
Homebridge Config:
Environment:
The text was updated successfully, but these errors were encountered: