sahilchaddha / homebridge-dafang

Homebridge Plugin for Xiaomi Dafang / Wyze Cam IP Camera => Hey Siri, Start Video Recording
MIT License
203 stars 34 forks source link

[BUG] - ERROR: FFmpeg exited with code 1 #54

Open btutal opened 4 years ago

btutal commented 4 years ago

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:PASSWORD@10.0.100.106:8554/unicast",
                    "videoConfig": {
                        "source": "-rtsp_transport tcp -i rtsp://USERNAME:PASSWORD@10.0.100.106:8554/unicast",
                        "stillImageSource": "-rtsp_transport http -i rtsp://USERNAME:PASSWORD@10.0.100.106: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?

remko2000 commented 4 years ago

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.

bad1dea commented 4 years ago

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

looks like there s bug somewhere.

MrPasty commented 4 years ago

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

iamironz commented 4 years ago

Same issue

clrmsc commented 4 years ago

Same issue too...

jlg89 commented 4 years ago

See the conclusion of #65

iamironz commented 4 years ago

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?

jlg89 commented 4 years ago

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.

btutal commented 4 years ago

Thanks @jlg89 , it works like you suggested.

DietShasta commented 3 years ago

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!