Configuration syntax

Updated: April 19, 2023

The mm-stream configuration lists and configures the plugins used by clients for accessing the server, and by the server for reading input, processing media content, and delivering output.

Typically, the JSON object that configures a plugin is named for the shared object (.so) file that implements the plugin. The JSON object name may also contain a string that hints at how the plugin is configured. This is because you can define multiple configurations of the same plugin, to support multiple concurrent mm-stream instances. For example, if your target system has both a 360p and a 720p encoding processor, you can define separate configurations of the media-processing plugin to encode video at different rates suitable for each display type.

Each configuration is specified as a distinct JSON object. The sections below provide tables that describe the JSON objects and fields used in the configurations.

mm-stream-input-file.so

Configures the input plugin that reads media files

Field name     Type Description
uuid     Hexadecimal string Universally Unique Identifier (UUID) for the plugin
file path   String Absolute path of the input file
file blitter_buffers   Number Number of source buffers to use for blitting, which entails copying pixels between buffers to convert formats, scale the image, etc.
file audio_settings   JSON object Defines how audio content read from the file is formatted for delivery to the processing plugin
file audio_settings channels Number Number of audio channels
file audio_settings samplerate Number Frequency of the audio sampling, in Hertz (Hz)
file audio_settings bitspersample Number Number of bits in each sample
file audio_settings codec JSON object Codec to use for formatting the audio delivered to the processing plugin. This object can contain fields that configure codec settings.
file video_settings   JSON object Defines how video content read from the file is formatted for delivery to the processing plugin
file video_settings width Number Width of the video, in pixels
file video_settings height Number Height of the video, in pixels
file video_settings rotation Number Angle by which the video is rotated, in degrees. Positive values indicate clockwise rotation; negative values indicate counterclockwise.
file video_settings framerate Number Frame rate (Hz)
file video_settings codec JSON object Codec to use for formatting the video delivered to the processing plugin. This object can contain fields that configure codec settings.

mm-stream-input-audio.so

Configures the input plugin that reads audio using libasound

Field name     Type Description
uuid     Hexadecimal string Universally Unique Identifier (UUID) for the plugin
audio device_name   String Absolute path of the audio device
audio fragment_size   Number Size of each audio data fragment delivered by libasound, in bytes. All processing occurs on individual audio fragments (rather than the whole buffer).
audio audio_settings   JSON object Defines how audio content read from libasound is formatted for delivery to the processing plugin
audio audio_settings channels Number Number of audio channels
audio audio_settings samplerate Number Frequency of the audio sampling, in Hertz (Hz)
audio audio_settings bitspersample Number Number of bits in each sample
audio audio_settings source_filter_method Number Sample rate conversion method. This setting can be 0, to make libasound use the basic linear interpolated SRC algorithm, or 1, to make it use the basic anti-aliased SRC filter (or 7-point Kaiser windowed).
audio audio_settings codec JSON object Codec to use for formatting the audio delivered to the processing plugin. This object can contain fields that configure codec settings.

mm-stream-input-screen.so

Configures the input plugin that reads video using Screen

Field name     Type Description
uuid     Hexadecimal string Universally Unique Identifier (UUID) for the plugin
screen type   String Display type
screen swap_interval   Number Number of vsync (refresh) periods between content postings
screen screen_format   String Pixel format
screen blitter_buffers   Number Number of source buffers to use for blitting, which entails copying pixels between buffers to convert formats, scale the image, etc.
screen display_buffers   Number Number of destination buffers for storing pixels copied during blitting so they can be rendered onto physical displays
screen source   JSON object Defines settings for the blitting source buffer
screen source x Number X-coordinate of the upper left corner of the source buffer
screen source y Number Y-coordinate of the upper left corner of the source buffer
screen source width Number Width of the source buffer, in pixels
screen source height Number Height of the source buffer, in pixels
screen destination   JSON object Defines settings for the blitting destination buffer
screen destination x Number X-coordinate of the upper left corner of the destination buffer
screen destination y Number Y-coordinate of the upper left corner of the destination buffer
screen destination width Number Width of the destination buffer, in pixels
screen destination height Number Height of the destination buffer, in pixels
screen video_settings   JSON object Defines how video content read from Screen is formatted for delivery to the processing plugin
screen video_settings width Number Width of the video, in pixels
screen video_settings height Number Height of the video, in pixels
screen video_settings rotation Number Angle by which the video is rotated, in degrees. Positive values indicate clockwise rotation; negative values indicate counterclockwise.
screen video_settings framerate Number Frame rate (Hz)
screen video_settings codec JSON object Codec to use for formatting the video delivered to the processing plugin. This object can contain fields that configure codec settings.

mm-stream-input-camera.so

Configures the input plugin that reads video using the Camera Framework

Field name     Type Description
uuid     Hexadecimal string Universally Unique Identifier (UUID) for the plugin
camera unit_id   Number Logical camera unit
camera buffers   Number Number of buffers in the viewfinder window that are allocated for the user application (i.e., the program configuring mm-stream)
camera video_settings   JSON object Defines how video content read using the Camera Framework is formatted for delivery to the processing plugin
camera video_settings width Number Width of the video, in pixels
camera video_settings height Number Height of the video, in pixels
camera video_settings rotation Number Angle by which the video is rotated, in degrees. Positive values indicate clockwise rotation; negative values indicate counterclockwise.
camera video_settings framerate Number Frame rate, in Hertz (Hz)
camera video_settings codec JSON object Codec to use for formatting the video delivered to the processing plugin. This object can contain fields that configure codec settings.

mm-stream-processor-openmaxal.so

Configures the media-processing plugin that uses OpenMAX AL to decode and encode media streams

Field name     Type Description
uuid     Hexadecimal string Universally Unique Identifier (UUID) for the plugin
plugins     Array UUIDs of source plugins to link in
plugins uuid   Hexadecimal string UUID for a particular source plugin
priority     Number Priority level for the thread in which the library runs
ts     JSON object Defines the settings used for multiplexing audio and video input streams into an output container based on the MPEG Transport Stream (TS) format.
ts audio_settings   JSON object Defines how audio streams are transcoded for output. This nested object needs to be present when you're using the audio or file input plugin to read a file with audio content.
ts audio_settings bitrate Number Rate at which to output audio stream data, in bits per second (bps)
ts audio_settings channels Number Number of audio channels to output
ts audio_settings samplerate Number Sampling rate (in Hz), which means how often to read PCM data from the input plugin
ts audio_settings bitspersample Number Number of bits to provide in each sample
ts audio_settings codec JSON object Codec to use for encoding the audio in the output container. This object can contain fields that configure codec settings.
ts video_settings   JSON object Defines how video streams are transcoded for output. This nested object needs to be present when you're using the Screen or Camera Framework input plugin or the file input plugin to read a file with video content.
ts video_settings width Number Width of the video, in pixels
ts video_settings height Number Height of the video, in pixels
ts video_settings rotation Number Angle by which to rotate the video, in degrees. Positive values indicate clockwise rotation; negative values indicate counterclockwise.
ts video_settings framerate Number Rate at which to output video frames (in Hz)
ts video_settings bitrate Number Rate at which to output video stream data, in bits per second (bps)
ts video_settings codec JSON object Codec to use for encoding the video in the output container. This object can contain fields that configure codec settings.

mm-stream-output-rtp.so

Configures the plugin that encapsulates TS content into RTP packets and outputs them

Field name   Type Description
uuid   Hexadecimal string Universally Unique Identifier (UUID) for the plugin
plugins   Array UUIDs of source plugins to link in
plugins uuid Hexadecimal string UUID for a particular source plugin

mm-stream-server-rtp.so

Configures the plugin that provides clients with RTP access to mm-stream

Field name   Type Description
uuid   Hexadecimal string Universally Unique Identifier (UUID) for the plugin
plugins   Array Contains objects that describe the source plugins to link in
plugins uuid Hexadecimal string UUID for a particular source plugin
plugins address String IP address and port number used by clients for accessing a specific RTP stream
plugins peer_address String IP address and port number that the RTP stream is sent to; this can be unicast or multicast

mm-stream-server-rtsp.so

Configures the plugin that provides clients with RTSP access to mm-stream

Field name     Type Description
enabled     Boolean (true or false) Whether the server initially listens for RTSP commands. If this field is false, the instance must be explicitly enabled before clients can start streaming content through RTSP.
uuid     Hexadecimal string Universally Unique Identifier (UUID) for the plugin
address     String IP address and port number used by the mm-stream server to receive RTSP commands
streams     Array Contains objects that define the URLs for accepting RTSP commands and the source plugins that output the RTP packets in response to those commands
streams url   String URL specifying a server path to which RTSP commands can be sent; the URL must be appended to the IP address and port defined in address
streams plugins   Array UUIDs of source plugins to link in
streams plugins uuid Hexadecimal string UUID for a particular source plugin