NRCHKB / node-red-contrib-homekit-bridged

Node-RED Contribution - HomeKit Bridged : Node-RED nodes to simulate Apple HomeKit devices.
https://nrchkb.github.io
MIT License
419 stars 52 forks source link

[FEATURE] 0.8.0 Cameras with a "copy" codec and video filter "none" do not work #162

Closed cacherocks closed 5 years ago

cacherocks commented 5 years ago

The best video quality in cameras through HomeBridge is achieved by choosing:

If, I specify the same parameters in NRCHKB 0.8.0, then the cameras do not work:

Снимок экрана 2019-10-15 в 12 13 08 Снимок экрана 2019-10-15 в 12 14 11

If the logic of operation of the Camera accessory is similar to the logic in Homebridge, then in theory everything should work because the settings are saved exactly the same.

Shaquu commented 5 years ago

What plugin do you use on Homebridge to enable cameras?

cacherocks commented 5 years ago

What plugin do you use on Homebridge to enable cameras?

homebridge-camera-ffmpeg

Shaquu commented 5 years ago

I have an idea. Enable debug in homebridge-camera-ffmpeg and look what command is executed, there should be line 'ffmpeg ' + command And do the same at nrchkb, enable debug in Camera config and restart node-red and look what command is executed.

Paste both below and we will se why and what is the difference.

ptath commented 5 years ago
  • additionalCommandline: -crf 12 (numerical value may vary)

Bad idea. Copy means exactly the same video stream, so just skip crf and VideoFilter. Don't tested this, but have a big experience with HB )

Снимок экрана 2019-10-15 в 23 27 03

Shaquu commented 5 years ago

@cacherocks check latest dev branch, there is additional check for videoFilter and possibility to add Interface Name.

cacherocks commented 5 years ago

A little busy days, I only managed to test the work on the # dev branch and the cameras still did not work. In the coming days I will post a debug from HB & NR.

In the meantime, questions,

Shaquu commented 5 years ago

In newest dev Video Filter filters out none value just like in homebridge. If there is a reason to make Additional Command Line optional then yes, I can make it optional.

cacherocks commented 5 years ago

@Shaquu In the dev branch, the cameras completely stopped working, they immediately write in the Home application "This camera does not respond", and in the NodeRed this error is being poured:

Снимок экрана 2019-10-17 в 19 43 03

If thoughts on this?

Shaquu commented 5 years ago

Well I would prefer logs from terminal and not those from node-red ui :) It looks like the bridge is empty. Can you share your flow which is causing this error? When it appears? On start? On deploy? On message input or output?

cacherocks commented 5 years ago

Well I would prefer logs from terminal and not those from node-red ui :)

I would send a log from the terminal if it was =) There is no log from cameras in the terminal on the dev branch. On version 0.8.0, it simply gave status "FFMPEG exited with Error code 1" and there was no “TypeError" in the error.

cacherocks commented 5 years ago

Flow, and start and deploy

[
    {
        "id": "5be4a845.2bca18",
        "type": "homekit-service",
        "z": "b6d5f54c.caa2d8",
        "isParent": true,
        "bridge": "b42e64bb.86d5a8",
        "accessoryCategory": "CAMERA",
        "parentService": "",
        "name": "Камера - Коридор",
        "serviceName": "CameraControl",
        "topic": "",
        "filter": false,
        "manufacturer": "Default Manufacturer",
        "model": "Default Model",
        "serialNo": "Default Serial Number",
        "cameraConfigVideoProcessor": "ffmpeg",
        "cameraConfigSource": "-rtsp_transport tcp -re -i rtsp://login:password@192.168.1.78:554",
        "cameraConfigStillImageSource": "-i http://192.168.1.95:32898/picture/2/current/",
        "cameraConfigMaxStreams": "5",
        "cameraConfigMaxWidth": "1280",
        "cameraConfigMaxHeight": "720",
        "cameraConfigMaxFPS": "25",
        "cameraConfigMaxBitrate": "2560",
        "cameraConfigVideoCodec": "copy",
        "cameraConfigAudioCodec": "libfdk_aac",
        "cameraConfigAudio": false,
        "cameraConfigPacketSize": "1316",
        "cameraConfigVerticalFlip": false,
        "cameraConfigHorizontalFlip": false,
        "cameraConfigMapVideo": "0:0",
        "cameraConfigMapAudio": "0:0",
        "cameraConfigVideoFilter": "none",
        "cameraConfigAdditionalCommandLine": "-crf 12",
        "cameraConfigDebug": true,
        "cameraConfigSnapshotOutput": "disabled",
        "characteristicProperties": "{}",
        "x": 270,
        "y": 1605,
        "wires": [
            [
                "fd1edbfd.925b38"
            ],
            [
                "fd1edbfd.925b38"
            ]
        ]
    },
    {
        "id": "b42e64bb.86d5a8",
        "type": "homekit-bridge",
        "z": "",
        "bridgeName": "NR Pi Koridor Bridge",
        "pinCode": "111-11-111",
        "port": "",
        "allowInsecureRequest": false,
        "manufacturer": "Default Manufacturer",
        "model": "Default Model",
        "serialNo": "Default Serial Number",
        "customMdnsConfig": false,
        "mdnsMulticast": true,
        "mdnsInterface": "",
        "mdnsPort": "",
        "mdnsIp": "",
        "mdnsTtl": "",
        "mdnsLoopback": true,
        "mdnsReuseAddr": true
    }
]
Shaquu commented 5 years ago

@cacherocks please check latest dev I imported your flow and it works for me.

cacherocks commented 5 years ago
  1. To fix the error, it was required to recreate the nodes on the dev branch, that is, the error occurs with the nodes when updating from 0.8.0 to dev
  2. Cameras with the "vcodec": "copy" earned! Thank you! 🥳
Shaquu commented 5 years ago

I would rather step 1 to work without recreating. Please recheck if you have original flow from version 0.8.0

Either way, decide if and when we can close the issue.

cacherocks commented 5 years ago

I didn’t have a flow with errors, I fixed them right away. In any case, many thanks for the work done, I'm almost ready to remove the homebridge (there was only a TV for which I couldn’t get the remote control and volume control in the nodered) =)

Shaquu commented 5 years ago

@cacherocks well I will do everything to convince you that NRCHKB is enough for you;) Remote Control should work, about volume controls it needs tests.