mmcc-xx / BirdCAGE

180 stars 18 forks source link

See it in action

This demo deployment is listening in to the Cornell Lab FeederWatch Cam at Sapsucker Woods and proving real time identification of the birds it hears.

Install it yourself

BirdCAGE Screenshot

Newest stuff

(listed newest first)

BirdCAGE

BirdCAGE is an application for monitoring the bird songs in audio streams. Security cameras often provide rtsp and rtmp streams that contain both video and audio. Feed the audio into BirdCAGE and see what sorts of birds are hanging around.

BirdCAGE was strongly inspired by BirdNET-Pi, but with the constraints of running in a Rasberry Pi removed. It utilizes a slightly patched version of the analysis server provided by the BirdNET-Analyzer project.

BirdCAGE is written in Python and was designed to be containerizable. It utilizes a separate back end and front end application. The back end application records streams, calls the analysis server, stores results, and serves as an API server for the front end application. The front end provides the UI. The back end application uses celery to spin up separate tasks for stream recording and analyzing and analysis. A Redis container is used to coordinate the tasks.

This is early days. Chances are things will break. Let me know what's broke in the Discussions or in an Issue or an angry letter or whatever.

To Do

Installing as an addon for home assistant

Word of warning, this will use the concept of docker out of docker. HA doesn't nativly (yet) support docker-compose. So this is a work around. The addon needs access to the docker api, thus the score will be 1 and protection will have to be removed. It will also generate an 'unsupport system' error because you are creating containers that aren't supervised. If updating or submitting issues to the HA dev team, stop the addon and restart HA.

How it works

Because HA doesn't support docker-compose, this addons is mainly a hack. All it does is spin up a container with docker / docker_compose installed. Then uses the S6 overlay to issue a docker-compose pull the up command as a start script. It also funnels the logs to bashio. On stopping the addon, the kill timeout is set to 60 seconds to allow the docker-compose down script to properly finish.

How to install

Files

The db and recodings are saved in the share folder. You can sqlite the db and extract for personal analysis.

Debugging

If it complains or doesn't start after a while (be carefull as it's pulling a couple docker images that are quite large). Use portainer and check whats going on. You can access the bash of the addon container through portainer, and check whats going on. It usally has to do with either ports or the share volumes not being there.

Todo for HA addon