Outputs

January 14, 2019 ยท View on GitHub

Outputs allow you to send an audio or video stream elsewhere, such as to YouTube, or writing to a file. There can be any number of outputs, and tcan be created, updated, and deleted using the API. They can also be created at start-up using a config file.

Common properties

All outputs have the following properties:

NameCan be set initially?Can be updated??DescriptionDefault value (if not set)
idNoNoID of the output. Positive integer. Starts at 1 and increases by 1 for each new output.n/a
uidNoNoUnqiue ID - a string in the format 'outputX' where X is the IDn/a
typeYesNoThe output type, e.g. rtmp.N/A - REQUIRED
stateYesYesEither NULL, READY, PAUSED or PLAYING. What are the four states?PLAYING
desired_stateNo (Use state)No (Use state)Set to state that the user has requested, when it has not yet been reached.
sourceYesYes, but only if the output is in the READY or NULL states.The source of the output - either an input, or a mixer, or null.None (null)

Output types

Brave currently support these output types:

rtmp

The rtmp output forwards the audio/video to an RTMP server. This can include YouTube, Facebook Live and Periscope.

Properties

In addition to the common properties above, this input type also has the following:

NameCan be set initially?Can be updated??DescriptionDefault value (if not set)
uriYesThe URI of the contentn/a (required)
width and heightNoWidth and height of videoWhatever the source is

tcp

The tcp output acts as TCP server, allowing a client to connect and retrieve the content over the TCP protocol. VLC is able to connect in this way.

Properties

In addition to the common properties above, this output type also has the following:

NameCan be set initially?Can be updated??DescriptionDefault value (if not set)
hostYesNoThe name of the host to assumeThe server's hostname
portYesNoThe port to run the TCP server onAn available port
width and heightYesNoWidth and height of videoWhatever the source is
audio_bitrateYesNoThe audio bitrate to use.128,000 bps
containerYesNoThe video container to use - either mpeg or oggmpeg

file

The file output allows the content to be written to a file. At present the file will always be encoded with h264 for video and AAC for audio, ideal for an MP4 file.

Properties

In addition to the common properties above, this output type also has the following:

NameCan be set initially?Can be updated??DescriptionDefault value (if not set)
locationYesNoThe location of the file to write ton/a (required)
width and heightYesNo Width and height of videoWhatever the source is

image

The image output writes a snapshot image of the video periodically. The image can then be accessed periodically through the API call /api/outputs/1/body.

Properties

In addition to the common properties above, this output type also has the following:

NameCan be set initially?Can be updated??DescriptionDefault value (if not set)
width and heightYesNoWidth and height of video640x360

webrtc

The webrtc output allows the audio/video to be previewed via WebRTC, which works well in a modern web browser.

Once created, clients must instantiate the connection via websocket.

kvs

The kvs output sends video (not audio) to the Kinesis Video Stream service that's part of AWS.

See the specific installation instructions for installing the relevant GStreamer element.

Note: the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables must be set, in the same way that they are needed for the [AWS CLI[(https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html).

Properties

In addition to the common properties above, this output type also has the following:

NameCan be set initially?Can be updated??DescriptionDefault value (if not set)
stream_nameYesNoName of the Kinesis Video stream.n/a
width and heightYesNoWidth and height of video640x360

local

The local output creates a Gtk window to show the video. This only works when Brave is running on a local machine. (Brave is designed to work remotely, and so this output is assumed to be needed only for debugging.)