BirdWatch 0.1

Copyright (C) 2021 - Hammer Data Systems, LLC

BirdWatch uses FLTK 1.3.4 (C) 1996-2021 - Bill Spitzak and others.

Please take no undeserved credit and assign me absolutely no blame. Otherwise, this a free program, download, redistribute, and use at your own risk.

BirdWatch dynamically links to OpenCV and FFMPeg and through them, to many other dynamic libraries. Getting this program running is a bit of a chore. Sorry about that, but I would rather spend my time working on the program itself than figuring out ways to install all these libraries without tears. I am afraid that I have to let that be someone else's problem. I have supplied the output of ldd at the bottom of this page. Most of these libraries should already be installed on most linux desktop systems or will be installed automatically as you install others. Almost all are readily available in most distribution's repositories.

Download

BirdWatch

Birdwatch is a audio/video program for recording from video cameras and microphones and encoding the result into a compressed video file. It can record from USB cameras and IP cameras using rstp.


The .zip file contains an excutable for Linux,



In the center of the screen, the live image from the default or selected camera appears. Along the left edge, live thumbnail images from all active cameras appear. Selecting a camera from the active thumbnail causes that camera's signal to become the center, recorded, signal. Next to the active camera thumbnails is a menu of all available audio signals, usually connected microphones. This menu appears whenever the system is not actively recording.


If the mouse is moved near the right edge of the screen, a menu appears that allows the user to turn on record, recoding via motion detection, turn on and off a visible timestamp, show various kinds of motion detection diagnostics, review and edit recorded footage, snap a still image, zoom, set areas of interest for motion detection, reset the raw recording (if you have no intention of encoding it into a video file), split the screen between the active cameras, select new video sources, resize the capture area (for follow motion mode), change video settings, flip the screen, and load and save interest areas for motion detection.


The video previewer / editor is a standalone window that allows simple selection of segments the user wishes to retain in the encoded video. Both audio and video are edited. Selecting the red button causes the raw audio and video files to be encoded using the selected segments. There is a scrubber that allows the user to scroll to particular portions of the video, as well as speed control for playback and encoding. There is a play button that ignores edits and another that plays only the selected portions. If no portions are selected, the entire raw file is encoded.


Here the standalone previewer / editor is seen on the desktop with the main window minimized.


The main screen can be split and the user can monitor and select each of the active cameras.


Hovering the mouse over any the active camera thumbnails causes a larger preview window to appear showing the live image from that camera.


By clicking on segments of the divided main screen, the user can select areas of interest for the motion detector. It only triggers recording if there is motion detected in the selected areas.


If the system is running in "main" mode, follow motion is available. Only the selected portion of the screen is recorded. The user can move the hightlighted box to follow the action by hand or can turn on automatic follow motion to have the system attempt to keep the recorded segment on the area with the largest motion.


The video settings allow the user to change the usual contrast, brightness, etc., as well as the encoding frames per second for fast and slow motion, and the largeness of motion necessary to trigger the motion detector.

Birdwatch creates large ".bin" files containing the raw audio and video data. The raw audio is stored in mono, 16 bit, 22100 hz. The raw data is preceeded by a single 32 bit integer containing the frequency. The raw video file is collection of timestamped uncompressed RGB frames, with a small header containing the FPS, width, height, and depth. If the output is edited before being encoded, additional raw files are created contain the included frames and audio segments. Be warned, the raw video files, being uncompressed, can use a lot of disk space very quickly.

The encoded files default to a ".mov" container and are named using the date and time.


Command line arguments:

birdwatch [--source=[N|URL]][--width=n][--height=n][--help] (etc...)
examples:

# Use the default USB webcam
webcam

# Use an IP camera at a RTSP URL with login and password
webcam --source=rtsp://your_login:your_password@url_for_your_webcam.org/live

# Use USB camera number 4
webcam --source=4

# Set preferred video width to 640
webcam --width=640

# Set preferred video height to 480
webcam --height=480

# Set the FPS to a specific value, avoiding testing
webcam --fps=18

# Split the main screen between all the video sources
webcam --split

# Start recording with the main screen
webcam --main

# Do not buffer frames and audio for later encoding.
video is recorded to MJPEG in MKV.
webcam --unbuffered

# Send frames directly to Theora for live recording.
webcam --direct_theora

# Record audio and video and "mux" the result to a MPEG file
webcam --muxing

# Flip horizontally or vertically or both
webcam --flip=horizontal --flip=vertical

# Record and encode audio (turned on automatically if muxing)
webcam --audio

# Reopen old .bin (temporary files) to encode. Record is turned off.
webcam --old

# Do not scan for USB cameras.
webcam --no_scan


Output from ldd (list of libraries):

	linux-vdso.so.1 (0x00007ffe625f5000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2e1e2cc000)
	libopencv_imgproc.so.4.5 => /usr/local/lib/libopencv_imgproc.so.4.5 (0x00007f2e1c75b000)
	libopencv_videoio.so.4.5 => /usr/local/lib/libopencv_videoio.so.4.5 (0x00007f2e1c6b8000)
	libopencv_core.so.4.5 => /usr/local/lib/libopencv_core.so.4.5 (0x00007f2e1b433000)
	libopencv_imgcodecs.so.4.5 => /usr/local/lib/libopencv_imgcodecs.so.4.5 (0x00007f2e1b3d2000)
	libtheora.so.0 => /usr/lib/x86_64-linux-gnu/libtheora.so.0 (0x00007f2e1b382000)
	libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f2e1b373000)
	libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f2e1b345000)
	libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f2e1b29a000)
	libvorbisfile.so.3 => /usr/lib/x86_64-linux-gnu/libvorbisfile.so.3 (0x00007f2e1b28f000)
	liboggz.so.2 => /usr/local/lib/liboggz.so.2 (0x00007f2e1b27e000)
	libportaudio.so.2 => /usr/local/lib/libportaudio.so.2 (0x00007f2e1b24b000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2e1b226000)
	libavutil.so.56 => /usr/lib/x86_64-linux-gnu/libavutil.so.56 (0x00007f2e1b0fd000)
	libavformat.so.58 => /usr/lib/x86_64-linux-gnu/libavformat.so.58 (0x00007f2e1ae85000)
	libavcodec.so.58 => /usr/lib/x86_64-linux-gnu/libavcodec.so.58 (0x00007f2e198c4000)
	libswresample.so.3 => /usr/lib/x86_64-linux-gnu/libswresample.so.3 (0x00007f2e198a2000)
	libswscale.so.5 => /usr/lib/x86_64-linux-gnu/libswscale.so.5 (0x00007f2e1980d000)
	libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f2e19802000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2e19620000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2e194d1000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2e194b6000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2e192c4000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f2e1e339000)
	libmvec.so.1 => /lib/x86_64-linux-gnu/libmvec.so.1 (0x00007f2e19298000)
	libdc1394.so.22 => /usr/lib/x86_64-linux-gnu/libdc1394.so.22 (0x00007f2e1921e000)
	libgstbase-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0 (0x00007f2e191a0000)
	libgstreamer-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 (0x00007f2e19059000)
	libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f2e18ff9000)
	libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f2e18ed0000)
	libgstapp-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstapp-1.0.so.0 (0x00007f2e18ebe000)
	libgstriff-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstriff-1.0.so.0 (0x00007f2e18eab000)
	libgstpbutils-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstpbutils-1.0.so.0 (0x00007f2e18e6d000)
	libgstvideo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0 (0x00007f2e18dbc000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f2e18db1000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2e18d95000)
	libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f2e18d0e000)
	libwebp.so.6 => /usr/lib/x86_64-linux-gnu/libwebp.so.6 (0x00007f2e18ca4000)
	libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f2e18c6c000)
	libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f2e18beb000)
	libopenjp2.so.7 => /usr/lib/x86_64-linux-gnu/libopenjp2.so.7 (0x00007f2e18b95000)
	libIlmImf-2_3.so.24 => /usr/lib/x86_64-linux-gnu/libIlmImf-2_3.so.24 (0x00007f2e188b6000)
	libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f2e18791000)
	libasound.so.2 => /usr/lib/x86_64-linux-gnu/libasound.so.2 (0x00007f2e18696000)
	libjack.so.0 => /usr/lib/x86_64-linux-gnu/libjack.so.0 (0x00007f2e1864a000)
	libva-drm.so.2 => /usr/lib/x86_64-linux-gnu/libva-drm.so.2 (0x00007f2e18645000)
	libva.so.2 => /usr/lib/x86_64-linux-gnu/libva.so.2 (0x00007f2e1861c000)
	libva-x11.so.2 => /usr/lib/x86_64-linux-gnu/libva-x11.so.2 (0x00007f2e18612000)
	libvdpau.so.1 => /usr/lib/x86_64-linux-gnu/libvdpau.so.1 (0x00007f2e1860c000)
	libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f2e184cf000)
	libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f2e184bb000)
	libOpenCL.so.1 => /usr/local/cuda-11.2/lib64/libOpenCL.so.1 (0x00007f2e182b4000)
	libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f2e180fa000)
	libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f2e180e5000)
	libgme.so.0 => /usr/lib/x86_64-linux-gnu/libgme.so.0 (0x00007f2e18098000)
	libopenmpt.so.0 => /usr/lib/x86_64-linux-gnu/libopenmpt.so.0 (0x00007f2e17eab000)
	libchromaprint.so.1 => /usr/lib/x86_64-linux-gnu/libchromaprint.so.1 (0x00007f2e17e95000)
	libbluray.so.2 => /usr/lib/x86_64-linux-gnu/libbluray.so.2 (0x00007f2e17e44000)
	libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f2e17c6e000)
	libssh-gcrypt.so.4 => /usr/lib/x86_64-linux-gnu/libssh-gcrypt.so.4 (0x00007f2e17be0000)
	libvpx.so.6 => /usr/lib/x86_64-linux-gnu/libvpx.so.6 (0x00007f2e179a8000)
	libwebpmux.so.3 => /usr/lib/x86_64-linux-gnu/libwebpmux.so.3 (0x00007f2e1799c000)
	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f2e17973000)
	libaribb24.so.0 => /usr/lib/x86_64-linux-gnu/libaribb24.so.0 (0x00007f2e17761000)
	libopencore-amrwb.so.0 => /usr/lib/x86_64-linux-gnu/libopencore-amrwb.so.0 (0x00007f2e1774b000)
	librsvg-2.so.2 => /usr/lib/x86_64-linux-gnu/librsvg-2.so.2 (0x00007f2e16e1e000)
	libzvbi.so.0 => /usr/lib/x86_64-linux-gnu/libzvbi.so.0 (0x00007f2e16d8f000)
	libsnappy.so.1 => /usr/lib/x86_64-linux-gnu/libsnappy.so.1 (0x00007f2e16d84000)
	libaom.so.0 => /usr/lib/x86_64-linux-gnu/libaom.so.0 (0x00007f2e168e6000)
	libcodec2.so.0.9 => /usr/lib/x86_64-linux-gnu/libcodec2.so.0.9 (0x00007f2e15b02000)
	libgsm.so.1 => /usr/lib/x86_64-linux-gnu/libgsm.so.1 (0x00007f2e15af3000)
	libmp3lame.so.0 => /usr/lib/x86_64-linux-gnu/libmp3lame.so.0 (0x00007f2e15a79000)
	libopencore-amrnb.so.0 => /usr/lib/x86_64-linux-gnu/libopencore-amrnb.so.0 (0x00007f2e15a4e000)
	libopus.so.0 => /usr/lib/x86_64-linux-gnu/libopus.so.0 (0x00007f2e159ef000)
	libshine.so.3 => /usr/lib/x86_64-linux-gnu/libshine.so.3 (0x00007f2e157e4000)
	libspeex.so.1 => /usr/lib/x86_64-linux-gnu/libspeex.so.1 (0x00007f2e157c6000)
	libtheoraenc.so.1 => /usr/lib/x86_64-linux-gnu/libtheoraenc.so.1 (0x00007f2e15789000)
	libtheoradec.so.1 => /usr/lib/x86_64-linux-gnu/libtheoradec.so.1 (0x00007f2e15767000)
	libtwolame.so.0 => /usr/lib/x86_64-linux-gnu/libtwolame.so.0 (0x00007f2e15741000)
	libvo-amrwbenc.so.0 => /usr/lib/x86_64-linux-gnu/libvo-amrwbenc.so.0 (0x00007f2e15725000)
	libwavpack.so.1 => /usr/lib/x86_64-linux-gnu/libwavpack.so.1 (0x00007f2e156f9000)
	libx264.so.155 => /usr/lib/x86_64-linux-gnu/libx264.so.155 (0x00007f2e1543b000)
	libx265.so.179 => /usr/lib/x86_64-linux-gnu/libx265.so.179 (0x00007f2e144cd000)
	libxvidcore.so.4 => /usr/lib/x86_64-linux-gnu/libxvidcore.so.4 (0x00007f2e143b8000)
	libsoxr.so.0 => /usr/lib/x86_64-linux-gnu/libsoxr.so.0 (0x00007f2e1434d000)
	libraw1394.so.11 => /usr/lib/x86_64-linux-gnu/libraw1394.so.11 (0x00007f2e1413e000)
	libusb-1.0.so.0 => /lib/x86_64-linux-gnu/libusb-1.0.so.0 (0x00007f2e14122000)
	libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f2e1411c000)
	libffi.so.7 => /usr/lib/x86_64-linux-gnu/libffi.so.7 (0x00007f2e1410e000)
	libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f2e1409b000)
	libgstaudio-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstaudio-1.0.so.0 (0x00007f2e1401e000)
	libgsttag-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgsttag-1.0.so.0 (0x00007f2e13fe0000)
	liborc-0.4.so.0 => /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007f2e13f5d000)
	libzstd.so.1 => /usr/lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f2e13eb2000)
	libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f2e13ca4000)
	libHalf.so.24 => /usr/lib/x86_64-linux-gnu/libHalf.so.24 (0x00007f2e13c5f000)
	libIex-2_3.so.24 => /usr/lib/x86_64-linux-gnu/libIex-2_3.so.24 (0x00007f2e13c3e000)
	libIlmThread-2_3.so.24 => /usr/lib/x86_64-linux-gnu/libIlmThread-2_3.so.24 (0x00007f2e13c34000)
	libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f2e13b8b000)
	libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f2e13b44000)
	libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f2e13a85000)
	libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f2e13a80000)
	libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f2e13a56000)
	libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f2e13a47000)
	libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f2e1383d000)
	libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f2e13826000)
	libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f2e1381e000)
	libicuuc.so.66 => /usr/lib/x86_64-linux-gnu/libicuuc.so.66 (0x00007f2e13638000)
	libmpg123.so.0 => /usr/lib/x86_64-linux-gnu/libmpg123.so.0 (0x00007f2e135d8000)
	libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f2e134a0000)
	libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f2e1347f000)
	libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007f2e132fd000)
	libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f2e132e7000)
	libnettle.so.7 => /usr/lib/x86_64-linux-gnu/libnettle.so.7 (0x00007f2e132ad000)
	libhogweed.so.5 => /usr/lib/x86_64-linux-gnu/libhogweed.so.5 (0x00007f2e13276000)
	libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f2e131f0000)
	libgcrypt.so.20 => /usr/lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f2e130d2000)
	libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f2e130af000)
	libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f2e13062000)
	libcairo-gobject.so.2 => /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007f2e13056000)
	libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f2e1302c000)
	libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f2e12e4b000)
	libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f2e12e39000)
	libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f2e12dea000)
	libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f2e12ddd000)
	libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f2e12d99000)
	libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f2e12d6c000)
	libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f2e12d3e000)
	libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f2e12d38000)
	libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f2e12d30000)
	libicudata.so.66 => /usr/lib/x86_64-linux-gnu/libicudata.so.66 (0x00007f2e1126d000)
	libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f2e11190000)
	libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f2e1115f000)
	libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f2e11158000)
	libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f2e11149000)
	libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f2e110e7000)
	libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f2e110bc000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f2e110a0000)
	libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f2e11087000)
	libfribidi.so.0 => /usr/lib/x86_64-linux-gnu/libfribidi.so.0 (0x00007f2e1106a000)
	libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f2e1105f000)
	libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f2e10f58000)
	libbsd.so.0 => /usr/lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f2e10f3e000)
	libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f2e10f37000)
	libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f2e10ee0000)
	libpcre2-8.so.0 => /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007f2e10e50000)
	libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f2e10e44000)
	libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f2e10e17000)


The Cow