Giter Club home page Giter Club logo

hwangsae's Introduction

Hwangsae

Hwangsae means stork and acts mainly as the SRT relay to provide the lowest latency to end-user.

Overview

Broker types

There are two modules for handling SRT streaming.

Relay

Hwangsae Relay performs the SRT relay. Edge devices send one SRT stream to Relay which then can be consumed by N different SRT sinks. It uses:

  • chamge: to register to the message broker and receive messages
  • gaeugli: to handle the SRT streaming

Recorder

Hwangsae Recorder allows the system to record streaming from an Edge device via the Hwangsae Relay. The module can also split the output across multiple files to improve recording handling.

Transmuxer

Hwangsae Transmuxer allows to merge several .ts files in a single .mp4 file properly handling gaps between input segments. The module can also split the output across multiple files to improve recording handling.

Tools

Recorder tool

Command line tool to record SRT streams.

Usage

$ hwangsae-recorder-1.0 uri

uri: Source SRT stream URI

Transmuxer tool

Command line tool to merge several .ts files into a single .mp4 file.

Usage

$ hwangsae-transmuxer-1.0 [options] files

files: List of input files

Options

  • -o: Output file name
  • -s: Time to use for splitting, can be used multiple times

Agents

Role of agents are for communicating with another process. Agents include D-BUS API that is created by code generator from defined XML in the path of chamge/dbus/.

Relay Agent

Hwangsae Relay Agent uses the Hwangsae Relay to performs the SRT relay. This allows N different clients to access the streaming generated by the Edge device, including Recorder agent, which improves the scalability of the system.

Recorder Agent

Hwangsae Recorder Agent uses the Hwangsae Recorder to record SRT streaming in a local filesystem. It also implements a HTTP server to allow easy access to the recorded video.

Settings

Each broker/agent has its own settings which are listed below.

Relay settings

Schema: org.hwangsaeul.hwangsae.relay

$ gsettings list-recursively org.hwangsaeul.hwangsae.relay
org.hwangsaeul.hwangsae.relay external-ip ''
org.hwangsaeul.hwangsae.relay sink-port uint32 8888
org.hwangsaeul.hwangsae.relay source-port uint32 9999
  • external-ip: Public IP address used to contact the Relay. If set, this value will be used when building the URL instead of the local IP address
  • sink-port: UDP port used to receive streaming from Edge devices
  • source-port: UDP port used to send streaming to clients

For more details check the file hwangsae/org.hwangsaeul.hwangsae.gschema.xml

Recorder settings

Schema: org.hwangsaeul.hwangsae.recorder

$ gsettings list-recursively org.hwangsaeul.hwangsae.recorder
org.hwangsaeul.hwangsae.recorder external-ip ''
org.hwangsaeul.hwangsae.recorder http-port uint32 8092
org.hwangsaeul.hwangsae.recorder recording-dir '/tmp'
org.hwangsaeul.hwangsae.recorder relay-address '127.0.0.1'
org.hwangsaeul.hwangsae.recorder relay-api-port uint32 8080
org.hwangsaeul.hwangsae.recorder relay-stream-port uint32 9999
  • external-ip: Public IP address used to contact the Recorder. If set, this value will be used when building the URL instead of the local IP address
  • http-port: TCP port used for internal HTTP server
  • recording-dir: Local folder for storage recording files. Inside it a folder will be created for each Edge device
  • relay-address: IP address of the Relay Agent used to access the streaming
  • relay-api-port: TCP port to contact Relay's REST API
  • relay-stream-port: UDP port to contact Relay's streaming

For more details check the file hwangsae/org.hwangsaeul.hwangsae.gschema.xml

D-BUS API

Each agent implements its own D-BUS API to allow easy interaction with the service.

Relay D-BUS API

Start Starts the streaming of a given Edge device allowing to N clients to access it via the returned URL.

Arguments

  • edge_id (s): Unique identifier for the Edge device
  • width (i): Streaming width
  • height (i): Streaming height
  • fps (i): Streaming FPS
  • bitrates (i): Streaming bitrate

Return

  • url (s): URL to use to reach the streaming

Stop Stops the streaming of a given Edge device.

Arguments

  • edge_id (s): Unique identifier for the Edge device

For more details check the file hwangsae/dbus/org.hwangsaeul.Hwangsae1.EdgeInterface.xml

Recorder D-BUS API

Start Starts a new recording, which will trigger the start of the streaming for the given Edge device.

Arguments

  • edge_id (s): Unique identifier for the Edge device

Return

  • record_id (s): Unique identifier for recording

Stop Stops a recording without stopping the streaming from Edge device.

Arguments

  • edge_id (s): Unique identifier for the Edge device

LookupByRecordId Retrieves the list of files of a given recording in a time window.

Arguments

  • record_id (s): Unique identifier for recording
  • from (x): Timestamp lower limit for filter results
  • to (x): Timestamp upper limit for filter results

Return

  • edge_id (s): Unique identifier for the Edge device

  • file_list: List of files that match the lookup criteria with

    • file_id (s): Unique identifier for the file
    • file_start (x): Timestamp of the recording file start
    • file_end (x): Timestamp of the recording file end
    • size (x): Size of the recording file

LookupByEdgeId Retrieves the list of records/files of a given Edge device in a time window.

Arguments

  • edge_id (s): Unique identifier for the Edge device
  • from (x): Timestamp lower limit for filter results
  • to (x): Timestamp upper limit for filter results

Return

  • file_list: List of files that match the lookup criteria with
    • record_id (s): Unique identifier for recording
    • file_id (s): Unique identifier for the file
    • file_start (x): Timestamp of the recording file start
    • file_end (x): Timestamp of the recording file end
    • size (x): Size of the recording file

Url Retrieves the URL to acces a specific recording file.

Arguments

  • edge_id: Unique identifier for the Edge device
  • file_d: Unique identifier for the file to be downloaded

Return

  • url: URL to download the specified file

Delete Deletes a specific recording file.

Arguments

  • edge_id: Unique identifier for the Edge device
  • file_id: Unique identifier for the file to be downloaded

For more details check the file hwangsae/dbus/org.hwangsaeul.Hwangsae1.RecorderInterface.xml

In the above APIs these ids are used

  • edge_id: Unique random number which identifies a Edge device. This id is used by the device during the enroll and activation process.
  • record_id: Unique identifier for a recording, current format is start_timestamp
  • file_id: Unique identifier for a file in a recording, current format is recording_id-file_start_timestamp-file_stop_timestamp

Build from sources

To build from sources follow the procedure described in

Build from sources

Run

After building from sources Hwangsae Relay Agent can be run with

/usr/local/bin/hwangsae-relay-agent

Also, Hwangsae Recorder Agent can be run with

/usr/local/bin/hwangsae-recorder-agent

PPA nightly builds

Experimental versions of Hwangsae are daily generated in launchpad.

$ sudo add-apt-repository ppa:hwangsaeul/nightly
$ sudo apt-get update
$ sudo apt-get install hwangsae-agent hwangsae-tools libhwangsae-dev libhwangsae1

hwangsae's People

Contributors

hkseo95 avatar justinjoy avatar wlozano0collabora avatar xhaakon avatar

Watchers

 avatar  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.