Hwangsae means stork and acts mainly as the SRT relay to provide the lowest latency to end-user.
There are two modules for handling SRT streaming.
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:
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.
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.
Command line tool to record SRT streams.
Usage
$ hwangsae-recorder-1.0 uri
uri: Source SRT stream URI
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
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/.
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.
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.
Each broker/agent has its own settings which are listed below.
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
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
Each agent implements its own D-BUS API to allow easy interaction with the service.
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
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
To build from sources follow the procedure described in
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
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