Git Product home page Git Product logo

hkcam's People

Contributors

brutella avatar eiryu avatar ethan-nelson avatar jayfidev avatar m-rossi avatar oliverpool avatar pieter avatar rcarmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hkcam's Issues

Rotating camera image

I'd love to have the ability to rotate the camera image by 180° (90° and 270° might also be useful under certain circumstances).
It doesn't have to be a UI option (if that's possible at all), some kind of parameter in a config file would suffice.

Background: my rPi has to be mounted upside down for cabling reasons.

Unable to access over internet

I have a Raspberry Pi 2 B with 256MB allocated for video memory. I ran the Ansible playbook from master today (6a81223), and I have a flawless stream on my home router. Over LTE, however, I get "No Response". This also happens on the guest network of my router. Does hkcam support streaming over the internet? How can I debug this?

Brightness

How do i adjust the brightness? My image is overexposed.

Nice work by the way.

I will turn this project into a doorbell

multiple video streams, loopback to video1 should be converted?

As far as I understand, if the multiple video streams option is activated, the stream can be received from two devices at the same time. In this case the input /dev/video0 is loopbacked to /dev/video1 with the ffmpeg argument "-codec:v copy". When two devices access the stream now, the same data is converted two times in parallel to h264. Wouldn't it make more sense to convert the stream once (and continuously running in this case) to h264 and loop it back to /dev/video1 and provide this with the argument "-codec:v copy" then to multiple receivers? This would require less processing in my understanding.

IR light ???

Is there a possibility to connect IR LIGHT for nightview?

Automation - motion detected & take snapshot is missing in Home 3

I'll tried to add the automation in Home 3 like displayed in your screenshot

automation

but both of the options a missing in the app.
I'm using iPhone XR with iOS 12.3.1 - rPi Zero W (hkcam 0.7)

is there anything I missed? from the docs I read, it should work with Home 3

HomeKit Secure Video Support?

It would be fantastic to expand this product to support Apple's HomeKit Secure Video feature. Apple seems to have tailor made this product to work with hkcam!

Working on Android

I like this project and want to build it. Is it possible to use it with Android instead of iOS?

Suggestion

May I do a suggestion for future development?
Have a look at this: https://www.ring.com 🚪 🔔
This is not my field of expertise but I'm sure @brutella or some other smart person here could mange to make this happen? ☺️

Best regards!

Selected framerate (30.000000) is not supported by the device

I'm trying it today on Mac - all software was updated just now. Beta OS 10.14.6.

It lists the possible frame rates after including this one:
[avfoundation @ 0x7fd53e800000] 1280x720@[29.970000 29.970000]fps

Pretty close. Any ideas?

THANKS

 -M

DEBUG 2019/06/01 22:17:08 resource.go:43: 192.168.178.25:62321 POST /resource
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-indev=jack --enable-opencl --disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox --enable-sdl2 --disable-securetransport --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-x86asm --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfdk-aac
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[avfoundation @ 0x7fd53e800000] Selected framerate (30.000000) is not supported by the device

v0.0.7 doesn't fix the no response

After i make the compilation new at the closed issue, the camera worked around for 2 hours.
But now there's no connection recevied, then i downloaded the new Version of HKCam 0.0.7 and flash it with etcher, that's the result...
IMG_1CC7A31B9DFD-1

No camera connection via 4G mobil

I set up a HKcam with the version 0.0.9 - and it works fine when I am in the same wifi. When I deactivate the wifi and try to activate the camera via 4G both apps (HomeKit and Home 3) quickly show the message: "Keine Antwort - Die Kamera antwortet nicht."

I used the fix with the minimum bitrate to boost image quality, but also when I set the bitrate down to 5 (from 800), still I get the same message... do someone have an idea what the problem is?

Ps.: I change the hostname, because I have another pi in my network...

Picture quality pi zero

Hello first off brilliant bit of code. Do you have recommended settings for the pi zero? The picture quality is very grainy and slow fps. Thanks

RTSP Stream URL available?

Hey guys,

any chance I can access the stream via URL at a Windows PC (for example with VLC).

URL and Port needed?

/dev/video1: No such file or directory

After getting everything working 100% again, I started tinkering around with the core Pi software and somehow managed to break it again. After expanding my disk size in raspi-config, I know that I: updated the locale, WiFi frequencies, time zone, cleared apt update files, updated Pi firmware, and renamed the host back to raspberrypi.local from raspberrypi-2.local.

Log files show obvious error of:

/dev/video1: No such file or directory

Checking the devices, I see:

video0
video10
video11
video12

But, obviously no video1. Not sure how to re-assign device IDs

Raw log:

pi@raspberrypi:/var/log/hkcam $ vcgencmd get_camera
supported=1 detected=1
pi@raspberrypi:/var/log/hkcam $ tail -f current
2019-06-01_20:12:47.95427 libavcodec 57. 64.101 / 57. 64.101
2019-06-01_20:12:47.95448 libavformat 57. 56.101 / 57. 56.101
2019-06-01_20:12:47.95467 libavdevice 57. 1.100 / 57. 1.100
2019-06-01_20:12:47.95487 libavfilter 6. 65.100 / 6. 65.100
2019-06-01_20:12:47.95528 libavresample 3. 1. 0 / 3. 1. 0
2019-06-01_20:12:47.95553 libswscale 4. 2.100 / 4. 2.100
2019-06-01_20:12:47.95574 libswresample 2. 3.100 / 2. 3.100
2019-06-01_20:12:47.95593 libpostproc 54. 1.100 / 54. 1.100
2019-06-01_20:12:47.99827 [video4linux2,v4l2 @ 0x1cfa310] Cannot open video device /dev/video1: No such file or directory
2019-06-01_20:12:47.99890 /dev/video1: No such file or directory
2019-06-01_20:12:54.66859 DEBUG 2019/06/01 16:12:54 resource.go:43: [2604:2000:1483:4ee:9540:20e7:836f:7841]:49162 POST /resource
2019-06-01_20:12:56.13406 ffmpeg version 3.2.14-1deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers
2019-06-01_20:12:56.13542 built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
2019-06-01_20:12:56.13626 configuration: --prefix=/usr --extra-version='1
deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
2019-06-01_20:12:56.13944 libavutil 55. 34.101 / 55. 34.101
2019-06-01_20:12:56.14053 libavcodec 57. 64.101 / 57. 64.101
2019-06-01_20:12:56.14159 libavformat 57. 56.101 / 57. 56.101
2019-06-01_20:12:56.14281 libavdevice 57. 1.100 / 57. 1.100
2019-06-01_20:12:56.14389 libavfilter 6. 65.100 / 6. 65.100
2019-06-01_20:12:56.14663 libavresample 3. 1. 0 / 3. 1. 0
2019-06-01_20:12:56.14836 libswscale 4. 2.100 / 4. 2.100
2019-06-01_20:12:56.14945 libswresample 2. 3.100 / 2. 3.100
2019-06-01_20:12:56.15053 libpostproc 54. 1.100 / 54. 1.100
2019-06-01_20:12:56.16087 [video4linux2,v4l2 @ 0x9101e0] Cannot open video device /dev/video1: No such file or directory
2019-06-01_20:12:56.16240 /dev/video1: No such file or directory
2019-06-01_20:12:56.19036 DEBUG 2019/06/01 16:12:56 ffmpeg.go:181: Active sesssions map[E??;Mͦ???b8?:0x14b2500]
2019-06-01_20:12:56.19139 INFO 2019/06/01 16:12:56 resource.go:45: r.imgFn() exit status 1
2019-06-01_20:13:06.26429 DEBUG 2019/06/01 16:13:06 resource.go:43: [2604:2000:1483:4ee:9540:20e7:836f:7841]:49162 POST /resource
2019-06-01_20:13:07.72437 ffmpeg version 3.2.14-1deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers
2019-06-01_20:13:07.72576 built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
2019-06-01_20:13:07.72659 configuration: --prefix=/usr --extra-version='1
deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
2019-06-01_20:13:07.72987 libavutil 55. 34.101 / 55. 34.101
2019-06-01_20:13:07.73099 libavcodec 57. 64.101 / 57. 64.101
2019-06-01_20:13:07.73207 libavformat 57. 56.101 / 57. 56.101
2019-06-01_20:13:07.73366 libavdevice 57. 1.100 / 57. 1.100
2019-06-01_20:13:07.73600 libavfilter 6. 65.100 / 6. 65.100
2019-06-01_20:13:07.73708 libavresample 3. 1. 0 / 3. 1. 0
2019-06-01_20:13:07.73816 libswscale 4. 2.100 / 4. 2.100
2019-06-01_20:13:07.74082 libswresample 2. 3.100 / 2. 3.100
2019-06-01_20:13:07.74401 libpostproc 54. 1.100 / 54. 1.100
2019-06-01_20:13:07.75213 [video4linux2,v4l2 @ 0xdf71e0] Cannot open video device /dev/video1: No such file or directory
2019-06-01_20:13:07.75419 /dev/video1: No such file or directory
2019-06-01_20:13:07.78219 DEBUG 2019/06/01 16:13:07 ffmpeg.go:181: Active sesssions map[E??;Mͦ???b8?:0x14b2500]
2019-06-01_20:13:07.78323 INFO 2019/06/01 16:13:07 resource.go:45: r.imgFn() exit status 1
2019-06-01_20:13:14.75006 DEBUG 2019/06/01 16:13:14 characteristics.go:48: [2604:2000:1483:4ee:9540:20e7:836f:7841]:49162 PUT /characteristics
2019-06-01_20:13:14.75258 DEBUG 2019/06/01 16:13:14 characteristic_controller.go:76: {"characteristics":[{"aid":1,"iid":18,"value":"ARUCAQABEEWM5ok7EU3NpskZP7xiOLQ="}]}
2019-06-01_20:13:14.75868 DEBUG 2019/06/01 16:13:14 setup.go:53: {Command:{Identifier:[69 140 230 137 59 17 77 205 166 201 25 63 188 98 56 180] Type:0} Video:{CodecType:0 CodecParams:{Profiles:[] Levels:[] Packetizations:[]} Attributes:{Width:0 Height:0 Framerate:0} RTP:{PayloadType:0 Ssrc:0 Bitrate:0 Interval:0 ComfortNoisePayloadType:0 MTU:0}} Audio:{CodecType:0 CodecParams:{Channels:0 Bitrate:0 Samplerate:0} RTP:{PayloadType:0 Ssrc:0 Bitrate:0 Interval:0 ComfortNoisePayloadType:0 MTU:0} ComfortNoise:false}}
2019-06-01_20:13:14.76144 DEBUG 2019/06/01 16:13:14 stream.go:28: stop stream
2019-06-01_20:13:14.76376 DEBUG 2019/06/01 16:13:14 ffmpeg.go:113: Stopping loopback
2019-06-01_20:13:17.81144 DEBUG 2019/06/01 16:13:17 resource.go:43: [2604:2000:1483:4ee:9540:20e7:836f:7841]:49162 POST /resource
2019-06-01_20:13:19.78472 ffmpeg version 3.2.14-1deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers
2019-06-01_20:13:19.79914 built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
2019-06-01_20:13:19.80006 configuration: --prefix=/usr --extra-version='1
deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
2019-06-01_20:13:19.80183 libavutil 55. 34.101 / 55. 34.101
2019-06-01_20:13:19.80329 libavcodec 57. 64.101 / 57. 64.101
2019-06-01_20:13:19.80417 libavformat 57. 56.101 / 57. 56.101
2019-06-01_20:13:19.80503 libavdevice 57. 1.100 / 57. 1.100
2019-06-01_20:13:19.80602 libavfilter 6. 65.100 / 6. 65.100
2019-06-01_20:13:19.80689 libavresample 3. 1. 0 / 3. 1. 0
2019-06-01_20:13:19.80780 libswscale 4. 2.100 / 4. 2.100
2019-06-01_20:13:19.80868 libswresample 2. 3.100 / 2. 3.100
2019-06-01_20:13:19.81025 libpostproc 54. 1.100 / 54. 1.100
2019-06-01_20:13:20.57459 Input #0, video4linux2,v4l2, from '/dev/video0':
2019-06-01_20:13:20.57895 Duration: N/A, start: 771.007976, bitrate: 283115 kb/s
2019-06-01_20:13:20.58114 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1024x768, 283115 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
2019-06-01_20:13:20.58485 [v4l2 @ 0x69e010] Unable to open V4L2 device '/dev/video1'
2019-06-01_20:13:20.59651 Could not write header for output file #0 (incorrect codec parameters ?): No such file or directoryStream mapping:
2019-06-01_20:13:20.59775 Stream #0:0 -> #0:0 (copy)
2019-06-01_20:13:20.75031 Last message repeated 1 times
2019-06-01_20:13:20.99638 ffmpeg version 3.2.14-1deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers
2019-06-01_20:13:20.99766 built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
2019-06-01_20:13:20.99847 configuration: --prefix=/usr --extra-version='1
deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
2019-06-01_20:13:21.00183 libavutil 55. 34.101 / 55. 34.101
2019-06-01_20:13:21.00295 libavcodec 57. 64.101 / 57. 64.101
2019-06-01_20:13:21.00402 libavformat 57. 56.101 / 57. 56.101
2019-06-01_20:13:21.00517 libavdevice 57. 1.100 / 57. 1.100
2019-06-01_20:13:21.00628 libavfilter 6. 65.100 / 6. 65.100
2019-06-01_20:13:21.00736 libavresample 3. 1. 0 / 3. 1. 0
2019-06-01_20:13:21.00844 libswscale 4. 2.100 / 4. 2.100
2019-06-01_20:13:21.00951 libswresample 2. 3.100 / 2. 3.100
2019-06-01_20:13:21.01059 libpostproc 54. 1.100 / 54. 1.100
2019-06-01_20:13:21.01751 [video4linux2,v4l2 @ 0x145b1e0] Cannot open video device /dev/video1: No such file or directory
2019-06-01_20:13:21.01907 /dev/video1: No such file or directory
2019-06-01_20:13:21.04581 DEBUG 2019/06/01 16:13:21 ffmpeg.go:186: Stopping loopback
2019-06-01_20:13:21.04655 INFO 2019/06/01 16:13:21 resource.go:45: r.imgFn() exit status 1
^C

Suction cap wanted

Like I mentioned on Twitter, a suction cap for glass surfaces would be awesome for the cam enclosure!

[Solved] Ansible issue

When I try to run the playbook on my Rasp3B, I get this error:

pi@raspicam:~/hkcam/ansible $ ansible-playbook rpi.yml -i hosts --ask-pass
SSH password:
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in '/home/pi/hkcam/ansible/roles/hkcam/tasks/configure.yml': line 41, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  • name: Reboot
    ^ here

Connecting... on Apple Watch

Hi @brutella ,

Not sure whether HKCam should work on Apple Watch (4), but currently only Still Image seems to work, when Live video is requested, my Apple Watch remains "Connecting ..."

Same as reported here by @iMartzen

hundreds of defunct ffmpeg processes over night

Yesterday I've updated my two hkcams to 0.0.9 and had them run over night, with Apple's Home app running on my Mac, displaying the output of both cameras. Today, live video wouldn't start on both hkcams, while the regular snapshots would still come in.

I ssh-ed into the systems to find a large number of defunct ffmpeg processes:

root      1397   464  0 00:39 ?        00:00:02 [ffmpeg] <defunct>
root      1399   464  0 00:40 ?        00:00:02 [ffmpeg] <defunct>
root      1401   464  0 00:40 ?        00:00:02 [ffmpeg] <defunct>
root      1403   464  0 00:40 ?        00:00:02 [ffmpeg] <defunct>
root      1405   464  0 00:40 ?        00:00:02 [ffmpeg] <defunct>
root      1408   464  0 00:41 ?        00:00:02 [ffmpeg] <defunct>
root      1410   464  0 00:41 ?        00:00:02 [ffmpeg] <defunct>

In case of one camera, within 11 hours, there were over 500 of these.

Parent of those defunct processes is hkcam --data_dir=/var/lib/hkcam/data --verbose=true

Here's my configuration:

wpa_supplicant.conf:

country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="MYSSID"
scan_ssid=1
psk="MYPASSWORD"
key_mgmt=WPA-PSK
}

/etc/sv/hkcam/run:

#!/bin/sh -e
exec 2>&1
v4l2-ctl --set-fmt-video=width=1280,height=720,pixelformat=YU12
exec hkcam --min_video_bitrate=500 --data_dir=/var/lib/hkcam/data --verbose=true

I thought the min bitrate setting was the culprit, but removing --min_video_bitrate=500 from /etc/sv/hkcam/run and rebooting didn't seem to have an effect on the growth rate of defunct ffmpeg processes.

The number of ffmpeg defunct processes only seems to grow if I poll the camera snapshots via an app. (Apple's home app or other doesn't matter). The number will not grow if nothing asks for camera output.

Let me know if you'd like any debug information.

Kernel Panic Issue

I got some kernel panic after a fresh install of your image or on a classic image. After hours I found that reducing the clock speed to 950 in the config.txt solved the problem. Just to let you know. Amazing work thanks for everything !! 👍

Auto exposure

Things look good inside, but if I point the camera out the window everything gets blown out. Is there auto exposure?

Camera resolution

I've got a Raspberry Camera 2.1 (8 MP), but the video quality is very low and everything is pixelated.
It looks like the streaming is set to 1024x768, and the real fps is 5:

2019-06-12_16:06:30.32669 Stream #0:0: Video: h264 (h264_omx), yuv420p, 1024x768, q=2-31, 299 kb/s, 30 fps, 90k tbn, 30 tbc

frame= 36 fps=3.7 q=-1.0 size=N/A time=00:00:09.37 bitrate=N/A speed=0.977x speed=0.956x .994x

Any way to tune this?

Screenshot 2019-06-12 at 17 03 16

USB Camera MJPG and YUYV Compatibility

Is HKCam compatible USB Webcam where the only format I uses is YUYV and MJPG ?

Capture d’écran 2019-06-11 à 18 02 30
Because on this line I see that hkcam is taking yuy2 input stream.
Capture d’écran 2019-06-11 à 18 03 53

Because the snapshot is working, but not the direct stream.

Setting res to 1080p doesn't work

In the hkcam start script setting the resolution to 720p allows the camera to start up and work.

However setting to 1080p does not allow the camera to start.

v4l2-ctl --set-fmt-video=width=1280,height=720,pixelformat=YU12 - works

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=YU12 - does not work

No response for live video

First of all, thanks for this great peace of software!

I have flashed raspbian-stretch-lite-2019-04-08-hkcam-v0.0.6-armv6.img and all seemed to work fine for less than a day, but after that Live shows "No Response" as shown below. Still image remains to work.

Rebooting the Raspberry PI zero w fixes the issue, but comes back in within a day.

IMG_1410

IMG_1411

Motion sensor version

I'd like to use this with a HC-SR501 Motion Sensor built-in (connected to the Pi 0).Would you consider adding support for that? Both in the software as well as an edited version of the hardware enclosure to make room for the sensor?

Multiple Camera's

Great Work Matthias !!

Thank you for your continued iterations of HomeKit bettering products
Can you indicate how to run multiple camera's
Presumably one must change the MAC address and perhaps the 001-02-003 code?

PS setting up wifi requires setting the country in the wpa_supplicant.conf

The below worked for me:

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="your_real_wifi_ssid"
scan_ssid=1
psk="your_real_password"
key_mgmt=WPA-PSK
}

Best update method?

I'm wondering what the best update method is going to be for this project. Thinking about installing git on each camera so I can periodically pull down updates or perhaps schedule them with cron.

@brutella - any thoughts on how one might update say 10 cameras?

runsvdir issue at boot

When I boot any of the cameras (regardless it's a zero or 3), I get this error and the steaming doesn't work:

pi@zerocam:~ ps aux | grep hkcam
root 1516 0.0 0.2 1864 972 ? Ss 17:03 0:00 runsvdir -P /etc/service log: unable to lock supervise/lock: temporary failure runsv hkcam: fatal: unable to lock supervise/lock: temporary failure runsv hkcam: fatal: unable to lock supervise/lock: temporary failure runsv hkcam: fatal: unable to lock supervise/lock: temporary failure runsv hkcam: fatal: unable to lock supervise/lock: temporary failure runsv hkcam: fatal: unable to lock supervise/lock: temporary failure

If I kill the process, it starts again and everything gets fixed.

I'm using 0.0.9

Can't access hkcam with Apple's Home app

Hello,

I've downloaded latest raspbian image - here and installed it on rpi zero w with Noir Camera.
Only info I have in logs are :

pi@raspberrypi:~ $ tail -f /var/log/hkcam/current
2019-06-04_07:33:04.93116 DEBUG 2019/06/04 08:33:04 camera_control.go:194: {"assets":[]}
2019-06-04_07:33:04.94253 INFO 2019/06/04 08:33:04 ip_transport.go:186: Listening on port 43325

Camera works, cause I can take pictures with it and record video ( with raspistill and raspivid).

When I open a Home app ( Apple's one) I can see the camera, it also asks me for the pin when I connect to it. But after that, nothing happens. I get "Couldn't add Camera" message.

Where I can look for additional info about this ?

IMG_1245
IMG_1246

Ansible hangs on Task Gathering Facts

Hi there,

The Ansible script hangs on my High Sierra Mac. I'm not seeing any errors. Not sure what is wrong. I have the latest Raspbian Lite image installed and running with SSH enabled on a RPi 2B.

This is the Ansible -vvvv output:

ansible-playbook 2.8.1
  config file = None
  configured module search path = ['/Users/stephan/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.8.1/libexec/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.7.3 (default, Mar 27 2019, 09:23:39) [Clang 10.0.0 (clang-1000.11.45.5)]
No config file found; using defaults
SSH password:
setting up inventory plugins
host_list declined parsing /Users/stephan/Developer/hkcam/ansible/hosts as it did not pass it's verify_file() method
script declined parsing /Users/stephan/Developer/hkcam/ansible/hosts as it did not pass it's verify_file() method
auto declined parsing /Users/stephan/Developer/hkcam/ansible/hosts as it did not pass it's verify_file() method
Parsed /Users/stephan/Developer/hkcam/ansible/hosts inventory source with ini plugin
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/hkcam/tasks/install.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/hkcam/tasks/configure.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/runit/tasks/install.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/runit/tasks/add.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/runit/tasks/enabled.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/runit/tasks/envs.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/runit/tasks/state.yml
Loading callback plugin default of type stdout, v2.0 from /usr/local/Cellar/ansible/2.8.1/libexec/lib/python3.7/site-packages/ansible/plugins/callback/default.py

PLAYBOOK: rpi.yml **************************************************************
Positional arguments: rpi.yml
verbosity: 4
ask_pass: True
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/Users/stephan/Developer/hkcam/ansible/hosts',)
forks: 5
1 plays in rpi.yml

PLAY [rpi] *********************************************************************

TASK [Gathering Facts] *********************************************************
task path: /Users/stephan/Developer/hkcam/ansible/rpi.yml:2
<raspberrypi.local> ESTABLISH SSH CONNECTION FOR USER: pi
<raspberrypi.local> SSH: EXEC sshpass -d43 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="pi"' -o ConnectTimeout=10 -o ControlPath=/Users/stephan/.ansible/cp/5fce5d2568 raspberrypi.local '/bin/sh -c '"'"'echo ~pi && sleep 0'"'"''

I have sshpass 1.06 installed:

sshpass -V
sshpass 1.06
(C) 2006-2011 Lingnu Open Source Consulting Ltd.
(C) 2015-2016 Shachar Shemesh
This program is free software, and can be distributed under the terms of the GPL
See the COPYING file for more information.

Using "assword" as the default password prompt indicator.

connection.go:112: Close connection and remove session

I have a few hkcams in my home for a few weeks now. I've been testing the various models of Raspberry Pis and have had successfully working cameras in a Pi Zero W, Pi 3 B, and an original Pi Model B (same SOC as Pi Zero W IIRC). All work well, with the Pi 3 B being the most responsive, as expected. All were setup with the Ansible script on a fresh install of Raspbian Stretch.

I have been noticing in the last few days that they are tending to "lock up." The pi isn't "frozen," but the Homekit video is giving me the "No Response" error. Restarting the hkcam process corrects the issue. It might function fine for a few days, hours or minutes, but it usually repeats.

Here is a tail of the hkcam logfile at the moment it stops responding:

2019-07-19_12:36:46.24430 Press [q] to stop, [?] for help
2019-07-19_12:36:46.28123 frame= 1 fps=0.0 q=3.8 Lsize=N/A time=00:00:00.03 bitrate=N/A speed=0.907x
2019-07-19_12:36:46.28134 video:10kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
2019-07-19_12:36:46.31362 DEBUG 2019/07/19 08:36:46 loopback.go:54: Stopping loopback
2019-07-19_12:36:46.31949 frame= 8 fps=0.0 q=-1.0 Lsize=N/A time=00:00:00.63 bitrate=N/A speed=2.62x
2019-07-19_12:36:46.31954 video:10800kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
2019-07-19_12:36:46.34753 Exiting normally, received signal 2.
2019-07-19_12:36:55.88564 DEBUG 2019/07/19 08:36:55 connection.go:112: Close connection and remove session
2019-07-19_12:37:45.95535 DEBUG 2019/07/19 08:37:45 connection.go:112: Close connection and remove session
2019-07-19_12:37:46.05827 DEBUG 2019/07/19 08:37:46 connection.go:112: Close connection and remove session

I've done some digging and see that the error message comes from the hc dependency. I'm not sure why it is being called. Cleanup of network connections can be a good thing, but is this closing of the connection expected behavior?

Enclosure source files

Would you be able/willing to provide CAD source files for the enclosure? It would be nice to be able to customize the enclosure (for example, I was thinking of trying to add an IR illuminator for night vision) but STLs aren’t great for editing.

UI corners of Snapshot

The Snapshot should be cut to the correct resolution (according to Apple HomeKit certifications) so the corners are round (see left camera) and not edged (right camera). Actually this should be done with ffmpeg and resizing the video as well, because after opening and closing the live stream it will take the last image of the live stream as snapshot which is in this case "too big as well" and shows edged. This takes however a lot of resources, probably not very suitable for the Raspberry Pi Zero.
Screenshot 2019-06-24 at 13 01 23

Add switch to disable camera (Snapshot and Live)

For privacy reasons it would be nice to have a switch to disable the camera. The camera should then provide no image or maybe simply a black one. The switch then could also be automated with "I leave home"/"I arrive at home".

In the current version there is some kind of switch present, however its functionality is not clear to me. What's the purpose of this switch?
switch

no video fresh install

Just installed 0.0.7 manually and ran ansinble playbook. Was able to add camera into Home app, but it shows no video. From logs it seems that Pi Zero W fails to do something..

2019-06-01_02:52:26.47151 DEBUG 2019/06/01 03:52:26 resource.go:43: IPADDRESS:61447 POST /resource
2019-06-01_02:52:28.39989 ffmpeg version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers
2019-06-01_02:52:28.40043   built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
2019-06-01_02:52:28.40070   configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
2019-06-01_02:52:28.40166   libavutil      55. 34.101 / 55. 34.101
2019-06-01_02:52:28.40785   libavcodec     57. 64.101 / 57. 64.101
2019-06-01_02:52:28.40813   libavformat    57. 56.101 / 57. 56.101
2019-06-01_02:52:28.40833   libavdevice    57.  1.100 / 57.  1.100
2019-06-01_02:52:28.40854   libavfilter     6. 65.100 /  6. 65.100
2019-06-01_02:52:28.40873   libavresample   3.  1.  0 /  3.  1.  0
2019-06-01_02:52:28.40893   libswscale      4.  2.100 /  4.  2.100
2019-06-01_02:52:28.40923   libswresample   2.  3.100 /  2.  3.100
2019-06-01_02:52:28.40943   libpostproc    54.  1.100 / 54.  1.100
2019-06-01_02:52:29.19775 Input #0, video4linux2,v4l2, from '/dev/video0':
2019-06-01_02:52:29.19788   Duration: N/A, start: 68.484604, bitrate: 283115 kb/s
2019-06-01_02:52:29.19792     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1024x768, 283115 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
2019-06-01_02:52:29.20131 Output #0, v4l2, to '/dev/video1':
2019-06-01_02:52:29.20784   Metadata:
2019-06-01_02:52:29.20811     encoder         : Lavf57.56.101
2019-06-01_02:52:29.20900     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1024x768, q=2-31, 283115 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
2019-06-01_02:52:29.21008 Stream mapping:
2019-06-01_02:52:29.21028   Stream #0:0 -> #0:0 (copy)
2019-06-01_02:52:29.21066 Press [q] to stop, [?] for help
2019-06-01_02:52:29.72041 frame=    3 fps=0.0 q=-1.0 size=N/A time=00:00:00.42 bitrate=N/A speed=0.836x    ^MDEBUG 2019/06/01 03:52:29 ffmpeg.go:186: Stopping loopback
2019-06-01_02:52:29.78914 INFO 2019/06/01 03:52:29 resource.go:45: r.imgFn() signal: bus error
2019-06-01_02:52:29.79907 frame=    3 fps=0.0 q=-1.0 Lsize=N/A time=00:00:00.42 bitrate=N/A speed=0.723x
2019-06-01_02:52:29.79940 video:3456kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
2019-06-01_02:52:29.91517 Exiting normally, received signal 2.

What am I doing wrong?

Update snapshot on view

This tool is a great alternative to other Homebridge based options, but one thing the Homebridge alternatives seem to do that this one doesn’t is update the Home app’s preview snapshot of the camera when look at it in the Room or House screen. Is this a possible future feature for hkcam?

Thanks again.

No stream from MacBook iSight

When using my iSight cam on my MacBook I cannot get a stream to homekit, in terminal I receive the following message: [avfoundation @ 0x7fd349000000] Selected framerate (30.000000) is not supported by the device

It shows the following frame rates are possible:
[avfoundation @ 0x7fd349000000] 1280x720@[29.970000 29.970000]fps
[avfoundation @ 0x7fd349000000] 1280x720@[25.000000 25.000000]fps
[avfoundation @ 0x7fd349000000] 1280x720@[23.999981 23.999981]fps
[avfoundation @ 0x7fd349000000] 1280x720@[14.999993 14.999993]fps

Is it possible to change the frame rate? Or can it possibly be an other issue?

How to install on Rasbian Buster?

Is all working with freshly released Rasbian Buster? Which is the preferred way for fresh install and which are known to work? hkcam image and apt upgrade, official Rasbian Buster and hkcam ansible or official Rasbian Buster and manual installation?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.