-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #272 from richard-austin/release-7.0.3
Release 7.0.3
- Loading branch information
Showing
116 changed files
with
3,437 additions
and
2,167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/xtrn-scripts-and-config/productKeyGen/generateProductKey.jar | ||
/.profileconfig.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
## Development | ||
Pre built .deb files for deployment on a Raspberry pi 4 are available in the Releases section. | ||
The requirements to build the project yourself are detailed below: - | ||
#### Platform for Development | ||
* Ubuntu 23.10 (Mantic Minotaur) on PC (Windows WSL2 or direct boot) | ||
|
||
#### The project is verified to build with the following:- | ||
* go version go1.20.1 | ||
* Angular CLI: 15.2.0 or greater | ||
* Node: 18.17.1 | ||
* npm: 9.9.7 | ||
* Package Manager: npm 9.6.7 | ||
* Grails Version: 5.3.2 | ||
* openjdk version "19.0.2" 2023-01-17 | ||
* Gradle 7.6 | ||
* Python 3.11.4 | ||
|
||
Using other versions may cause build issues in some cases. | ||
|
||
### Set up build environment | ||
``` | ||
git clone git@github.com:richard-austin/security-cam.git | ||
cd security-cam | ||
``` | ||
### Build for deployment to Raspberry pi | ||
The Raspberry pi should be running Ubuntu 23.10 (Mantic Minotaur) OS. | ||
``` | ||
./gradlew buildDebFile | ||
``` | ||
This will create a deb file with a name of the form security-cam_*VERSION*-*nn*-*ID-dirty*_arm64.deb | ||
Where:- | ||
* *VERSION* is the most recent git repo tag | ||
* *nn* Is the number of commits since the last git tag (not present if no commits since last tag.) | ||
* *ID* The last git commit ID (not present if no commits since last tag.) | ||
* *dirty* "dirty" is included in the name if there were uncommitted changes to the source code when built. | ||
|
||
When the build completes navigate to where the .deb file was created:- | ||
``` | ||
cd xtrn-scripts-and-config/deb-file-creation | ||
``` | ||
scp the .deb file to the Raspberry pi | ||
## Installation on the Raspberry pi | ||
``` | ||
sudo apt update | ||
sudo apt upgrade | ||
``` | ||
(restart if advised to after upgrade) | ||
|
||
Navigate to where the .deb file is located | ||
<pre> | ||
sudo apt install ./<i>deb_file_name</i>.deb | ||
</pre> | ||
* Wait for installation to complete. | ||
* The Tomcat web server will take 1 - 2 minutes to start | ||
the application. | ||
* <i>If this is the first installation on the Raspberry pi..</i> | ||
* Make a note of the product key (a few lines up). | ||
This will be required if you use the Cloud Service to connect | ||
to the NVR, otherwise it is not required. | ||
* <i>Generate the site certificate..</i> | ||
``` | ||
cd /etc/security-cam | ||
sudo ./install-cert.sh | ||
``` | ||
Fill in the details it requests (don't put in any information you are not happy with being publicly visible, for | ||
example you may want to put in a fake email address etc.) | ||
* nginx will not have started in the absence of the site certificate, so restart nginx. | ||
``` | ||
sudo systemctl restart nginx | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
### ffmpeg | ||
ffmpeg version 4 is used in the NVR as versions 5 and above will not correctly mux the rtsp to fmp4 when audio is present. | ||
The problem is due to a lack of timestamps in one or both of the streams, and whereas ffmpeg4 | ||
deals with it satisfactorily, version 5 and above don't want to know, giving the below error messages continuously. | ||
<pre> | ||
pts has no value | ||
Packet duration: -1131 / dts: 152727 is out of range | ||
</pre> | ||
|
||
As ffmpeg 4 is not available as standard on Ubuntu 23.10, I have built an ffmpeg v4 executable | ||
for ARM64 architecture (at xtrn-scripts-and-config/ffmpeg-v4.4.4) which is deployed on installation of the | ||
main project deb file. | ||
|
||
If you are deploying to a Raspberry pi, you can skip to the *Camera Recordings Service* section. | ||
|
||
If you are deploying the NVR to a non ARM64 platform, you will need to | ||
build ffmpeg 4 on that platform as follows:-. | ||
|
||
|
||
```bash | ||
wget https://ffmpeg.org/releases/ffmpeg-4.4.4.tar.xz | ||
tar -xvf ffmpeg-4.4.4.tar.xz | ||
cd ffmpeg-4.4.4/ | ||
./configure | ||
make | ||
``` | ||
The executable ffmpeg will be in the ffmpeg-4.4.4 directory. To deploy it in the deb file with the rest of the | ||
NVR, copy it to the project at xtrn-scripts-and-config/ffmpeg-v4.4.4. | ||
##### ffmpeg Build problem | ||
On Ubuntu 23.10, I got the following compilation error when building ffmpeg 4: - | ||
<pre> | ||
CC libavformat/adtsenc.o | ||
./libavcodec/x86/mathops.h: Assembler messages: | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error:ffmpeg-4.4.4 operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr' | ||
make: *** [ffbuild/common.mak:81: libavformat/adtsenc.o] Error 1 | ||
</pre> | ||
|
||
To fix this, copy xtrn-scripts-and-config/ffmpeg-v4.4.4/mathopts.patch to | ||
your ffmpeg-4.4.4 build directory and (from the ffmpeg-4.4.4 build directory) run | ||
|
||
```text | ||
patch -u -b ./libavcodec/x86/mathops.h mathopts.patch | ||
``` | ||
Run | ||
```text | ||
make clean | ||
make | ||
``` | ||
|
||
and it should now build OK. | ||
|
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.