Closed johan-de-jong closed 6 years ago
Looks like a typo in your ip address? Is it really rtsp://1192.xxx not rtsp://192.xxx?
Johan did you ever get your issue resolved? I am also having similar issues.I get snap shots from the camera just fine but when I try to stream video it doesn’t work. I double checked my IPs in the config.json. When I use the exact same settings for this camera in the original ffmpeg plugin streaming and snapshots work great. I am also not getting the feature rich notification when I trigger the bell event from http. Just a pop up which takes me directly to camera feed. In homekit it’s in the same room as a August lock so I thought I would see the option to open the lock.
If the stream is working with ffmpeg plugin it should also work within video doorbell as the ffmpeg part is basically the same. Could you please try to remove and re-add your video doorbell with a different name? Do snapshots work with the trigger? Could you try the "vcodec": "copy" option?
I will try that when I get back home tonight. When I trigger it from the curl statement I get home kit notification comedown from top of screen with the Ring A Dong message and the snapshot on the right. When I click it takes me to full screen streaming of the camera which after 30 sec or so fails.
Here is the original ffmpeg home bridge config that I was using to stream the camera:
"platform": "Camera-ffmpeg", "cameras": [{ "name": "Front Door", "uploader": true, "videoConfig": { "source": "-rtsp_transport tcp -re -i rtsp://10.200.1.2:554/s0", "maxStreams": 2, "maxWidth": 1920, "maxHeight": 1080, "maxFPS": 30
I have removed that camera and config from the old ffmpeg plugin. Here is my current config that I am using:
"platform": "Video-doorbell", "videoProcessor": "/usr/local/bin/ffmpeg", "cameras": [{ "name": "Front Doot", "port": 5005, "videoConfig": { "source": "-rtsp_transport tcp -re -i rtsp://10.200.1.2:554/s0", "button": false, "maxStreams": 2, "maxWidth": 1280, "maxHeight": 1024, "maxFPS": 30, "vcodec": "copy", "debug": true
Here is the terminal debug output I am getting when trying to stream the camera after which the No Response - The Camera is not responding message appears on my phone:
[2018-6-7 16:42:19] [Camera-ffmpeg] Snapshot from Front Lawn at 480x270 [2018-6-7 16:42:32] [Video-doorbell] Start streaming video from Front Doot with 1280x720@299kBit ffmpeg -rtsp_transport http -re -i rtsp://10.200.1.2:554/s0 -map 0:0 -vcodec copy -pix_fmt yuv420p -r 30 -f rawvideo -tune zerolatency -b:v 299k -bufsize 299k -maxrate 299k -payload_type 99 -ssrc 4918380 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params CFup8PK24+jfOZgn4umR5uu/XleP5H6xn6gcr+0D srtp://10.0.1.33:62412?rtcpport=62412&localrtcpport=62412&pkt_size=1316 [2018-6-7 16:43:31] [Video-doorbell] Stopped streaming [2018-6-7 16:43:35] [Video-doorbell] Snapshot from Front Doot at 480x270 ffmpeg -rtsp_transport http -re -i rtsp://10.200.1.2:554/s0 -t 1 -s 480x270 -f image2 - [2018-6-7 16:43:37] [Camera-ffmpeg] Snapshot from Front Lawn at 480x270
I did get it to work after some fiddling. I had immediate success with another plugin for the PiCam (/dev/video0). It passes fewer parameters to ffmpeg.
That led me to experimenting with removing parameters from the ffmpeg command in the ffmpeg.js file. I first got video streaming to work by removing ' -map 0:0' from the ffmpeg.js file. As you can see in the config below, I pass the desired -map argument back in the config.json where required.
As an exercise I've taken input from an ip network camera (mjpeg), my tv decoder (mpegts) and a Raspberry Pi Cam (h264). The ip network camera also supports rtsp/h.264, but ultimately I got better results with mjpeg. Re-encoding/sizing the h.264 stream seems to much to handle for my Pi.
I tried to duplicate my results by copying the config.json and modified ffmpeg.js to another Raspberry Pi. I have not had time to look into this further. On the new Raspberry Pi streaming fails. Which leads me to believe something probably went wrong in building ffmpeg.
Has anybody gotten audio to work smoothly? Mine is rather choppy. As an experiment I discovered that video is (obviously) smoothest when I use de -vcodec copy and removed the re-encoding/sizing parameters from ffmpeg.js.
$ diff /usr/lib/node_modules/homebridge-videodoorbell/ffmpeg.js.org /usr/lib/node_modules/homebridge-videodoorbell/ffmpeg.js 282c282 < let ffmpegCommand = this.ffmpegSource + ' -map 0:0' + --- > let ffmpegCommand = this.ffmpegSource +
{ "platform": "Video-doorbell", "cameras": [ { "name": "IQeye IQD52W", "Manufacturer": "IQeye", "uploader": false, "port": 5005, "button": false, "videoConfig": { "source": "-f mjpeg -i http://192.168.0.239/now.jpg?snap=spush", "stillImageSource": "-i http://192.168.0.239/now.jpg", "vcodec": "h264_omx", "maxWidth": 1280, "maxHeight": 720, "maxStreams": 2, "maxFPS": 15, "audio": false, "button": false, "debug": false } }, { "name": "piCam", "uploader": false, "port": 5006, "videoConfig": { "source": "-f video4linux2 -vcodec h264_mmal -i /dev/video0", "stillImageSource": "-f video4linux2 -ss 0.9 -i /dev/video0 -vframes 1", "maxStreams": 2, "maxWidth": 1280, "maxHeight": 720, "maxFPS": 30, "vcodec": "h264_omx", "button": false, "debug": false } }, { "name": "NPO1", "uploader": false, "port": 5007, "videoConfig": { "source": "-f mpegts -acodec mp2 -vcodec mpeg2video -i http://decoder.local:8001/1:0:1:4A61:807:600:FFFF0000:0:0:0: -map 0:0", "maxStreams": 2, "maxWidth": 1024, "maxHeight": 576, "maxBitrate": 512, "maxFPS": 5, "vcodec": "h264_omx", "button": false, "audio": true, "debug": true } } ] },
Great that it is working for you. I suggested the "copy" option as it uses the stream as it is without re-encoding. So this should be the optimal solution if your cam stream is compatible.
In the Apple Home app I correctly receive notifications and snapshots, but streaming won't start.
When I verify the specified rstp:// destinations in VLC streaming works just fine. The videodoorbell plugin adds a lot of parameters to each ffmpeg session to set up a video stream.
When I look at the logging it seems ffmpeg is complaining about some of the parameters.
Does anybody have any suggestions to resolve this issue?
Here's the logging where ffmpeg seems to complain:
Here's all the logging: