Merge pull request #7 from EtixLabs/feature/docker-deployment
Deployment / CPack / Docker / Boost / Versionning
This commit is contained in:
+75
-3
@@ -13,7 +13,19 @@
|
||||
## limitations under the License.
|
||||
|
||||
cmake_minimum_required (VERSION 2.8.1)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
cmake_policy(SET CMP0048 OLD)
|
||||
|
||||
set (PROJECT_NAME cameradar)
|
||||
|
||||
project (${PROJECT_NAME})
|
||||
|
||||
set (${PROJECT_NAME}_VERSION_MAJOR 0)
|
||||
set (${PROJECT_NAME}_VERSION_MINOR 1)
|
||||
set (${PROJECT_NAME}_VERSION_PATCH 0)
|
||||
set (${PROJECT_NAME}_SUFFIX "-beta")
|
||||
set (${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}${${PROJECT_NAME}_SUFFIX}")
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
# compiler flags
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") #enable C++14
|
||||
@@ -36,17 +48,77 @@ set (CAMERADAR_CACHE_MANAGERS "")
|
||||
set(DEPS_DIR ${CMAKE_SOURCE_DIR}/deps)
|
||||
|
||||
# output path for cache managers
|
||||
set (CCTV_CACHE_MANAGER_OUTPUT_FOLDER cache_managers)
|
||||
set (CCTV_CACHE_MANAGER_OUTPUT_PATH ${CMAKE_BINARY_DIR}/${CCTV_CACHE_MANAGER_OUTPUT_FOLDER})
|
||||
set (CAMERADAR_CACHE_MANAGER_OUTPUT_FOLDER cache_managers)
|
||||
set (CAMERADAR_CACHE_MANAGER_OUTPUT_PATH ${CMAKE_BINARY_DIR}/${CAMERADAR_CACHE_MANAGER_OUTPUT_FOLDER})
|
||||
|
||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||
|
||||
# the place where the version.h file is generated, used from the main.cpp of cameradar
|
||||
set (VERSION_INCLUDE_DIR ${PROJECT_BINARY_DIR})
|
||||
|
||||
# get the git revision
|
||||
message (STATUS "retrieve current git revision SHA1 of cameradar")
|
||||
execute_process(
|
||||
COMMAND "git" "rev-parse" "HEAD"
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE CAMERADAR_GIT_SHA1
|
||||
)
|
||||
|
||||
# remove last character of the git output (\n)
|
||||
string(LENGTH ${CAMERADAR_GIT_SHA1} CAMERADAR_GIT_SHA1_LEN)
|
||||
math(EXPR CAMERADAR_GIT_SHA1_LEN "${CAMERADAR_GIT_SHA1_LEN} - 1")
|
||||
string(SUBSTRING ${CAMERADAR_GIT_SHA1} 0 ${CAMERADAR_GIT_SHA1_LEN} CAMERADAR_GIT_SHA1)
|
||||
|
||||
# print the SHA1
|
||||
message (STATUS "current cameradar git revision SHA1 is ${CAMERADAR_GIT_SHA1}")
|
||||
|
||||
# generate build number from the current timestamp
|
||||
string(TIMESTAMP CAMERADAR_VERSION_BUILD "%Y%m%d%H%M%S" "UTC")
|
||||
|
||||
# print version
|
||||
message (STATUS "current cameradar build version will be ${CAMERADAR_VERSION_BUILD}")
|
||||
|
||||
configure_file (
|
||||
"${PROJECT_SOURCE_DIR}/version.h.in"
|
||||
"${PROJECT_BINARY_DIR}/version.h"
|
||||
)
|
||||
|
||||
include_directories (
|
||||
"cameradar_standalone/include"
|
||||
"deps/jsoncpp/src/deps.jsoncpp/include"
|
||||
"deps/boost/src/deps.boost/include"
|
||||
)
|
||||
|
||||
#build cache managers
|
||||
add_subdirectory (deps)
|
||||
add_subdirectory (cameradar_standalone)
|
||||
add_subdirectory (cache_managers)
|
||||
|
||||
set (${CAMERADAR_BINARIES} "")
|
||||
install (PROGRAMS ${CAMERADAR_BINARIES} DESTINATION bin)
|
||||
|
||||
install (FILES ${CAMERADAR_CACHE_MANAGERS} DESTINATION cache_managers)
|
||||
|
||||
set (${CAMERADAR_LIBRARIES} "")
|
||||
list (APPEND CAMERADAR_LIBRARIES ${CAMERADAR_INSTALL_DEPENDENCIES} ${CAMERADAR_LIBRARIES})
|
||||
install (FILES ${CAMERADAR_LIBRARIES} DESTINATION libraries)
|
||||
|
||||
install (DIRECTORY ${CMAKE_SOURCE_DIR}/deps/licenses DESTINATION libraries)
|
||||
|
||||
|
||||
# cpack configuration
|
||||
include (InstallRequiredSystemLibraries)
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "cameradar")
|
||||
set (CPACK_PACKAGE_VENDOR "Etix Labs")
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "cameradar tool")
|
||||
set (CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${${PROJECT_NAME}_VERSION}_${CMAKE_BUILD_TYPE}_${CMAKE_SYSTEM_NAME}")
|
||||
set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
|
||||
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
||||
set (CPACK_PACKAGE_VERSION_MAJOR "0")
|
||||
set (CPACK_PACKAGE_VERSION_MINOR "1")
|
||||
set (CPACK_PACKAGE_VERSION_PATCH "0")
|
||||
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}_${${PROJECT_NAME}_VERSION}")
|
||||
set (CPACK_GENERATOR "TGZ")
|
||||
set (CPACK_SOURCE_GENERATOR "TGZ")
|
||||
|
||||
include(CPack)
|
||||
|
||||
@@ -18,7 +18,15 @@ Of course, you can also call for individual tasks if you plug in a Database to C
|
||||
|
||||
## Table of content
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Quick install](#quick-install)
|
||||
- [Dependencies](#quick-install###dependencies)
|
||||
- [Five steps guide](#quick-install###five-steps-guide)
|
||||
- [Manual installation](#manual-installation)
|
||||
- [Dependencies](#manual-installation###dependencies)
|
||||
- [Steps](#manual-installation###Steps)
|
||||
- [Advanced docker deployment](#advanced-docker-deployment)
|
||||
- [Dependencies](#advanced-docker-deployment###dependencies)
|
||||
- [Deploy a custom version of Cameradar](#advanced-docker-deployment###deploy-a-custom-version-of-cameradar)
|
||||
- [Configuration](#configuration)
|
||||
- [Output](#output)
|
||||
- [Check camera access](#check-camera-access)
|
||||
@@ -28,7 +36,27 @@ Of course, you can also call for individual tasks if you plug in a Database to C
|
||||
- [Next improvements](#next-improvements)
|
||||
- [License](#license)
|
||||
|
||||
## Installation
|
||||
## Quick install
|
||||
|
||||
The quick install uses docker to build Cameradar without polluting your machine with dependencies and makes it easy to deploy Cameradar in a few commands.
|
||||
|
||||
### Dependencies
|
||||
|
||||
The only dependencies are `docker` and `docker-compose`.
|
||||
|
||||
### Five steps guide
|
||||
|
||||
1. `git clone git@github.com:EtixLabs/cameradar.git`
|
||||
2. Go into the Cameradar repository, then to the `deployment` directory
|
||||
3. Tweak the `conf/cameradar.conf.json` as you need (see [the onfiguration guide here](#configuration) for more information)
|
||||
4. Run `docker-compose build cameradar` to build the cameradar container
|
||||
5. Run `docker-compose up cameradar` to launch Cameradar
|
||||
|
||||
If you want to deploy your custom version of Cameradar using the same method, you should check the [advanced docker deployment](#advanced-docker-deployment) tutorial here.
|
||||
|
||||
## Manual installation
|
||||
|
||||
The manual installation is recommended if you want to tweak Cameradar and quickly test them using CMake and running Cameradar in command-line. If you just want to use Cameradar, it is recommended to use the [quick install](#quick-install) instead.
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -37,6 +65,9 @@ To install Cameradar you will need these packages
|
||||
* cmake (`cmake`)
|
||||
* gstreamer1.x (`libgstreamer1.0-dev`)
|
||||
* ffmpeg (`ffmpeg`)
|
||||
* libcurl (`libcurl4-openssl-dev`)
|
||||
|
||||
### Steps
|
||||
|
||||
The simplest way would be to follow these steps :
|
||||
|
||||
@@ -48,6 +79,22 @@ The simplest way would be to follow these steps :
|
||||
6. You can now customize the `conf/cameradar.conf.json` file to set the subnetworks and specific ports you want to scan, as well as the thumbnail generation path. More information will be given about the configuration file in another part of this document.
|
||||
7. You are now ready to launch Cameradar by launching `./cameradar` in the cameradar_standalone directory.
|
||||
|
||||
## Advanced Docker deployment
|
||||
|
||||
### Dependencies
|
||||
|
||||
The only dependencies are `docker` and `docker-compose`.
|
||||
|
||||
### Deploy a custom version of Cameradar
|
||||
|
||||
2. Go into the Cameradar repository, create a directory named `build` and go in it
|
||||
3. In the build directory, run `cmake .. -DCMAKE_BUILD_TYPE=Release` This will generate the Makefiles you need to build Cameradar
|
||||
4. Run the command `make package` to compile it into a package
|
||||
5. Copy your package into the `deployment` directory
|
||||
6. Run `docker-compose build cameradar` to build the cameradar container using your custom package
|
||||
5. Run `docker-compose up cameradar` to launch Cameradar
|
||||
|
||||
|
||||
### Configuration
|
||||
|
||||
Here is the basic content of the configuration file with simple placeholders :
|
||||
|
||||
@@ -16,8 +16,8 @@ cmake_minimum_required (VERSION 2.8.1)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
|
||||
# set temporarly the ouput path for all server plugins
|
||||
set (LIBRARY_OUTPUT_PATH ${CCTV_CAMERA_MANAGER_OUTPUT_PATH})
|
||||
set (LIBRARY_OUTPUT_PATH ${CAMERADAR_CACHE_MANAGER_OUTPUT_PATH})
|
||||
|
||||
add_subdirectory(dumb_cache_manager)
|
||||
|
||||
set (CCTV_CACHE_MANAGERS ${CCTV_CACHE_MANAGERS} PARENT_SCOPE)
|
||||
set (CAMERADAR_CACHE_MANAGERS ${CAMERADAR_CACHE_MANAGERS} PARENT_SCOPE)
|
||||
|
||||
@@ -29,6 +29,6 @@ add_library (dumb_cache_manager SHARED ${SOURCES})
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
|
||||
target_link_libraries (dumb_cache_manager)
|
||||
|
||||
set (CACHE_MANAGER_NAME ${CAMERADAR_CACHE_MANAGER_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}dumb_cache_manager{CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set (CACHE_MANAGER_NAME ${CAMERADAR_CACHE_MANAGER_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}dumb_cache_manager${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
list (APPEND CAMERADAR_CACHE_MANAGERS ${CACHE_MANAGER_NAME})
|
||||
set (CAMERADAR_CACHE_MANAGERS ${CAMERADAR_CACHE_MANAGERS} PARENT_SCOPE)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
## limitations under the License.
|
||||
|
||||
cmake_minimum_required (VERSION 2.8.1)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
cmake_policy(SET CMP0048 OLD)
|
||||
|
||||
project(cameradar CXX)
|
||||
|
||||
@@ -23,11 +23,15 @@ include(FindPkgConfig)
|
||||
pkg_search_module(GSTREAMER REQUIRED gstreamer-1.0)
|
||||
find_library(LIB_GSTREAMER NAMES ${GSTREAMER_LIBRARIES} HINTS ${GSTREAMER_LIBRARY_DIRS})
|
||||
|
||||
include_directories (${GSTREAMER_INCLUDE_DIRS})
|
||||
include_directories (
|
||||
${GSTREAMER_INCLUDE_DIRS}
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
${VERSION_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
link_directories (
|
||||
${GSTREAMER_LIBRARY_DIRS}
|
||||
"../../cctv_server2/deps/jsoncpp/src/deps.jsoncpp/src/lib_json"
|
||||
"../deps/jsoncpp/src/deps.jsoncpp/src/lib_json"
|
||||
)
|
||||
|
||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
@@ -52,4 +56,5 @@ add_custom_command(TARGET cameradar PRE_BUILD
|
||||
${CMAKE_SOURCE_DIR}/cameradar_standalone/conf $<TARGET_FILE_DIR:cameradar>/conf/)
|
||||
|
||||
set (BINARIES_NAME ${PROJECT_BINARY_DIR}/cameradar)
|
||||
list (APPEND CCTV_BINARIES ${BINARIES_NAME})
|
||||
list (APPEND CAMERADAR_BINARIES ${BINARIES_NAME})
|
||||
set (CAMERADAR_BINARIES ${CAMERADAR_BINARIES} PARENT_SCOPE)
|
||||
|
||||
@@ -15,9 +15,18 @@
|
||||
#include <fs.h> // fs::home
|
||||
#include <opt_parse.h> // parsing opt
|
||||
#include <dispatcher.h> // program loop
|
||||
#include <iostream> // iostream
|
||||
#include "version.h" // versionning
|
||||
|
||||
namespace cmrdr = etix::cameradar;
|
||||
|
||||
void
|
||||
print_version() {
|
||||
std::cout << "Cameradar version " << CAMERADAR_VERSION << std::endl;
|
||||
std::cout << "Build " << CAMERADAR_VERSION_BUILD << std::endl;
|
||||
std::cout << "Git commit " << CAMERADAR_VERSION_GIT_SHA1 << std::endl;
|
||||
}
|
||||
|
||||
// Command line parsing
|
||||
std::pair<bool, etix::tool::opt_parse>
|
||||
parse_cmdline(int argc, char* argv[]) {
|
||||
@@ -37,7 +46,7 @@ parse_cmdline(int argc, char* argv[]) {
|
||||
opt_parse.print_help();
|
||||
return std::make_pair(false, opt_parse);
|
||||
} else if (opt_parse.exist("-v")) {
|
||||
std::cout << "Cameradar 0.1" << std::endl;
|
||||
print_version();
|
||||
return std::make_pair(false, opt_parse);
|
||||
} else if (opt_parse.has_error()) {
|
||||
std::cout << "Usage: ./cameradar [option]\n\toptions:\n" << std::endl;
|
||||
@@ -76,6 +85,7 @@ main(int argc, char* argv[]) {
|
||||
auto args = parse_cmdline(argc, argv);
|
||||
if (not args.first) return EXIT_FAILURE;
|
||||
|
||||
print_version();
|
||||
// configure file configuration path
|
||||
auto conf_path = std::string{};
|
||||
if (not args.second.exist("-c")) {
|
||||
|
||||
+3
-3
@@ -81,11 +81,11 @@ set(BOOST_LIBRARY_DIR ${BOOST_LIBRARY_DIR} PARENT_SCOPE)
|
||||
|
||||
# list all the boost libraries .dylib/.so
|
||||
file(GLOB BOOST_INSTALL_DEPENDENCIES "${BOOST_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}boost_*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
list (APPEND CCTV_INSTALL_DEPENDENCIES ${BOOST_INSTALL_DEPENDENCIES})
|
||||
list (APPEND CAMERADAR_INSTALL_DEPENDENCIES ${BOOST_INSTALL_DEPENDENCIES})
|
||||
# on linux
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
file(GLOB BOOST_INSTALL_DEPENDENCIES "${BOOST_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}boost_*${CMAKE_SHARED_LIBRARY_SUFFIX}.${BOOST_VERSION}")
|
||||
list (APPEND CCTV_INSTALL_DEPENDENCIES ${BOOST_INSTALL_DEPENDENCIES})
|
||||
list (APPEND CAMERADAR_INSTALL_DEPENDENCIES ${BOOST_INSTALL_DEPENDENCIES})
|
||||
endif()
|
||||
|
||||
set(CCTV_INSTALL_DEPENDENCIES ${CCTV_INSTALL_DEPENDENCIES} PARENT_SCOPE)
|
||||
set(CAMERADAR_INSTALL_DEPENDENCIES ${CAMERADAR_INSTALL_DEPENDENCIES} PARENT_SCOPE)
|
||||
|
||||
+2
-2
@@ -43,6 +43,6 @@ set (JSONCPP_LIBRARY_DIR "${SOURCE_DIR}/src/lib_json")
|
||||
set (JSONCPP_LIBRARY_DIR ${JSONCPP_LIBRARY_DIR} PARENT_SCOPE)
|
||||
|
||||
file(GLOB JSONCPP_INSTALL_DEPENDENCIES "${JSONCPP_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}jsoncpp*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
|
||||
list (APPEND CCTV_INSTALL_DEPENDENCIES ${JSONCPP_INSTALL_DEPENDENCIES})
|
||||
list (APPEND CAMERADAR_INSTALL_DEPENDENCIES ${JSONCPP_INSTALL_DEPENDENCIES})
|
||||
|
||||
set(CCTV_INSTALL_DEPENDENCIES ${CCTV_INSTALL_DEPENDENCIES} PARENT_SCOPE)
|
||||
set(CAMERADAR_INSTALL_DEPENDENCIES ${CAMERADAR_INSTALL_DEPENDENCIES} PARENT_SCOPE)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
FROM ubuntu:15.10
|
||||
|
||||
MAINTAINER brendan.leglaunec@etixgroup.com
|
||||
|
||||
ENV LD_LIBRARY_PATH="/cameradar/libraries"
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
nmap \
|
||||
ffmpeg \
|
||||
libgstreamer1.0-dev \
|
||||
gstreamer1.0-plugins-base \
|
||||
gstreamer1.0-plugins-good \
|
||||
libcurl4-openssl-dev
|
||||
|
||||
ADD cameradar_*_Release_Linux.tar.gz /
|
||||
RUN mv cameradar_*_Release_Linux cameradar
|
||||
|
||||
RUN mkdir /conf
|
||||
ADD run.sh /run.sh
|
||||
|
||||
CMD ["/run.sh"]
|
||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"subnets" : "172.16.100.13,localhost",
|
||||
|
||||
// If not specified, will scan all ports (1-65535)
|
||||
"ports" : "554,8554",
|
||||
"rtsp_url_file" : "conf/url.json",
|
||||
"rtsp_ids_file" : "conf/ids.json",
|
||||
|
||||
// You must give an accessible path to an already existing directory
|
||||
"thumbnail_storage_path" : "/tmp",
|
||||
|
||||
"cache_manager_path" : "/cameradar/cache_managers",
|
||||
"cache_manager_name" : "dumb"
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"username": [
|
||||
"",
|
||||
"admin",
|
||||
"Admin",
|
||||
"root",
|
||||
"supervisor",
|
||||
"ubnt"
|
||||
],
|
||||
"password" : [
|
||||
"",
|
||||
"admin",
|
||||
"9999",
|
||||
"123456",
|
||||
"pass",
|
||||
"camera",
|
||||
"1234",
|
||||
"12345",
|
||||
"fliradmin",
|
||||
"system",
|
||||
"jvc",
|
||||
"meinsm",
|
||||
"root",
|
||||
"4321",
|
||||
"1111111",
|
||||
"password",
|
||||
"ikwd",
|
||||
"supervisor",
|
||||
"ubnt"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"urls" : [
|
||||
"/",
|
||||
"/1.AMP",
|
||||
"/1/stream1",
|
||||
"/CAM_ID.password.mp2",
|
||||
"/GetData.cgi",
|
||||
"/MediaInput/h264",
|
||||
"/MediaInput/mpeg4",
|
||||
"/VideoInput/1/h264/1",
|
||||
"/access_code",
|
||||
"/access_name_for_stream_1_to_5",
|
||||
"/av0_0",
|
||||
"/av2",
|
||||
"/avn=2",
|
||||
"/axis-media/media.amp",
|
||||
"/cam",
|
||||
"/cam0_0",
|
||||
"/cam0_1",
|
||||
"/cam1/h264",
|
||||
"/cam1/h264/multicast",
|
||||
"/cam1/mjpeg",
|
||||
"/cam1/mpeg4",
|
||||
"/camera.stm",
|
||||
"/ch0",
|
||||
"/ch001.sdp",
|
||||
"/ch0_unicast_firststream",
|
||||
"/ch0_unicast_secondstream",
|
||||
"/channel1",
|
||||
"/h264",
|
||||
"/h264/media.amp",
|
||||
"/image.mpg",
|
||||
"/img/media.sav",
|
||||
"/img/video.asf",
|
||||
"/img/video.sav",
|
||||
"/ioImage/1",
|
||||
"/ipcam.sdp",
|
||||
"/ipcam_h264.sdp",
|
||||
"/live.sdp",
|
||||
"/live/h264",
|
||||
"/live/mpeg4",
|
||||
"/live_mpeg4.sdp",
|
||||
"/livestream",
|
||||
"/livestream/",
|
||||
"/media/media.amp",
|
||||
"/media/video1",
|
||||
"/mjpeg/media.smp",
|
||||
"/mp4",
|
||||
"/mpeg4",
|
||||
"/mpeg4/1/media.amp",
|
||||
"/mpeg4/media.amp",
|
||||
"/mpeg4/media.smp",
|
||||
"/mpeg4unicast",
|
||||
"/mpg4/rtsp.amp",
|
||||
"/multicaststream",
|
||||
"/now.mp4",
|
||||
"/nph-h264.cgi",
|
||||
"/nphMpeg4/g726-640x",
|
||||
"/nphMpeg4/g726-640x480",
|
||||
"/nphMpeg4/nil-320x240",
|
||||
"/play1.sdp",
|
||||
"/play2.sdp",
|
||||
"/rtpvideo1.sdp",
|
||||
"/rtsp_tunnel",
|
||||
"/rtsph264",
|
||||
"/stream1",
|
||||
"/user.pin.mp2",
|
||||
"/user_defined",
|
||||
"/video",
|
||||
"/video.3gp",
|
||||
"/video.mp4",
|
||||
"/video1",
|
||||
"/video1+audio1",
|
||||
"/vis",
|
||||
"/wfov"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
cameradar:
|
||||
build: .
|
||||
dockerfile: Dockerfile
|
||||
env_file: env_file
|
||||
volumes:
|
||||
- "./conf:/tmp/conf:ro"
|
||||
- "./cameradar_thumbnails:/tmp/cameradar_thumbnails"
|
||||
@@ -0,0 +1,2 @@
|
||||
CAMERAS_SUBNETWORKS=172.16.100.0/24,192.168.178.47
|
||||
CAMERAS_PORTS=554,8554
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ESC_SEQ="\x1b["
|
||||
COL_RESET=$ESC_SEQ"39;49;00m"
|
||||
COL_RED=$ESC_SEQ"31;01m"
|
||||
COL_GREEN=$ESC_SEQ"32;01m"
|
||||
COL_YELLOW=$ESC_SEQ"33;01m"
|
||||
COL_BLUE=$ESC_SEQ"34;01m"
|
||||
COL_MAGENTA=$ESC_SEQ"35;01m"
|
||||
COL_CYAN=$ESC_SEQ"36;01m"
|
||||
|
||||
# declare usefuls vars
|
||||
CONF=/conf/cameradar.conf.json
|
||||
|
||||
# copy configuration
|
||||
cp /tmp/conf/* /conf/
|
||||
|
||||
echo -n "replacing cameras subnetworks in configuration "
|
||||
sed -i s#__CAMERAS_SUBNETWORKS__#$CAMERAS_SUBNETWORKS#g $CONF
|
||||
echo -e $COL_GREEN"ok"$COL_RESET
|
||||
|
||||
echo -n "replacing cameras ports in configuration "
|
||||
sed -i s#__PORTS_TO_CHECK__#$CAMERAS_PORTS#g $CONF
|
||||
echo -e $COL_GREEN"ok"$COL_RESET
|
||||
|
||||
/cameradar/bin/cameradar -l 1 -c /conf/cameradar.conf.json &
|
||||
cameradar_pid=$!
|
||||
|
||||
trap 'kill -2 $cameradar_pid; wait $cameradar_pid; exit $?' SIGTERM SIGINT
|
||||
wait $cameradar_pid
|
||||
Vendored
+2
-2
@@ -17,7 +17,7 @@ cmake_minimum_required (VERSION 2.8.1)
|
||||
# Lib subdirectory
|
||||
|
||||
include (jsoncpp)
|
||||
# include (boost)
|
||||
include (boost)
|
||||
|
||||
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM ON)
|
||||
set (CCTV_INSTALL_DEPENDENCIES ${CCTV_INSTALL_DEPENDENCIES} PARENT_SCOPE)
|
||||
set (CAMERADAR_INSTALL_DEPENDENCIES ${CAMERADAR_INSTALL_DEPENDENCIES} PARENT_SCOPE)
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
|
||||
set(command "/usr/bin/make")
|
||||
execute_process(
|
||||
COMMAND ${command}
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_FILE "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-build-out.log"
|
||||
ERROR_FILE "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-build-err.log"
|
||||
)
|
||||
if(result)
|
||||
set(msg "Command failed: ${result}\n")
|
||||
foreach(arg IN LISTS command)
|
||||
set(msg "${msg} '${arg}'")
|
||||
endforeach()
|
||||
set(msg "${msg}\nSee also\n /home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-build-*.log")
|
||||
message(FATAL_ERROR "${msg}")
|
||||
else()
|
||||
set(msg "deps.jsoncpp build command succeeded. See also /home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-build-*.log")
|
||||
message(STATUS "${msg}")
|
||||
endif()
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
|
||||
set(command "/usr/bin/cmake;-DCMAKE_INSTALL_PREFIX=/home/ullaakut/Work/cameradar/deps/jsoncpp;-DBUILD_TYPE=Release;-DBUILD_STATIC_LIBS=OFF;-DBUILD_SHARED_LIBS=ON;-DJSONCPP_WITH_TESTS=OFF;-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF;/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp")
|
||||
execute_process(
|
||||
COMMAND ${command}
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_FILE "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-configure-out.log"
|
||||
ERROR_FILE "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-configure-err.log"
|
||||
)
|
||||
if(result)
|
||||
set(msg "Command failed: ${result}\n")
|
||||
foreach(arg IN LISTS command)
|
||||
set(msg "${msg} '${arg}'")
|
||||
endforeach()
|
||||
set(msg "${msg}\nSee also\n /home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-configure-*.log")
|
||||
message(FATAL_ERROR "${msg}")
|
||||
else()
|
||||
set(msg "deps.jsoncpp configure command succeeded. See also /home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-configure-*.log")
|
||||
message(STATUS "${msg}")
|
||||
endif()
|
||||
@@ -1 +0,0 @@
|
||||
Cloning into 'deps.jsoncpp'...
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
|
||||
set(command "/usr/bin/cmake;-P;/home/ullaakut/Work/cameradar/deps/jsoncpp/tmp/deps.jsoncpp-gitclone.cmake")
|
||||
execute_process(
|
||||
COMMAND ${command}
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_FILE "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-download-out.log"
|
||||
ERROR_FILE "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-download-err.log"
|
||||
)
|
||||
if(result)
|
||||
set(msg "Command failed: ${result}\n")
|
||||
foreach(arg IN LISTS command)
|
||||
set(msg "${msg} '${arg}'")
|
||||
endforeach()
|
||||
set(msg "${msg}\nSee also\n /home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-download-*.log")
|
||||
message(FATAL_ERROR "${msg}")
|
||||
else()
|
||||
set(msg "deps.jsoncpp download command succeeded. See also /home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-download-*.log")
|
||||
message(STATUS "${msg}")
|
||||
endif()
|
||||
@@ -1,3 +0,0 @@
|
||||
repository='https://github.com/open-source-parsers/jsoncpp.git'
|
||||
module=''
|
||||
tag=''
|
||||
-1
@@ -1 +0,0 @@
|
||||
cmd='/usr/bin/cmake;-DCMAKE_INSTALL_PREFIX=/home/ullaakut/Work/cameradar/deps/jsoncpp;-DBUILD_TYPE=Release;-DBUILD_STATIC_LIBS=OFF;-DBUILD_SHARED_LIBS=ON;-DJSONCPP_WITH_TESTS=OFF;-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF;<SOURCE_DIR>'
|
||||
-1
@@ -1 +0,0 @@
|
||||
cmd='@cmd@'
|
||||
-82
@@ -1,82 +0,0 @@
|
||||
if("master" STREQUAL "")
|
||||
message(FATAL_ERROR "Tag for git checkout should not be empty.")
|
||||
endif()
|
||||
|
||||
set(run 0)
|
||||
|
||||
if("/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-gitinfo.txt" IS_NEWER_THAN "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-gitclone-lastrun.txt")
|
||||
set(run 1)
|
||||
endif()
|
||||
|
||||
if(NOT run)
|
||||
message(STATUS "Avoiding repeated git clone, stamp file is up to date: '/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-gitclone-lastrun.txt'")
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR "Failed to remove directory: '/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp'")
|
||||
endif()
|
||||
|
||||
# try the clone 3 times incase there is an odd git clone issue
|
||||
set(error_code 1)
|
||||
set(number_of_tries 0)
|
||||
while(error_code AND number_of_tries LESS 3)
|
||||
execute_process(
|
||||
COMMAND "/usr/bin/git" clone "https://github.com/open-source-parsers/jsoncpp.git" "deps.jsoncpp"
|
||||
WORKING_DIRECTORY "/home/ullaakut/Work/cameradar/deps/jsoncpp/src"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
math(EXPR number_of_tries "${number_of_tries} + 1")
|
||||
endwhile()
|
||||
if(number_of_tries GREATER 1)
|
||||
message(STATUS "Had to git clone more than once:
|
||||
${number_of_tries} times.")
|
||||
endif()
|
||||
if(error_code)
|
||||
message(FATAL_ERROR "Failed to clone repository: 'https://github.com/open-source-parsers/jsoncpp.git'")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "/usr/bin/git" checkout master
|
||||
WORKING_DIRECTORY "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR "Failed to checkout tag: 'master'")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "/usr/bin/git" submodule init
|
||||
WORKING_DIRECTORY "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR "Failed to init submodules in: '/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp'")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "/usr/bin/git" submodule update --recursive
|
||||
WORKING_DIRECTORY "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR "Failed to update submodules in: '/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp'")
|
||||
endif()
|
||||
|
||||
# Complete success, update the script-last-run stamp file:
|
||||
#
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
"/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-gitinfo.txt"
|
||||
"/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-gitclone-lastrun.txt"
|
||||
WORKING_DIRECTORY "/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR "Failed to copy script-last-run stamp file: '/home/ullaakut/Work/cameradar/deps/jsoncpp/src/deps.jsoncpp-stamp/deps.jsoncpp-gitclone-lastrun.txt'")
|
||||
endif()
|
||||
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
The JsonCpp library's source code, including accompanying documentation,
|
||||
tests and demonstration applications, are licensed under the following
|
||||
conditions...
|
||||
|
||||
The author (Baptiste Lepilleur) explicitly disclaims copyright in all
|
||||
jurisdictions which recognize such a disclaimer. In such jurisdictions,
|
||||
this software is released into the Public Domain.
|
||||
|
||||
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
|
||||
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
|
||||
released under the terms of the MIT License (see below).
|
||||
|
||||
In jurisdictions which recognize Public Domain property, the user of this
|
||||
software may choose to accept it either as 1) Public Domain, 2) under the
|
||||
conditions of the MIT License (see below), or 3) under the terms of dual
|
||||
Public Domain/MIT License conditions described here, as they choose.
|
||||
|
||||
The MIT License is about as close to Public Domain as a license can get, and is
|
||||
described in clear, concise terms at:
|
||||
|
||||
http://en.wikipedia.org/wiki/MIT_License
|
||||
|
||||
The full text of the MIT License follows:
|
||||
|
||||
========================================================================
|
||||
Copyright (c) 2007-2010 Baptiste Lepilleur
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use, copy,
|
||||
modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
========================================================================
|
||||
(END LICENSE TEXT)
|
||||
|
||||
The MIT license is compatible with both the GPL and commercial
|
||||
software, affording one all of the rights of Public Domain with the
|
||||
minor nuisance of being required to keep the above copyright notice
|
||||
and license text in the source code. Note also that by accepting the
|
||||
Public Domain "license" you can re-license your copy using whatever
|
||||
license you like.
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright 2016 Etix Labs
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef __CAMERADAR_H__201605202152__
|
||||
#define __CAMERADAR_H__201605202152__
|
||||
|
||||
// the configured options and settings for Tutorial
|
||||
#define CAMERADAR_VERSION "@cameradar_VERSION@"
|
||||
#define CAMERADAR_VERSION_MAJOR @cameradar_VERSION_MAJOR@
|
||||
#define CAMERADAR_VERSION_MINOR @cameradar_VERSION_MINOR@
|
||||
#define CAMERADAR_VERSION_PATCH @cameradar_VERSION_PATCH@
|
||||
#define CAMERADAR_VERSION_GIT_SHA1 "@CAMERADAR_VERSION_SHA1@"
|
||||
#define CAMERADAR_VERSION_BUILD "@CAMERADAR_VERSION_BUILD@"
|
||||
|
||||
#endif // __CAMERADAR_H__201605202152__
|
||||
Reference in New Issue
Block a user