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

Record video #10

Open netRunner0 opened 5 years ago

netRunner0 commented 5 years ago

Hey. No video is recorded. Creates empty mp4 files. No errors.

Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-26.mp4 [12/11/2018, 5:24:26 PM] [Dafang] Setting Record Video Value to true Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-28.mp4 Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-31.mp4 Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-34.mp4 Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-37.mp4 Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-40.mp4 Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-43.mp4 Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-46.mp4 [12/11/2018, 5:24:48 PM] [RaspberryPi Info] Raspberry Temperatur: 52.078 Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-49.mp4 Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-51.mp4 Start record home/pi/record/recordingshall/Dafang Hall/Dec-11th-18/video/2018-12-11-5-24-53.mp4 [12/11/2018, 5:24:57 PM] [Dafang] ** Sending MQTT event to accessory at home/camerahall/brightness with payload : 20 [12/11/2018, 5:24:59 PM] [Dafang] ** Sending MQTT event to accessory at home/camerahall/night_mode with payload : ON [12/11/2018, 5:24:59 PM] [Dafang] ** Sending MQTT event to accessory at home/camerahall/night_mode/auto with payload : ON [12/11/2018, 5:24:59 PM] [Dafang] ** Sending MQTT event to accessory at home/camerahall/motion/detection with payload : OFF [12/11/2018, 5:25:00 PM] [Dafang] ** Sending MQTT event to accessory at home/camerahall/motion/tracking with payload : ON [12/11/2018, 5:25:00 PM] [Dafang] Setting Record Video Value to false

Audio file records...

netRunner0 commented 5 years ago

What are the best parameters to put on the camera, (Dafang), so that the video was not slow in the homekit?

I constantly get video from these cameras, as if in slow motion. How can I enter the video settings? I use Raspberry pi3+

sahilchaddha commented 5 years ago

Hey @netRunner0 ,

If you are able to record audio, but not video. Its most commonly issue with video codecs. Make sure you have installed all ffmpeg dependencies that support your streams video codec.

RPi isnt powerful enough to stream/record HD videos. Either you can use a more powerful system or you can downgrade your video resolution for RPi.

netRunner0 commented 5 years ago

@sahilchaddha

What are the optimal settings on the camera, so that there is a sound and a normal flow? my stream is now like a slow-motion video ... but it’s not with the other rtsp camera

netRunner0 commented 5 years ago

I started getting the perfect high definition video stream using the homebridge-ffmpeg plugin on my raspberry. However, the video files are still empty, and the raspberry processor is not loaded.

Hussamfhaily commented 5 years ago

I get zero KB recorded videos!

mkormendy commented 5 years ago

@netRunner0 what does your .homebridge config look like?

netRunner0 commented 5 years ago

` { "mdns": { "interface": "10.0.0.100" }, "bridge": { "name": "Homebridge77", "pin": "917-32-180", "username": "0E:65:76:62:A4:6C", "port": 51826 }, "accessories": [ { "accessory": "HTTP-TEMPERATURE", "name": "iKettle 2.0t", "getUrl": "http://localhost:2080/api/10.0.0.13/raw/temperature" }, { "accessory": "RaspberryPiTemperature", "name": "RaspberryPi Info", "updateInterval": 30000 }, { "accessory": "lgtv-2012", "name": "TV Tema", "ip": "10.0.0.27", "pairingKey": "783339", "min_volume": 2, "max_volume": 20, "on_command": "MUTE" }, { "accessory": "MiHumidifier", "name": "Увлажнитель спальня", "ip": "10.0.0.23", "model": "ca1", "token": "c3c415c7093cb0ec9b0b4854008a2b47", "showTemperature": true, "nameTemperature": "Температура спальня" }, { "accessory": "MiHumidifier", "name": "Увлажнитель Тема", "ip": "10.0.0.17", "model": "ca1", "token": "598caf7ccd38601ace4a64252bc54405", "showTemperature": true, "nameTemperature": "Температура Тема" } ], "platforms": [ { "name": "Config", "port": 8080, "auth": "form", "theme": "blue", "restart": "sudo systemctl restart homebridge", "tempUnits": "c", "sudo": true, "log": { "method": "systemd", "service": "homebridge" }, "platform": "config" }, { "platform": "AutomationSwitches", "switches": [ { "type": "automation", "name": "Automation Switch #1", "period": 5, "autoOff": false }, { "type": "automation", "name": "Automation Switch #2", "period": 5, "autoOff": false }, { "type": "automation", "name": "Automation Switch #3", "period": 5, "autoOff": false }, { "type": "automation", "name": "Automation Switch #4", "period": 5, "autoOff": false }, { "type": "automation", "name": "Automation Switch #5", "period": 5, "autoOff": false }, { "type": "automation", "name": "Automation Switch #6", "period": 5, "autoOff": false } ] }, { "platform": "Video-DoorbellV2", "buttonSid": "158d0001d62c2b", "cameras": [ { "name": "Домофон", "videoConfig": { "source": "-re -i http://10.0.0.12:81/videostream.cgi?loginuse=admin&loginpas=", "maxStreams": 2, "maxWidth": 1280, "maxHeight": 720, "maxBitrate": 1600, "maxFPS": 15, "audio": false } } ] }, { "platform": "Camera-ffmpeg", "cameras": [ { "name": "Холл1", "videoConfig": { "source": "-i rtsp://10.0.0.36:8554/unicast", "stillImageSource": "-i rtsp://10.0.0.36:8554/unicast -vframes 1 -r 1", "maxBitrate": 4000, "maxStreams": 3, "packetSize": 752, "debug": true, "vcodec": "copy", "audio": true } } ] }, { "platform": "Camera-ffmpeg", "cameras": [ { "name": "Детская1", "videoConfig": { "source": "-i rtsp://10.0.0.21:8554/unicast", "stillImageSource": "-i rtsp://10.0.0.21:8554/unicast -vframes 1 -r 1", "maxBitrate": 4000, "maxStreams": 3, "vcodec": "copy", "packetSize": 752, "debug": true, "audio": true } } ] }, { "platform": "cmdSwitch2", "switches": [ { "name": "iKettle 2.0", "on_cmd": "/home/pi/iBrew/ibrew heat 100 30 10.0.0.13", "off_cmd": "/home/pi/iBrew/ibrew stop 10.0.0.13", "state_cmd": "/home/pi/iBrew/ibrew status 10.0.0.13 | grep 'busy'", "manufacturer": "iBrew", "model": "iBrew iKettle 2.0", "serial": "44DE2AD79BC", "polling": true, "interval": 10 }, { "name": "iKettle night", "on_cmd": "/home/pi/iBrew/ibrew heat 41 30 10.0.0.13", "off_cmd": "/home/pi/iBrew/ibrew stop 10.0.0.13", "state_cmd": "/home/pi/iBrew/ibrew status 10.0.0.13 | grep 'keep warm'", "manufacturer": "iBrew", "model": "iBrew iKettle 2.0", "serial": "44DE2AD79BA", "polling": true, "interval": 9 }, { "name": "iKettle Green Tea", "on_cmd": "/home/pi/iBrew/ibrew heat 65 10.0.0.13", "off_cmd": "/home/pi/iBrew/ibrew stop 10.0.0.13", "state_cmd": "/home/pi/iBrew/ibrew status 10.0.0.13 | grep 'busy'", "manufacturer": "iBrew", "model": "iBrew iKettle 2.0", "serial": "44DE2AD79BA", "polling": true, "interval": 11 } ] } ] }

`

I do not use the original plugin to view the video

mkormendy commented 5 years ago

I do not use the original plugin to view the video

This is likely the reason why. But looking at your config, I don't see the homebridge-dafang entry's settings at all.

Your homebridge-dafang is the plugin that does the recording, so you need to get this to work properly. It's likely your system's ffmpeg library not configured or installed with all of the required codecs for outputting to a file.

renedivx commented 5 years ago

I have same problem with correct config like this

{ "platform": "Dafang", "mqtt": { "hostBroker": false, "port": 1883, "host": "192.168.22.104", "debug": true }, "cameras": [ { "cameraName": "terrasse", "cameraRTSPStreamUrl": "rtsp://192.168.22.69:8554/unicast", "mqttTopic": "haus/terrasse/#", "folder": "/home/pi/kamera/", "recordingDirectoryPathFormat": "DD-MM-YYYY", "recordingFilenameFormat": "DD-MM-YYYY-kk-mm-ss", "accessories": [ { "name": "Bewegungssensor", "type": "richMotionSensor", "threshold": 100000 }, { "name": "Auto Bewegung", "type": "autoMotionTrackingSwitch" }, { "name": "Nachtsichtsensor", "type": "nightVisionSensor", "threshold": 0 }, { "name": "Nachtsicht", "type": "nightVisionSwitch" }, { "name": "Auto Nachtsicht", "type": "autoNightVisionSwitch" }, { "name": "Links", "type": "moveCamera", "axis": "horizontal", "direction": "left" }, { "name": "Rechts", "type": "moveCamera", "axis": "horizontal", "direction": "right" }, { "name": "Hoch", "type": "moveCamera", "axis": "vertical", "direction": "up" }, { "name": "Runter", "type": "moveCamera", "axis": "vertical", "direction": "down" }, { "name": "Video aufnehmen", "type": "recordVideo" }, { "name": "Audio aufnehmen", "type": "recordAudio" }, { "name": "Bild aufnehmen", "type": "captureImage" }, { "name": "RPi Speicher", "type": "storageSensor" }, { "name": "Speicher bereinigen", "type": "clearStorage" }, { "name": "Stream zurücksetzen", "type": "resetFFMPEG" }, { "name": "Helligkeit", "type": "brightness" }, { "name": "Neustarten", "type": "restartSwitch" }, { "name": "Kalibrieren", "type": "recalibrateSwitch" } ], "videoConfig": { "source": "-rtsp_transport tcp -re -i rtsp://192.168.22.69:8554/unicast", "stillImageSource": "-i http://root:ismart12@192.168.22.69/cgi-bin/currentpic.cgi", "maxStreams": 2, "maxWidth": 1280, "maxHeight": 720, "maxFPS": 21, "maxBitrate": 299, "vcodec": "h264_omx", "audio": false, "packetSize": 188 } } ] },

Have you find a solution for thsi problem? i also get empty mp4 files. But no errors on log file

if i start recording with mqtt. my log file shows this

Start record /home/pi/kamera/terrasse/05-03-2019/video/05-03-2019-13-04-29.mp4 Start record /home/pi/kamera/terrasse/05-03-2019/video/05-03-2019-13-04-30.mp4 Start record /home/pi/kamera/terrasse/05-03-2019/video/05-03-2019-13-04-32.mp4 Start record /home/pi/kamera/terrasse/05-03-2019/video/05-03-2019-13-04-34.mp4 Start record /home/pi/kamera/terrasse/05-03-2019/video/05-03-2019-13-04-36.mp4 Start record /home/pi/kamera/terrasse/05-03-2019/video/05-03-2019-13-04-38.mp4 Start record /home/pi/kamera/terrasse/05-03-2019/video/05-03-2019-13-04-40.mp4 Start record /home/pi/kamera/terrasse/05-03-2019/video/05-03-2019-13-04-42.mp4 Start record /home/pi/kamera/terrasse/05-03-2019/video/05-03-2019-13-04-44.mp4

Than i have many mp4 files in the folder, but all have 0 bytes

Thanks best regards rene

renedivx commented 5 years ago

I solve this problem. change in the audio settings from dafang the type to mp3. Than record videos works fine. Maybe this can help others.

mkormendy commented 5 years ago

@renedivx what does your homebridge config look like with the changes?

renedivx commented 5 years ago

@renedivx what does your homebridge config look like with the changes?

I change the audio settings at camera webif not in the config.json. there change to mp3. after that i can recrod video files.

mkormendy commented 5 years ago

What do you mean by “camera webif”? Oh you're talking about the Dafang Hack Web Interface.

Well I already had mine set to MP3, video is working but no audio still.

renedivx commented 5 years ago

Ok great. have you set in config.json = "audio": true

mkormendy commented 5 years ago

Wow, so many months later .. sorry for not responding sooner.

Unfortunately the video streaming never works with the "audio": true in the homebridge config.json, and MP3 selected in the dafang web interface.

What sample rates and filter settings do you have in the dafang web Interface?