GithubHelp home page GithubHelp logo

docker-smarthome-camera-emulator's Introduction

Event Clip Manager

The Event Clip Manager is c++ based application capable of create a RTSP Client service that connects to a RTSP Video Server, generate a videoclip and send it to a http video server. The creation of the RTSP Client is triggered by an event situation.

To test the app, the software contains an Api REST, capable of receive several events to trigger the clip generation and set configuration settings via POST requests.

Features

  • Api REST for event triggering and set configurations (Camera MAC Address, videoclip duration, verbosity level, etc).
  • RTSP Server for testing purposes.

Configure video hosting server

Currently, the camera emulator is configured with the Huawei video hosting server. To change it, we must set its Ip and port in the init_script.sh file, changing the 'IP' and 'PORT' variables with de corresponding ones.

#!/bin/bash

echo "running main  --- Video Clip ---"

IP="200.32.54.152"
PORT="50040"
...

Docker building

First of all, we must create the 'clips/' directory, to store the videoclips generated:

$ mkdir main/clips

Build docker container:

$ sudo docker build -t eventcm:1.1 .

Run docker image (be sure that localport (5001) is not in used. For running several docker images, the localport must be modified. Docker port must remain in 5051)

$ sudo docker run -d -p 5001:5051 eventcm:1.1

To be sure that our docker image is running properly, using the command

$ sudo docker ps

We must observe a container similar to:

CONTAINER ID   IMAGE         COMMAND                  CREATED         STATUS         PORTS                      NAMES
59a50f1ec1b6   eventcm:1.1   \"/init_script.sh\"        5 seconds ago   Up 4 seconds   0.0.0.0:5001->5051/tcp     infallible_wilbur

Instructions

Firstly, before send a 'run_event' POST request we must set the camera MAC via a POST using the set_camera_MAC command.

1 - Set Camera MAC

POST  
{
    "command":"set_camera_MAC",
    "args":"AA:BB:CC:DD:EE:FF"
}

Finally, we could send any POST request available such as:

2 - Run event (movement_event, sound_event or record_request)

a - movement_event

POST  
{
    "command":"run_event",
    "args":"movement_event"
}

b - sound_event

POST  
{
    "command":"run_event",
    "args":"sound_event"
}

c - record_request

POST  
{
    "command":"run_event",
    "args":"record_request"
}

3 - Set clip duration (From 1 to 60 secs)

POST  
{
    "command":"set_clip_duration",
    "args":"15"
}

4 - Set verbosity level: 0 or 1 (not used with docker)

POST  
{
    "command":"set_verbosity_level",
    "args":"0"
}

docker-smarthome-camera-emulator's People

Contributors

pablojoaquim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.