Samfox2 / homebridge-videodoorbell

Video-Doorbell plugin based on homebridge-camera-ffmpeg for Homebridge.
Apache License 2.0
97 stars 17 forks source link

Snapshot works, Stream does not → please help #23

Closed IT-Lueg closed 4 years ago

IT-Lueg commented 5 years ago

Hello, can somebody please help me. I've been trying to create the stream correctly for days now.

The snapshot is taken and displayed in the app. But as soon as I click on the stream it just loads. And after a while I get the message "no Answer".

What am I doing wrong?

Config

        {
            "platform": "Video-doorbell",
            "cameras": [
                {
                    "name": "Haupteingang",
                    "port": 5005,
                    "button": true,
                    "videoConfig": {
                        "stillImageSource": "-i http://192.168.1.25/snap.jpeg",
                        "source": "-re -i rtsp://192.168.1.2:7447/5b8391c417cb480790fdda8b_0",
                        "maxWidth": 1280,
                        "maxHeight": 720,
                        "maxFPS": 15,
                        "debug": true
                    }
                }
            ]
        },

Output

[2018-9-12 12:14:29] [Video-doorbell] Snapshot from Haupteingang at 480x270 ffmpeg -i http://192.168.1.25/snap.jpeg -t 1 -s 480x270 -f image2 -

[2018-9-12 12:14:39] [Video-doorbell] Start streaming video from Haupteingang with 1280x720@299kBit
ffmpeg -re -i rtsp://192.168.1.2:7447/5b8391c417cb480790fdda8b_0 -map 0:0 -vcodec libx264 -pix_fmt yuv420p -r 15 -f rawvideo -tune zerolatency -vf scale=1280:720 -b:v 299k -bufsize 299k -maxrate 299k -payload_type 99 -ssrc 13082713 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params 9clA7rvi36bJT1T6rRyCVEk88mUhf6udNAEEcG5c srtp://192.168.1.165:63684?rtcpport=63684&localrtcpport=63684&pkt_size=1316

[2018-9-12 12:15:43] [Video-doorbell] Stopped streaming

iPhone

img_3836

IT-Lueg commented 5 years ago

FFMPEG works correctly. I know that because I use another plugin (homebridge-camera-ffmpeg-ufv) which also uses FFMPEG.

Output

-rtsp_transport http -re -i rtsp://192.168.1.2:7447/5b8391c417cb480790fdda8b_0?apiKey=RyFl7WZdKruAJD9pQHj6VyNbXEoiad4C -threads 0 -vcodec libx264 -an -pix_fmt yuv420p -r 15 -f rawvideo -tune zerolatency -vf scale=1280:720 -b:v 299k -bufsize 299k -payload_type 99 -ssrc 12174958 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params dpE0rArsLvK4khRGPOm7jiE8yWysr5WcLFzjmxQM srtp://192.168.1.165:64451?rtcpport=64451&localrtcpport=64451&pkt_size=1378

IT-Lueg commented 5 years ago

I looked a little further and after a long time I came across the following page. . . https://www.bountysource.com/issues/56801125-video-won-t-start-to-stream

After reading the comment of "johan-de-jong", I have edited my "ffmpeg. js" file and now it works 12-09-_2018_13-24-27

I am working with Ubiquiti Unifi Video Cameras so i changed my config from:

old Config

    let ffmpegCommand = this.ffmpegSource + ' -map 0:0' +
      ' -vcodec ' + vcodec +
      ' -pix_fmt yuv420p' +

new Config

        let ffmpegCommand = this.ffmpegSource + ' -threads 0' +
          ' -vcodec ' + vcodec + ' -an' +
          ' -pix_fmt yuv420p' +
Samfox2 commented 5 years ago

Great that it is working now for your setup. Those parameters are often camera specific so it is a bit tricky to implement them in a general approach.

Partizan7676 commented 5 years ago

Any suggestion - which camera has two way audio? I check two models from Hikvision - both not work. So does somebody get sound with ffmpeg camera plugin?

Samfox2 commented 5 years ago

At this time there is no 2-way audio support with ffmpeg possible as ffmpeg cannot provide compatible stream.

llemtt commented 5 years ago

@Partizan7676

yes I have

https://github.com/KhaosT/homebridge-camera-ffmpeg/issues/174

My current doorbell is made out of a cheap analog video doorbell and raspi, two-way audio!