sahilchaddha / homebridge-dafang

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

Video stream stops after few seconds on Homekit #23

Open SSkull995 opened 5 years ago

SSkull995 commented 5 years ago

Hi guys! I have a problem related to the streaming of the imagine on my Homekit app. I have a Xiaomi Dafang and the Dafang plugin, I managed to get rid of the "ffmpeg exited with code 1" error by setting audio:false. If I go on my camera ip, I can see the streamed image, a bit slow but it is shown. However, as soon as I start the streaming on Homekit, this is the output:

[2019-1-27 09:35:55] [Dafang] Start streaming video from My Dafang with 640x360@132kBit ffmpeg -rtsp_transport tcp -i rtsp://192.168.21.106:8554/unicast -map 0:0 -vcodec h264 -pix_fmt yuv420p -r 15 -f rawvideo -tune zerolatency -vf scale=640:360 -b:v 132k -bufsize 132k -maxrate 132k -payload_type 99 -ssrc 2826387 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params jfXEwe+u9Rc411YP11WUSypHEMEa/ZZxPhCJ4k8o srtp://192.168.21.132:60434?rtcpport=60434&localrtcpport=60434&pkt_size=1316 [2019-1-27 09:35:59] [Dafang] Stopped streaming

I then have a snapshot from the Dafang, kinda useless. Do you know how to get rid of the stopped streaming issue? I just cannot see the live image, it stops as soon as I tap on the camera on Homekit, really annoying! I also installed the ffmpeg plugin, just to try to avoid the issue, but it is the same! I tried to change the quality parameters, but I always get "stopped streaming" after maximum 10 seconds. Once more thank you in advance for the help!

mkormendy commented 5 years ago

Try using this config instead:

      "videoConfig": {
        "source": "-rtsp_transport tcp -i rtsp://10.0.1.44:8554/unicast",
        "stillImageSource": "-rtsp_transport http -i rtsp://10.0.1.44:8554/unicast -vframes 1 -r 1",
        "maxStreams": 5,
        "maxWidth": 1280,
        "maxHeight": 720,
        "maxFPS": 15,
        "debug": true,
        "audio": false
      }
SSkull995 commented 5 years ago

Hi @mkormendy! I use this already!

SSkull995 commented 5 years ago

It seems that it tries to start, but then it reaches something that stops it

mkormendy commented 5 years ago

I run mine on MacOS High Sierra on a Mac Mini, so I'm not sure if the library that you're using for the ffmpeg is stable on Windows.

SSkull995 commented 5 years ago

I am running it on a raspi, never said Windows ahahaha On 28 Jan 2019, 17:52 +0100, Mike Kormendy notifications@github.com, wrote:

I run mine on MacOS High Sierra on a Mac Mini, so I'm not sure if the library that you're using for the ffmpeg is stable on Windows. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

mkormendy commented 5 years ago

WhooPs! .. Wrong thread! 🤣

SSkull995 commented 5 years ago

Anyway, do you believe there could be something that can be done here?

SSkull995 commented 5 years ago

Thanks!

x23piracy commented 5 years ago

Hi,

i have similar issues, i cannot find settings that make it work. still pictures are not a problem but streaming is unpossible.

Regards X23

thecoldblooded commented 5 years ago

same issue, please help

my config:

{ "bridge": { "name": "Homebridge", "username": "CC:11:3D:E3:CE:30", "port": 51826, "pin": "031-45-154" },

"platforms": [
    {
        "platform": "Dafang",
        "mqtt": {
            "hostBroker": true,
            "port": 1883,
            "host": "localhost",
            "debug": true,
            "mongoUrl": "mongodb://localhost:27017/mqtt"
        },
        "cameras": [{
            "cameraName": "My Dafang",
            "cameraRTSPStreamUrl": "rtsp://192.168.1.21:8554/unicast",
            "mqttTopic": "myhome/dafang/#",
            "folder": "/Users/udogan/Documents/Recordings",
            "segmentLength": 60,
            "maxDirSize": 8192,
            "checkStorageSizeInterval": 300,
            "accessories": [
                {
                    "name": "Living Room Motion Sensor",
                    "type": "richMotionSensor",
                    "threshold": 300000
                },
                {
                    "name": "Living Room Auto Motion Tracking Switch",
                    "type": "autoMotionTrackingSwitch"
                },
                {
                    "name": "Living Room Night Vision Sensor",
                    "type": "nightVisionSensor",
                    "threshold": 0
                },
                {
                    "name": "Living Room Night Vision Switch",
                    "type": "nightVisionSwitch"
                },
                {
                    "name": "Living Room Auto Night Vision Switch",
                    "type": "autoNightVisionSwitch"
                },
                {
                    "name": "Horizontal Left",
                    "type": "moveCamera",
                    "axis": "horizontal",
                    "direction": "left"
                },
                {
                    "name": "Horizontal Right",
                    "type": "moveCamera",
                    "axis": "horizontal",
                    "direction": "right"
                },
                {
                    "name": "Vertical Up",
                    "type": "moveCamera",
                    "axis": "vertical",
                    "direction": "up"
                },
                {
                    "name": "Vertical Down",
                    "type": "moveCamera",
                    "axis": "vertical",
                    "direction": "down"
                },
                {
                    "name": "Record Video",
                    "type": "recordVideo"
                },
                {
                    "name": "Record Audio",
                    "type": "recordAudio"
                },
                {
                    "name": "Capture Image",
                    "type": "captureImage"
                },
                {
                    "name": "RPi Storage Sensor",
                    "type": "storageSensor"
                },
                {
                    "name": "Clear Storage Switch",
                    "type": "clearStorage"
                },
                {
                    "name": "Reset Streaming",
                    "type": "resetFFMPEG"
                },
                {
                    "name": "Camera Brightness",
                    "type": "brightness"
                }
            ],
            "videoConfig": {
                "source": "-rtsp_transport tcp -i rtsp://192.168.1.21:8554/unicast",
                "stillImageSource": "-rtsp_transport http -i rtsp://192.168.1.21:8554/unicast -vframes 1 -r 1",
                "maxStreams": 5,
                "maxWidth": 1280,
                "maxHeight": 720,
                "maxFPS": 15,
                "debug": true,
                "audio": false
            }
        }]
    }
]

}

afbenevides commented 4 years ago

any update on this issue? I have still images working on both OSX and IOS home.app but the stream only works on OSX. It stops after like 1 frame on IOS and then black screen.

I'm running out of ideas...

jlg89 commented 3 years ago

I notice several people are using the "videoConfig" parameter block, but I don't see it mentioned in the plugin configuration instructions. I know homebridge-camera-ffmpeg uses these parameters, but does homebridge-dafang?