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
412 stars 52 forks source link

[Help needed]: Camera - no stream with rtmp:// and rtsp:// #513

Closed Strobel2k closed 4 months ago

Strobel2k commented 1 year ago

Your Current NRCHKB Plugin Version

1.5.0

Operating System

Raspberry pi

How can we help?

I only get the pictures/snapshots on my home and no stream. Any idea why? wit yahka and vlc both streams are working rtmp:// and rtsp://.

If I click on the camera to start the stream followin log appears: Following message I get in logs:

  2022-12-31T08:48:05.761Z CameraSource-Error ERROR: FFmpeg exited with code 1

Ive tried the configuration with rtsp:// from https://nrchkb.github.io/wiki/service/camera-control/#title for Reolink. Doesnt work. Ive tried -i rtmp://IP/bcs/channel0_main.bcs?channel=0&stream=2&user=admin&password=xxx -map 0 -an -dn -flags -global_header. Doesnt work.

Im wondering that both work with yahka and also vlc. So there shouled be no issue with ffmpeg?! BTW Ive installed also the NRCHKB ffmpeg configuration on my pi. Unbenanntcam1 Unbenanntcam12

Any more details?

If this is specific to some hardware or specific software version, please explain here.

Any code or functions to add?

No response

kuehnelbs commented 1 year ago

For me it took several weeks to get a stream from my cams in homekit. I suggest starting directly on your node-red server trying to get a stream with ffmpeg on console. On a raspi I had to download codecs and ffmpeg sources, and configure several options before install. For me this configuration works with my axis cam:

install build tools

sudo apt-get install git pkg-config autoconf automake libtool libx264-dev

download and build fdk-aac

git clone https://github.com/mstorsjo/fdk-aac.git cd fdk-aac ./autogen.sh ./configure --prefix=/usr/local --enable-shared --enable-static make -j4 sudo make install sudo ldconfig cd ..

download and build ffmpeg

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 --extra-ldflags="-latomic" make -j4 sudo make install

test Stream

ffmpeg -rtsp_transport tcp -i rtsp://viewer:pass>@<ip/axis-media/media.amp?videocodec=h264 -vcodec copy -vbsf h264_mp4toannexb -t 10 axis.mp4

My settings in Camera GUI look the same - with one difference. As video codec setting I use "h264" instead of "libx264"

stoinov commented 1 year ago

My rtsp source for a Reolink cam is:

-re -rtsp_transport tcp -i rtsp://user:pass@192.168.10.10:554/h264Preview_01_sub

and for video codec I use copy Map video is 0:0

Shaquu commented 4 months ago

I close the Issue due to inactivity. If you come back here and still have a problem then feel free to comment here or open new Issue.