Skip to content
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

Streaming not working via homebridge, but can connect with VLC #661

Closed
jkempinger opened this issue Jul 16, 2020 · 6 comments
Closed

Streaming not working via homebridge, but can connect with VLC #661

jkempinger opened this issue Jul 16, 2020 · 6 comments
Labels

Comments

@jkempinger
Copy link

I'm not sure if this is related to #584 or #554, but I am running 2.3.0 and seeing these issues.

Describe The Bug:

Snapshots work fine, but when I open a camera to see the video stream in HomeKit, it eventually times out and I see these in the homebridge logs:

homebridge[1032711]: [7/16/2020, 12:44:20 AM] [Camera-ffmpeg] Starting Front Door video stream (1280x720, 23 fps, 299 kbps, 1316 mtu)...
homebridge[1032711]: [7/16/2020, 12:44:20 AM] [Camera-ffmpeg] FFMPEG: received first frame
homebridge[1032711]: [7/16/2020, 12:44:50 AM] [Camera-ffmpeg] Stopped Front Door video stream!
homebridge[1032711]: [7/16/2020, 12:44:50 AM] [Camera-ffmpeg] [FFMPEG] ffmpeg exited with code: null and signal: SIGKILL (FFMPEG Stream stopped!)

I can successfully connect to the RTSP stream with VLC using the same URL as in my homebridge config.

I have two Foscam C1 cameras and I am able to reproduce this with both of them.

Homebridge Config:

{
    "platform": "Camera-ffmpeg",
    "cameras": [
    {
        "name": "Front Door",
        "motion": true,
        "debug": true,
        "videoConfig": {
        "source": "-re -i rtsp://username:[email protected]:554/videoMain",
        "stillImageSource": "-i http://10.0.0.220:88//cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=username&pwd=password",
        "maxStreams": 2,
        "maxWidth": 1280,
        "maxHeight": 720,
        "maxFPS": 23
    }
}

Environment:

  • Node.js Version: v12.18.2
  • NPM Version: 6.14.6
  • Homebridge Version: 1.1.1
  • Homebridge Camera FFmpeg Version: 2.3.0
  • Operating System: Debian 11
@jkempinger jkempinger added the bug label Jul 16, 2020
@Sunoo
Copy link
Collaborator

Sunoo commented Jul 16, 2020

Is this a new configuration that never worked, or is this something that worked in the past and broke in an upgrade? Does whatever computer you're running this on have multiple network interfaces?

By the way the debug config option needs to be under the 'videoConfig' section in order to take effect. Also, please do not use '-re' in your source, it can only cause problems (though not the problem you're seeing).

Can you upgrade to v2.3.1 which has some updates to logging, make the change to enable debug, and post your new logs?

{
    "platform": "Camera-ffmpeg",
    "cameras": [
    {
        "name": "Front Door",
        "motion": true,
        "videoConfig": {
        "source": "-i rtsp://username:[email protected]:554/videoMain",
        "stillImageSource": "-i http://10.0.0.220:88//cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=username&pwd=password",
        "maxStreams": 2,
        "maxWidth": 1280,
        "maxHeight": 720,
        "maxFPS": 23,
        "debug": true
    }
}

@jkempinger
Copy link
Author

This is a new configuration, and I haven't seen streaming working yet. There's only one physical network interface on the server running homebridge. I do have a docker bridge, but it's not currently up.

I removed "-re" (didn't know that option causes issues, thanks for the info!), moved debug, and updated to 2.3.1. When I tap on the camera it actually connects now! But then freezes. Home lists the camera as live, but the image never changes (including the seconds in the timestamp).

Here are the homebridge logs, from right before I tapped on the camera to right after I closed the app:
streaming.log

I also took a screenshot of the streaming info from VLC:
stream_info

The only difference that stood out was the frame rate. I'm fairly certain this camera only supports 23 fps or lower. I tried setting maxFPS to 29.97, but that didn't make any difference.

@Sunoo
Copy link
Collaborator

Sunoo commented Jul 17, 2020

I took a look at your logs, and FFmpeg is reporting getting a large number of duplicate frames from your camera. Odd that FFmpeg would get that if VLC is playing the stream fine though.

The MaxFPS setting shouldn’t cause any problems, since as far as FFmpeg sees, your camera just keeps sending the same image over and over.

@Sunoo
Copy link
Collaborator

Sunoo commented Jul 17, 2020

I took a look, and found an older issue on another plugin, same camera, apparently same problem, no resolution. luisiam/homebridge-foscamcamera#64 (comment) Kinda sounds like it could be a bug with the camera?

After some further digging, I came across a bunch of threads on Foscam’s official forums with angry C1 owners, and no solution mentioned. The moderator there was actually advising people to return their cameras.

So yea, seems pretty clear that unfortunately the Foscam C1 has a broken RTSP server, so there isn’t much I can do. :/

@Sunoo Sunoo closed this as completed Jul 17, 2020
@jkempinger
Copy link
Author

It's odd that it works with VLC, though I've loaded some videos through VLC that no other client could handle, so it wouldn't surprise me if ffmpeg is not able to handle a malformed RTSP stream but VLC is.

Thank you for looking into it!

@Sunoo
Copy link
Collaborator

Sunoo commented Jul 17, 2020

Weirdly the reports I was seeing said VLC had sporadic issues as well. I don’t remember if VLC has the ability to serve video, but perhaps something could be kludged together with that if it can (and if it plays the stream consistently).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants