Sunoo / homebridge-camera-ffmpeg

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

[FFMPEG] ffmpeg exited with code: 1 and signal: null (error) #603

Closed roomwillow closed 4 years ago

roomwillow commented 4 years ago

Describe Your Problem: Camera appears in home app, however, no thumbnail loads, selecting the camera leads to infinite loading and an error on the homebridge log, was following previously closed issue however updating to the beta and re-naming the camera to something new from a completely cleared config did nothing to help.

image

Homebridge Config:

image

Environment:

Vampier commented 4 years ago

I am observing the same behavior here - but no error message shows up. When a camera can not be found for whatever reason and the homekit screen is requesting a screenshot ffmpeg seems to be stuck, it slows down the rest of the detection - example TP-Link switching and outlets keep the status 'updating'. After removing the offending camera from the config it runs fine (I could have fixed it easily but I was curious what caused the 'updating' issue)

Thanks for the great plugin - since the implementation for the camera to show up straight into the homebridge connected devices it's even easier to setup :)

ps the slow down doesn't occur when requesting status changed through Siri.

isramos commented 4 years ago

When I had a similar issue, I pasted the FFmpeg command with all parameters in my terminal and I was able to pinpoint the issue. There's a bug in the current version that is suppressing the parameter listing. I just pushed a PR #607 that fixes the logs so that you'll be able to get the parameters. After that update you'll be able to see parameters, such as:

[7/5/2020, 10:02:42 PM] [Camera-ffmpeg] FFMPEG command: ffmpeg -rtsp_transport tcp -re -i rtsp://admin:xxxxx@192.168.1.123:1025/H264?ch=1&subtype=0 -map 0:0 -vcodec copy -pix_fmt yuv420p -r 30 -f rawvideo -preset ultrafast -tune zerolatency -benchmark -b:v 299k -bufsize 598k -maxrate 299k -payload_type 99 -ssrc 13742952 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params QrDbTPtXQrDbTPtXQrDbTPtX srtp://192.168.1.99:63402?rtcpport=63402&localrtcpport=63402&pkt_size=1316 -loglevel debug

Then, just the above info in terminal to get a more verbose error. I believe you should remove the parameters after the -f as that is the output section, and instead, for testing, just use -f null -, as seen here https://trac.ffmpeg.org/wiki/Null.

donavanbecker commented 4 years ago

607

houser42 commented 4 years ago

Hello, I am seeing the same thing. [Camera ffmpeg] [2] [info] frame= 586 fps= 21 q=39.0 size= 1143kB time=00:00:29.58 bitrate= 316.5kbits/s dup=1 drop=0 speed=1.05x [7/26/2020, 5:53:02 PM] [Camera ffmpeg] [2] Stopped video stream. [7/26/2020, 5:53:02 PM] [Camera ffmpeg] [2] ffmpeg exited with code: null and signal: SIGKILL (Expected) Am I correct in understanding this is a bug that will get worked out at some point? or is there a workaround or fix? Many thanks.

Sunoo commented 4 years ago

@houser42 I don't see an error in your log? That's just FFmpeg being closed when you stop viewing the stream.

houser42 commented 4 years ago

Thanks @Sunoo I see. Sorry for being unclear. I misread the log and assumed that was the error, as my cameras no longer go to live stream when tapped in the home app. I still get the stills but no streaming. This is on Ubuntu Focal Fossa (20.04.1 LTS).

I believe this happened with one of the last updates of the ffmpeg plugin, or possibly the ol' sudo apt update or something else that broke some dependancy or something. Was rather hoping there was a new plugin fix on the way. But life is sometimes not that easy ;) Probably time to wipe and reinstall I guess... Many thanks.

Sunoo commented 4 years ago

@houser42 Do you have multiple network interfaces?

houser42 commented 4 years ago

If you by "multiple network interfaces" mean there is a mixture ethernet and wifi on the Lan then yes. But this has been rock solid for year and I have lately not touched anything but the typical service updates for all things HB. Are you suspecting something? Thanks. Appreciate it..

Sunoo commented 4 years ago

@houser42 In that scenario, it’s basically just random chance if FFmpeg ends up using the correct interface. If you set interfaceName, that should prevent the issue from happening.

houser42 commented 4 years ago

Thanks @Sunoo, If that matters, the laptop that runs HB is ethernet only, as is the Apple TV that is the Homehub. But never tried that... Where do I set that? In config.json for this plugin? Really appreciate the tip!

Sunoo commented 4 years ago

@houser42 Yes, it would be in the config.json, there is an example on the main page.

However, if the device Homebridge is running on has a single active interface, that’s probably not your problem.

houser42 commented 4 years ago

Thanks again @Sunoo,

It seems your advice was correct. I added the network interface of the HB server in json.config and it started working again. Never needed that before. At the the very least, that certainly reset something.. Regardless, many, many thanks!

Sunoo commented 4 years ago

Great, glad we got it working.

houser42 commented 4 years ago

Not as glad as I am ;) Thanks again!

IoTPlay commented 3 years ago

Same problem, @Sunoo Can yougive more instructions to your statement to a "rukee"?

I added the network interface of the HB server in json.config
Sunoo commented 3 years ago

@IoTPlay Current versions of this plugin on current versions of Homebridge no longer have this issue.

carismatico78 commented 3 years ago

I am still having the issue.
[11/18/2020, 12:16:43 PM] [Camera FFmpeg] [DrivewayCam] Starting video stream: 1280 x 720, 30 fps, 299 kbps [11/18/2020, 12:16:43 PM] [Camera FFmpeg] [DrivewayCam] FFmpeg exited with code: 1 and signal: null (Error) [11/18/2020, 12:16:43 PM] [Camera FFmpeg] [DrivewayCam] Stopped video stream.

nossramo commented 3 years ago

I got this working! "-i rtsp://admin:pass@192.168.1.108/cam/realmonitor?channel=1&subtype=0" Problem is i was always using my external IP but after adding internal it worked and works ower 4G on HomeKit

IoTPlay commented 3 years ago

Thank you.

On Sat, 7 Nov 2020 at 16:38, David Maher notifications@github.com wrote:

@IoTPlay https://github.com/IoTPlay Current versions of this plugin on current versions of Homebridge no longer have this issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Sunoo/homebridge-camera-ffmpeg/issues/603#issuecomment-723453839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHDTT5GRMQ3CYST5B64NAHDSOVLW5ANCNFSM4OQ2FFKA .

jamesngob commented 3 years ago

I have HIKVision NVR with 5 camera on it. My ffmpeg plugin has been working so far so good until a day ago. It now displayed the error "FFmpeg exited with code: 1 and signal: null (Error)." I have not altered or changed anything in the setup since over 2 months ago (e.g. the plugin was working fine for the past 2 months) My homebridge is installed on Ubuntu Server. The homebridge server version is 1.1.7; Node js v14.15.3 What I did: -I also use internal IP address; I specified the InterfaceName as well. All did not work -Uninstall/Reinstall the FFmpeg -Clean all cache I still cannot get it to work! What am I missing here?

jamesngob commented 3 years ago

I have HIKVision NVR with 5 camera on it. My ffmpeg plugin has been working so far so good until a day ago. It now displayed the error "FFmpeg exited with code: 1 and signal: null (Error)." I have not altered or changed anything in the setup since over 2 months ago (e.g. the plugin was working fine for the past 2 months) My homebridge is installed on Ubuntu Server. The homebridge server version is 1.1.7; Node js v14.15.3 What I did: -I also use internal IP address; I specified the InterfaceName as well. All did not work -Uninstall/Reinstall the FFmpeg -Clean all cache I still cannot get it to work! What am I missing here?

I decided to restart the NVR and it worked again! Not sure what happened with it...

1aranzant commented 2 years ago

I have the same issue with my new TAPO c320 camera. My others cameras work fine.

albilia commented 2 years ago

This also happened to me after I updated the HomeBridge from version 14 to version 16 and had to install all plugins from scratch, with Hikvision Cam model: DS-2CD2542FWD-I.

The previous Config were:

{ "name": "Hikvision", "model": "DS-2CD2542FWD-I", "serialNumber": "DS-2CD2542FWD-#########", "firmwareRevision": "V5.5.5 build 180111", "unbridge": false, "videoConfig": { "source": "-i rtsp://:@192.168.10.10:554", "maxStreams": 2, "maxWidth": 800, "maxHeight": 600, "maxFPS": 25, "audio": true } }

The latest and working Config After noticing that I used a different model's setting by mistake [Hikvision DS-2CD2423G0-IW]:

{ "name": "Hikvision", "videoConfig": { "source": "-i rtsp://:@192.168.10.10:554" } }

Thanks to developer @Sunoo for mentioning the matter here: "If maxWidth or maxHeight is set for more than 800 and 600 respectively or not set at all, the camera does not show the live view". In my case the mistake I made did result in me not being able to see Live View. For the reason that I entered the maxWidth and maxHeight values unnecessarily. https://sunoo.github.io/homebridge-camera-ffmpeg/configs/Hikvision-DS-2CD2423G0-IW.html Now All Good : )

Ogdla commented 1 year ago

Hello
I have the same issue on my D-link DCS-930LB that not support rtsp ( working only on http) .The motion detection of that camera working fine but i have this error message

[06/05/2023, 13:15:01] [Camera FFmpeg] [Og eyes] Starting video stream: 320 x 240, 20 fps, 299 kbps (AAC-eld) [06/05/2023, 13:15:01] [Camera FFmpeg] [Og eyes] FFmpeg exited with code: 1 and signal: null (Error) [06/05/2023, 13:15:01] [Camera FFmpeg] [Og eyes] Stopped video stream. [06/05/2023, 13:15:08] [Camera FFmpeg] [Og eyes] Failed to fetch snapshot. [Og eyes] Snapshot request handler provided empty image buffer! [06/05/2023, 13:15:18] [Camera FFmpeg] [Og eyes] Failed to fetch snapshot. [Og eyes] Snapshot request handler provided empty image buffer! [06/05/2023, 13:15:39] [Camera FFmpeg] [Og eyes] Failed to fetch snapshot. [Og eyes] Snapshot request handler provided empty image buffer! [06/05/2023, 13:29:43] [Camera FFmpeg] [Og eyes] Failed to fetch snapshot. [Og eyes] Snapshot request handler provided empty image buffer! [06/05/2023, 13:43:08] [Camera FFmpeg] [Og eyes] Failed to fetch snapshot. [Og eyes] Snapshot request handler provided empty image buffer! [06/05/2023, 13:43:18] [Camera FFmpeg] [Og eyes] Failed to fetch snapshot. [Og eyes] Snapshot request handler provided empty image buffer! [06/05/2023, 13:43:33] [Camera FFmpeg] [Og eyes] Starting video stream: 320 x 240, 20 fps, 299 kbps (AAC-eld) [06/05/2023, 13:43:33] [Camera FFmpeg] [Og eyes] FFmpeg exited with code: 1 and signal: null (Error) [06/05/2023, 13:43:33] [Camera FFmpeg] [Og eyes] Stopped video stream. Thks for your help

   {
        "name": "Camera FFmpeg",
        "cameras": [
            {
                "name": "Og eyes",
                "manufacturer": "D-link",
                "model": "DSC-930LB",
                "motion": true,
                "videoConfig": {
                    "source": "-re  -f mjpeg -i http://user:pwd@192.168.1.20:80/video.cgi",
                    "stillImageSource": "-f mjpeg -i http://user:pwd@192.168.1.20:80/image.jpg",
                    "maxStreams": 2,
                    "maxWidth": 640,
                    "maxHeight": 480,
                    "maxFPS": 20,
                    "vcodec": "h264_omx",
                    "packetSize": 1128,
                    "audio": true
                }
            }
        ],
        "platform": "Camera-ffmpeg"
    }
]

}

Sunoo commented 1 year ago

Share your full debug log.

Ogdla commented 1 year ago

Please see my previous post On VLC I can reach my cam using the http://user:passwd@192.168.1.20:80/video.cgi

Ogdla commented 1 year ago

@sunoo I have images on ma iPhone now and it freezes but steel have that error ;and i remark that every 10s the image move for a laps of second .

rd-pong commented 1 year ago

Same issue here

@Sunoo I have images on ma iPhone now and it freezes but steel have that error ;and i remark that every 10s the image move for a laps of second .

elvisimprsntr commented 10 months ago

BACKGROUND

Dec '22 - HB installed on a Ubuntu server VM (Shutdown) Feb '23 - Migrated HB to a Ubuntu bare metal MeLE Quieter3C (Celeron N5105) (Shutdown) Now - Migrated HB to a re-purposed Mac Mini (Core 2 Duo P8600) (Restored from backup)

ISSUES

  1. When I restored from backup, although all the plugins installed, I had to manually install FFMPEG. (Solved)
  2. Now I get the following error message on all my cameras. (Unsolved)

    [Porch] FFmpeg exited with code: 1 and signal: null (Error)

CAM CONFIG EXAMPLE

Note there is no separate snapshot URL defined.

{ "name": "Porch", "manufacturer": "Lorex", "model": "B451AJ", "serialNumber": "[redacted]", "firmwareRevision": "20220903", "motion": true, "doorbell": true, "switches": true, "videoConfig": { "source": "-i rtsp://[redacted]:[redacted]@192.168.69.85:554/cam/realmonitor?channel=1&subtype=1", "audio": true }

OBSERVATIONS

  1. HB/HK fetches the snapshots without a problem.
  2. When I attempt to launch the live video, FFMPEG throws the error listed above.

TROUBLE SHOOTING

  1. Rebooted all my ATVs and HomePod mini
  2. Bound HB to a WLAN interface.
  3. Turned off the Mac Mini and restarted the MeLE Quieter3C (Live video stream working)

QUESTIONS

I have not altered the default FFMPEG video codec "libx264", which I believe is a SW encoder.

  1. Is the 2010 Mac mini too underpowered and/or does not support H264 HW accelerated video encoding?
  2. Or can I simply switch to a different encoder?