Brandawg93 / homebridge-nest-cam_old

Use your Nest Cam as IP camera in HomeKit.
Apache License 2.0
92 stars 14 forks source link

h264_omx and useOMX options result in ERR_STREAM_DESTROYED #67

Open killerrabbit33 opened 5 years ago

killerrabbit33 commented 5 years ago

I am using Homebridge in a Docker container on a Raspberry Pi 3B. This works nicely when nothing is specified for the encoder in config.json. But when I include "ffmpegCodec": "h264_omx" or "useOMX": "true", the following error occurs when bringing up the stream in the Home app:

[NexusStreamer]Connected
[NexusStreamer]OK
[NexusStreamer]Redirect
[NexusStreamer]Redirecting...
[NexusStreamer]Connection Closed
[NexusStreamer]Connected
[NexusStreamer]OK
[NexusStreamer]Playback Begin
ERR_STREAM_DESTROYED
[NexusStreamer]Connection Closed

It looks like somehow the version of ffmpeg that Docker has available to it does not have the h264_omx decoder in it. Running ffmpeg -encoders | grep h264 in an ssh session with the Raspberry Pi shows that h264_omx is available, but when running the same command in the Docker terminal it doesn't appear. Any way I can get h264_omx available to the Docker container? Please let me know if this is really a Homebridge/Docker issue rather than a homebridge-nest-cam issue. Thanks so much!

morilm commented 5 years ago

Hi. I have trying during the last day to compile ffmpeg for the raspberry as the precompiled deb package is no longer available

I think we should fine the right settings for the configure option to get the omx HW support along with the json settings.

As today seems to be a bit of confusion. I propose the below steps taken from the homebridge-camera-ffmpeg git:

git clone https://github.com/FFmpeg/FFmpeg.git cd FFmpeg ./configure --prefix=/usr/local --arch=armel --target-os=linux --enable-omx-rpi --enable-nonfree --enable-gpl --enable-libfdk-aac --enable-mmal --enable-libx264 --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-demuxer=rtsp make -j4 sudo make install

KhaosT, maybe we can use the same settings on json and other options as on the homebridge-camera-ffmpeg.

Could you please provide instructions on what to change to see the ffmpeg output?

We are unsure if the problem is on the ffmpeg side due to missing compilation parameters or on the command line (like the extra space issue found a few days ago)

Happy to run additional test. I have 2 nest cameras and rasppi 3b+ to compile with different options until we make it work

morilm commented 5 years ago

First test with the proposed ffmpeg compile configuration. Same camera. No 2FA. Homebridge running on Raspi 3b+ with PM2

Json using "ffmpegCodec": "libx264"

Live video works but very very slow.

Log at the homebridge:

0|homebridge -I | [NexusStreamer]Connected 0|homebridge -I | [NexusStreamer]OK 0|homebridge -I | [NexusStreamer]Playback Begin

using "ffmpegCodec": "h264_omx"

No live video. Log output:

0|homebridge -I | [NexusStreamer]Connected 0|homebridge -I | [NexusStreamer]OK 0|homebridge -I | [NexusStreamer]Playback Begin 0|homebridge -I | undefined 0|homebridge -I | [NexusStreamer]Connection Closed

laskatj commented 4 years ago

Same problem for me. Compiled ffmpeg with omx support and getting same error when trying to view live nest cam. Anyone figure out what the root issue is?

[NexusStreamer]Connected [NexusStreamer]OK [NexusStreamer]Redirect [NexusStreamer]Redirecting... [NexusStreamer]Connection Closed [NexusStreamer]Connected [NexusStreamer]OK [NexusStreamer]Playback Begin ERR_STREAM_DESTROYED [NexusStreamer]Connection Closed