homebridge-dafang icon indicating copy to clipboard operation
homebridge-dafang copied to clipboard

[BUG] - ERROR: FFmpeg exited with code 1

Open btutal opened this issue 4 years ago • 10 comments

I've an Raspberry Pi 3 B+that hosts Homebridge and installed plugin on it. Whenver I try to use livestream from Home app, it doesn't work and I get the message [Dafang] ERROR: FFmpeg exited with code 1 in the logs.

When I try to check the stream from another machine, it works just fine from VLC on Mac. You can see part of my configs below:

"cameraName": "Xiaomi Dafang",
                    "cameraRTSPStreamUrl": "rtsp://USERNAME:[email protected]:8554/unicast",
                    "videoConfig": {
                        "source": "-rtsp_transport tcp -i rtsp://USERNAME:[email protected]:8554/unicast",
                        "stillImageSource": "-rtsp_transport http -i rtsp://USERNAME:[email protected]:8554/unicast -vframes 1 -r 1",
                        "maxStreams": 5,
                        "maxWidth": 1280,
                        "maxHeight": 720,
                        "maxFPS": 25,
                        "debug": true,
                        "audio": true
                    },

In addition, I have two more cameras which has Motioneyeos and Motioneye server running on same Raspberry Pi. I've them in my Homebridge as well with homebridge-camera-ffmpeg plugin and live stream for them is also working fine.

What might be wrong with my configurations? Do I need to enable/disable some services from Dafang web interface?

btutal avatar Mar 20 '20 09:03 btutal

Same problem here (on a raspberry 4), I've the same problem. It worked once and after that I get only ' mpeg code 1' when I try to stream in homekit.

remko2000 avatar Apr 05 '20 11:04 remko2000

You will have to do "reset streaming" and it'll work again.

looks like there s bug somewhere.

bad1dea avatar May 07 '20 01:05 bad1dea

Same issue here, reset streaming does not resolve the issue for me.

MrPasty avatar Jun 01 '20 14:06 MrPasty

Same issue

iamironz avatar Jul 18 '20 15:07 iamironz

Same issue too...

clrmsc avatar Jul 28 '20 21:07 clrmsc

See the conclusion of #65

jlg89 avatar Sep 23 '20 14:09 jlg89

See the conclusion of #65

This one dos not work properly. By the way camera-ffmpeg working fine. May be plugin contributors cloud use https://www.npmjs.com/package/ffmpeg-for-homebridge dependency for using embedded ffmpeg inside this plugin? @sahilchaddha What do you think?

iamironz avatar Sep 26 '20 11:09 iamironz

The conclusion of #65 was that homebridge-dafang is not up to date, and the only workaround at this point is to use homebridge-camera-ffmpeg with homebridge-defang-mqtt-republish, which does work. In fact, if you use "vcodec": "copy", you don't even need the MaxWidth/MaxHeight/FPS settings, as ffmpeg will simply pass-through whatever it gets from the camera. This saves considerable CPU.

jlg89 avatar Sep 26 '20 12:09 jlg89

Thanks @jlg89 , it works like you suggested.

btutal avatar Sep 26 '20 18:09 btutal

I am still using Homebridge dafang despite it probably being abandoned forever, and I'm on the current version of homebridge and dafang hacks. After setting vcodec to copy, I'd say 9 times out of 10 if you get ffmpeg exited with code 1, it's related to audio.

The newest dafang hacks firmware seems to really screw things up. Some thing about the Web UI will make your settings go haywire.

I've been using my cameras in homebridge fine up until this morning. Some stopped streaming (exited with code 1 error), some worked.

I decided to give camera ffmpeg another try, but I got the same error. You can quickly turn off the sound from camera ffmpeg settings page, so I tried that. Streaming started to work again, so I went to the dafang hacks web ui, changed the audio format setting from "off" to "PCM" and it brought back streaming.

I'd like to eventually possibly switch to camera ffmpeg again but I need a better solution for saving video files. OR!! just get Aqara G2H cameras!

DietShasta avatar Dec 04 '20 21:12 DietShasta