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

ERROR: FFmpeg exited with code 1 #53

Closed
sullyhome opened this issue Jun 30, 2020 · 26 comments
Closed

ERROR: FFmpeg exited with code 1 #53

sullyhome opened this issue Jun 30, 2020 · 26 comments

Comments

@sullyhome
Copy link

sullyhome commented Jun 30, 2020

I see there is a "closed" issue on this but I am unable to get this to work . This is a fresh install. Within the home app I get "no response" from the cameras. In the log file I get "ERROR: FFmpeg exited with code 1". Have tried the couple configs in the closed issue with no success.

This is connecting to the newest Unifi NVR. G3 Bullet and G3 Flex Cameras. homebridge-camera-ffmpeg and homebridge-unifi-protect2 both work for me.

Config file:

{
"bridge": {
"name": "Homebridge BED1",
"username": "0E:60:72:0F:BE:D1",
"port": 51653,
"pin": "664-83-642"
},
"accessories": [],
"platforms": [
{
"name": "Config",
"port": 8581,
"platform": "config"
},
{
"name": "Unifi protect cameras & motion sensors",
"unifi": {
"enhanced_classes": [],
"controller": "https://192.168.1.172",
"controller_rtsp": "https://192.168.1.172:7447",
"username": "xxx",
"password": "xxx",
"motion_interval": 5000,
"motion_repeat_interval": 30000,
"motion_score": 50,
"enhanced_motion": true,
"enhanced_motion_score": 50,
"save_snapshot": false,
"debug": false
},
"googlePhotos": {
"upload_gphotos": false,
"auth_redirectUrl": "http://localhost:8080/oauth2-callback"
},
"videoConfig": {
"maxStreams": 2,
"maxWidth": 1024,
"maxHeight": 576,
"maxFPS": 15,
"maxBitrate": 3000,
"vcodec": "libx264",
"packetSize": 376,
"audio": false,
"additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp"
},
"platform": "UnifiProtectMotion"
}
]
}

@sullyhome sullyhome reopened this Jun 30, 2020
@beele
Copy link
Owner

beele commented Jul 1, 2020

Can you try with the beta build?
sudo npm i -g --unsafe-perm=true [email protected]
And please check the adjusted readme on this branch for config changes: https://github.com/beele/homebridge-unifi-protect-camera-motion/tree/feature/rework-camera-and-tfjs

@beele
Copy link
Owner

beele commented Jul 1, 2020

I've tested this build with both my rbpi3 on buster macosx catalina and a linux mint vm (which needs g++ to be installed)

@sullyhome
Copy link
Author

Can you try with the beta build?
sudo npm i -g --unsafe-perm=true [email protected]
And please check the adjusted readme on this branch for config changes: https://github.com/beele/homebridge-unifi-protect-camera-motion/tree/feature/rework-camera-and-tfjs

Yep will try later today and report back.

@sullyhome
Copy link
Author

Can you try with the beta build?
sudo npm i -g --unsafe-perm=true [email protected]
And please check the adjusted readme on this branch for config changes: https://github.com/beele/homebridge-unifi-protect-camera-motion/tree/feature/rework-camera-and-tfjs

No luck with the beta build. All the cameras still show "no response". I do like that it adds all the cameras at once though that is nice.

@beele
Copy link
Owner

beele commented Jul 1, 2020

any reason you are using libx264 for vcodec instead of h264 (or h264_omx on rbpi)?

@sullyhome
Copy link
Author

any reason you are using libx264 for vcodec instead of h264 (or h264_omx on rbpi)?

copied it out of the wiki. I changed to h264 with the beta to match the new wiki config. Also tried copy with no luck.

@beele
Copy link
Owner

beele commented Jul 1, 2020

Hmm ok, strange FFmpeg can be tricky to get working correctly on various setups.
What OS/node/homebridge versions are you running?

@sullyhome
Copy link
Author

sullyhome commented Jul 1, 2020

Hmm ok, strange FFmpeg can be tricky to get working correctly on various setups.
What OS/node/homebridge versions are you running?

Buster, Node v12.18.1, Homebridge v1.1.1

@beele
Copy link
Owner

beele commented Jul 1, 2020

Ok, are you running on a rbpi?

@sullyhome
Copy link
Author

Ok, are you running on a rbpi?

yes. Pi 4

@beele
Copy link
Owner

beele commented Jul 1, 2020

Ok, I have the same setup so we should be able to get this working.
If you install the latest version of homebridge-camera-ffmpeg (v2.x.x) does that work (and if so with what config)?

@sullyhome
Copy link
Author

Ok, I have the same setup so we should be able to get this working.
If you install the latest version of homebridge-camera-ffmpeg (v2.x.x) does that work (and if so with what config)?

It does work with homebridge-camera-ffmpeg albeit the camera is slow. That was with whatever the default configuration settings were. It works flawlessly with homebridge-unifi-protect2 (again with the default config settings). My current setup was a fresh install of everything so I could just focus on this software so those are not installed currently.

The only difference I can tell from our setup is that I am using UniFi Protect Network Video Recorder.

@beele
Copy link
Owner

beele commented Jul 2, 2020

Do the snapshots work in the home app? (is they do ffmpeg should be working and it is the stream settings that are messed up, if not ffmpeg is not working correctly)

@sullyhome
Copy link
Author

Do the snapshots work in the home app? (is they do ffmpeg should be working and it is the stream settings that are messed up, if not ffmpeg is not working correctly)

They don’t work for this package (do for the other two). How would you recommend I troubleshoot??

@beele
Copy link
Owner

beele commented Jul 2, 2020

Can you try with the latest beta, it has an updated ffmpeg dependency that now will correctly print debug info
sudo npm i -g --unsafe-perm=true [email protected]
Make sure to start homebridge with the -D option to enable the debug logging.
Please post the output from the console when starting a stream

@sullyhome
Copy link
Author

sudo npm i -g --unsafe-perm=true [email protected]

[7/2/2020, 8:26:54 AM] [Unifi protect cameras & motion sensors] Starting video stream (1280x720, 15 fps, 299 kbps, 1378 mtu)...
[7/2/2020, 8:26:54 AM] [Unifi protect cameras & motion sensors] FFMPEG: received first frame
[7/2/2020, 8:27:09 AM] [Unifi protect cameras & motion sensors] Snapshot from UVC G3 - 5 at 480:270
[7/2/2020, 8:27:09 AM] [Unifi protect cameras & motion sensors] Snapshot from Test camera at 480:270
[7/2/2020, 8:27:09 AM] [Unifi protect cameras & motion sensors] Snapshot from UVC G3 - 3 at 480:270
[7/2/2020, 8:27:09 AM] [Unifi protect cameras & motion sensors] Snapshot from UVC G3 - 1 at 480:270
[7/2/2020, 8:27:10 AM] [Unifi protect cameras & motion sensors] Snapshot from UVC G3 - 4 at 480:270
[7/2/2020, 8:27:10 AM] [Unifi protect cameras & motion sensors] Snapshot from Bad camera at 480:270
[7/2/2020, 8:27:10 AM] [Unifi protect cameras & motion sensors] Snapshot from UVC G3 - 2 at 480:270
[7/2/2020, 8:27:10 AM] [Unifi protect cameras & motion sensors] Stopped streaming session!
[7/2/2020, 8:27:10 AM] [Unifi protect cameras & motion sensors] [FFMPEG] ffmpeg exited with code: null and signal: SIGKILL (FFMPEG Stream stopped!)

@sullyhome
Copy link
Author

Does the fact that I have the microphone disabled on the cameras make a difference?

@DerrickGibbs1
Copy link

Try renaming your camera. This appears to be related to homebridge-plugins/homebridge-camera-ffmpeg#579 and homebridge-plugins/homebridge-camera-ffmpeg#554

@sullyhome
Copy link
Author

Try renaming your camera. This appears to be related to homebridge-plugins/homebridge-camera-ffmpeg#579 and homebridge-plugins/homebridge-camera-ffmpeg#554

No luck still. It recognized the camera name changes but homekit but cameras still show "no response" and log file says the same as above.

@heccoder
Copy link

heccoder commented Jul 7, 2020

@sullyhome did you find a solution? I’m having the same exact issue.

@sullyhome
Copy link
Author

@sullyhome did you find a solution? I’m having the same exact issue.

Unfortunately I did not. I rebuilt everything fresh again to try and still no luck.

@beele
Copy link
Owner

beele commented Jul 23, 2020

Could you try with the latest beta: [email protected]
This latest beta version contains an updated homebridge-camera-ffmpeg with lots of fixes for strange ffmpeg behaviour

@sullyhome
Copy link
Author

Could you try with the latest beta: [email protected]
This latest beta version contains an updated homebridge-camera-ffmpeg with lots of fixes for strange ffmpeg behaviour

Appears perhaps there is a different bug reading the cameras? Getting the following in the logs....

[7/23/2020, 6:38:36 PM] [Unifi protect cameras & motion sensors] Cameras retrieved, enumerating motion sensors
[7/23/2020, 6:38:36 PM] [Unifi protect cameras & motion sensors] Adding 3c0bfd6f-c973-4563-8544-4a713c4daa59
[7/23/2020, 6:38:36 PM] [Unifi protect cameras & motion sensors] Configuring accessory Cam1
(node:974) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'Switch' of undefined
at Function.setupMotionSensor (/usr/lib/node_modules/homebridge-unifi-protect-camera-motion/src/characteristics/unifi-camera-motion-sensor.js:19:49)
at UnifiProtectMotionPlatform.configureAccessory (/usr/lib/node_modules/homebridge-unifi-protect-camera-motion/src/unifi-protect-motion-platform.js:102:62)
at /usr/lib/node_modules/homebridge-unifi-protect-camera-motion/src/unifi-protect-motion-platform.js:71:26
at Array.forEach ()
at UnifiProtectMotionPlatform.didFinishLaunching (/usr/lib/node_modules/homebridge-unifi-protect-camera-motion/src/unifi-protect-motion-platform.js:55:21)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Timeout._onTimeout (/usr/lib/node_modules/homebridge-unifi-protect-camera-motion/src/unifi-protect-motion-platform.js:34:17)
(Use node --trace-warnings ... to show where the warning was created)
(node:974) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:974) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@beele
Copy link
Owner

beele commented Jul 25, 2020

[email protected] should fix this (on my local machine this error does not occur because I have homebridge as a dev dependency)

@sullyhome
Copy link
Author

[email protected] should fix this (on my local machine this error does not occur because I have homebridge as a dev dependency)

The issue above with populating the cameras is fixed but sadly still no video feeds.

@beele
Copy link
Owner

beele commented Aug 2, 2020

Please refer to: #62

@beele beele closed this as completed Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants