vectronic / homebridge-shinobi

A Homebridge plugin integrating Shinobi for motion detector cameras

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Video stream doesn't work

dankokp opened this issue · comments

Hi @vectronic,
First of all thank you for your efforts!
homebridge-shinobi almost works on my device. I can get still images and receive motion notifications with screenshots. But unfortunately once I try to open camera and receive video stream, I can see only loading on my still image background and then "No Response" error. The logs look like this:

[6/29/2020, 12:07:35 PM] [Shinobi] handleStreamRequest() START success
[6/29/2020, 12:07:35 PM] [Shinobi] ffmpeg received first frame
[6/29/2020, 12:08:05 PM] [Shinobi] handleStreamRequest: {"sessionID":"xxxx","type":"stop"}
[6/29/2020, 12:08:05 PM] [Shinobi] killing: street => xxxxx => PID: xxxxx
[6/29/2020, 12:08:05 PM] [Shinobi] stopped streaming session!
[6/29/2020, 12:08:05 PM] [Shinobi] ffmpeg exited with code: null and signal: SIGKILL (Video stream stopped!)

Hello, I will try to look into this on the weekend...

One thing to mention to you, right now I am having a massive problem with the latest git version of Shinobi which I am no longer able to get it to record video. Nothing to do with this plugin however... however it is disappointing to get this plugin mostly working and then to find Shinobi letting me down :-(

Firstly, can I check you are using the latest version of the plugin: 3.0.8?

Its strange that in your logs you see the result of this line in the code:

this.platform.log.debug('ffmpeg received first frame');

but you don't see the result of the previous more interesting logs statements:

this.platform.log.debug(`requested video stream: ${width}x${height}, ${fps} fps, ${maxBitrate} kbps, ${mtu} mtu`);

and

this.platform.log.debug(ffmpegCommand);

I would suspect that maybe the video stream coming from your camera is not what we are telling Home to receive.

I realise I had some pretty hard coded stuff in shinobiMonitorAccessory.ts:

               video: {
                    codec: {
                        profiles: [H264Profile.MAIN],
                        levels: [H264Level.LEVEL4_0]
                    },
                    resolutions: [
                        [640, 360, 20]
                    ]
                }

This is because the stream URL I have configured on the monitor in Shinobi is pointed to a secondary low res stream from the camera with this kind of URL: rtsp://Streaming/Channels/102 and this stream matches this fixed config.

Beyond the simplicity of hardcoding to my config, I was also keen to ensure ffmpeg was just copying packets rather than decoding and re-encoding video.

If you would be willing, we could:

a. temporarily modify your camera settings to those above and see if things magically start working and/or
b. send me details about your camera stream, then I can add more logic and config options to either stream with copy or re-encode.

Obviously, I'd rather try a, before embarking on b. - but let me know...

Closing due to inactivity...