I was able to get Bluecherry server to compile on a Raspberry Pi 3 running Raspbian Buster. It doesn’t support hardware accelerated video since the Pi, AFAIK, doesn’t accelerate via VA-API but instead has acceleration via OpenMAX (OMX). I know ffmpeg can do accelerated encode / decode via OMX on the Pi, but is there any way to get Bluecherry using ffmpeg for video decode? In the settings menu, the only options are VA-API accleration, but I was thinking ffmpeg was used for video decode? In any case, on the Pi 3 I think it’s probably not quite fast enough without the acceleration. I seemed like continuous capture worked fine for my one camera, but using motion-based recording seemed to result in very choppy video. top reports CPU usage is always around 103%, so it’s probably maxing out one of the cores.
Anyway, the changes I had to make to get things going:
- In lib/bc-key.cpp, change the static const char base32_charset_reverse to be type static const signed char instead. The compiler in Buster won’t compile code that assumes char is signed, so you have to explicitly state it.
- In server/BCMK, add -lopencv_highgui to the LDFLAGS. The newer OpenCV on Buster won’t link correctly unless this is linked too.
- In scripts/install_prereqs_native.sh, add a case for raspbian, since the existing debian case won’t match because the Pi distribution calls itself raspbian instead. I made this case be basically empty (it just sets ADDITIONAL_PKGS=""). The linux-image and linux-headers packages installed by the Debian case do not seem to be needed on the Pi, and they in fact seemed to cause issues with the Raspbian install when I did install them.
- In debian/control.in, remove i965-va-driver from the list of depends. This package isn’t available on Pi and doesn’t seem to actually be needed?
The above changes, in addition to the installation of some dev packages (I honestly can’t remember which right now, but most of them are fairly self explanatory from what I remember), get Bluecherry to compile. However, it will fail during install because it will claim the database schema doesn’t match while creating the database. After inspection, it appears that the way the schema is printed out by the command line MySQL client is different in the MySQL version in Buster. For example, one part of the schema is expected to look like this:
rtsp_rtp_prefer_tcp tinyint(1) NOT NULL DEFAULT 1,
but it actually looks like this
rtsp_rtp_prefer_tcp tinyint(1) NOT NULL DEFAULT ‘1’,
(note the single quote around 1). Since the schema comparison is done using a simple diff, the installation script will think that the database schema is wrong. My solution to this was to dump the database schema after the installer failed, verify that the schema is actually correct, and replace the file misc/sql/schema_mysql.sql with a dump of the schema created by the new version of MySQL. I then rebuilt Bluecherry and the install succeeded.