Skip to content

Latest commit

 

History

History
241 lines (193 loc) · 6.98 KB

File metadata and controls

241 lines (193 loc) · 6.98 KB

Tools

mxl-info

Simple tool that uses the MXL sdk to open a flow by ID and prints the flow details.

Usage: ./mxl-info [OPTIONS]

Options:
  -h,--help                   Print this help message and exit
  --version                   Display program version information and exit
  -d,--domain TEXT:DIR REQUIRED
                              The MXL domain directory
  -f,--flow TEXT              The flow id to analyse
  -l,--list                   List all flows in the MXL domain

Example 1 : listing all flows in a domain

./mxl-info -d ~/mxl_domain/ -l
--- MXL Flows ---
        5fbec3b1-1b0f-417d-9059-8b94a47197ed

Example 2 : Printing details about a specific flow

./mxl-info -d ~/mxl_domain/ -f 5fbec3b1-1b0f-417d-9059-8b94a47197ed

- Flow [5fbec3b1-1b0f-417d-9059-8b94a47197ed]
        version           : 1
        struct size       : 4192
        flags             : 0x00000000000000000000000000000000
        head index        : 52146817788
        grain rate        : 60000/1001
        grain count       : 3
        last write time   : 2025-02-19 11:44:12 UTC +062314246ns
        last read time    : 1970-01-01 00:00:00 UTC +000000000ns

Hint : Live monitoring of a flow details (updates every second)

watch -n 1 -p ./mxl-info -d ~/mxl_domain/ -f 5fbec3b1-1b0f-417d-9059-8b94a47197ed

mxl-viewer

TODO. A generic GUI application based on gstreamer or ffmpeg to display flow(s).

mxl-gst-testsrc

A binary that uses the gstreamer 'videotestsrc' and 'audiotestsrc' elements to produce video grains and/or audio samples which will be pushed to a MXL Flow. The flow is configured from a NMOS Flow json file. Here's an example of such file :

{
  "description": "MXL Test File",
  "id": "5fbec3b1-1b0f-417d-9059-8b94a47197ef",
  "tags": {},
  "format": "urn:x-nmos:format:video",
  "label": "MXL Test File",
  "parents": [],
  "media_type": "video/v210",
  "grain_rate": {
    "numerator": 50,
    "denominator": 1
  },
  "frame_width": 1920,
  "frame_height": 1080,
  "colorspace": "BT709",
  "components": [
    {
      "name": "Y",
      "width": 1920,
      "height": 1080,
      "bit_depth": 10
    },
    {
      "name": "Cb",
      "width": 960,
      "height": 1080,
      "bit_depth": 10
    },
    {
      "name": "Cr",
      "width": 960,
      "height": 1080,
      "bit_depth": 10
    }
  ]
}
mxl-gst-testsrc


./build/Linux-Clang-Debug/tools/mxl-gst/mxl-gst-testsrc [OPTIONS]


OPTIONS:
  -h,     --help              Print this help message and exit
  -v,     --video-config-file TEXT
                              The json file which contains the Video NMOS Flow configuration
          --video-options-file TEXT
                              The json file which contains the Video Flow options.
  -a,     --audio-config-file TEXT
                              The json file which contains the Audio NMOS Flow configuration
          --audio-options-file TEXT
                              The json file which contains the Audio Flow options.
          --audio-offset INT [0]
                              Audio sample offset in number of samples. Positive value means
                              you are adding a delay (commit in the past).
          --video-offset INT [0]
                              Video frame offset in number of frames. Positive value means you
                              are adding a delay (commit in the past).
  -d,     --domain TEXT:DIR REQUIRED
                              The MXL domain directory
  -p,     --pattern TEXT [smpte]
                              Test pattern to use. For available options see
                              https://gstreamer.freedesktop.org/documentation/videotestsrc/index.html?gi-language=c#GstVideoTestSrcPattern
  -t,     --overlay-text TEXT [EBU DMF MXL]
                              Change the text overlay of the test source

Example to run with video only:

./build/Linux-Clang-Debug/tools/mxl-gst/mxl-gst-testsrc \
  -d /dev/shm \
  -v lib/tests/data/v210_flow.json

Example to run with audio only:

./build/Linux-Clang-Debug/tools/mxl-gst/mxl-gst-testsrc \
  -d /dev/shm \
  -a lib/tests/data/audio_flow.json

Example to run with both video and audio:

./build/Linux-Clang-Debug/tools/mxl-gst/mxl-gst-testsrc \
  -d /dev/shm \
  -v lib/tests/data/v210_flow.json \
  -a lib/tests/data/audio_flow.json

By default, videotestsrc produces one slice and one sample at a time because it relies on themaxSyncBatchSizeHint field in the flow options to determine batch size, which defaults to 1 when not configured. To modify this behavior, create separate flow option files for video and audio.

video_options.json

{
  "maxCommitBatchSizeHint": 60,
  "maxSyncBatchSizeHint": 60
}

audio_options.json

{
  "maxCommitBatchSizeHint": 512,
  "maxSyncBatchSizeHint": 512
}

You can run the full example with:

./build/Linux-Clang-Debug/tools/mxl-gst/mxl-gst-testsrc \
  -d /dev/shm \
  -v lib/tests/data/v210_flow.json \
  --video-options-file video_options.json \
  -a lib/tests/data/audio_flow.json \
  --audio-options-file audio_options.json

mxl-gst-sink

A binary that reads from a MXL Flow and display the flow using the gstreamer element 'autovideosink'.

./build/Linux-GCC-Release/tools/mxl-gst/mxl-gst-sink [OPTIONS]


OPTIONS:
  -h,     --help              Print this help message and exit
  -v,     --video-flow-id TEXT
                              The video flow ID
  -a,     --audio-flow-id TEXT
                              The audio flow ID
  -d,     --domain TEXT:DIR REQUIRED
                              The MXL domain directory.
  -l,     --listen-channels UINT [[0,1]]  ...
                              Audio channels to listen.
          --read-delay INT [40000000]
                              How far in the past/future to read (in nanoseconds). A positive
                              values means you are delaying the read.
          --playback-delay INT [0]
                              The time in nanoseconds, by which to delay playback of audio
                              and/or video.
          --av-delay INT [0]  The time in nanoseconds, by which to delay the audio relative to
                              video. A positive value means you are delaying audio, a negative
                              value means you are delaying video.

Example to run with video only:

./build/Linux-Clang-Debug/tools/mxl-gst/mxl-gst-sink \
  -d /dev/shm \
  -v 5fbec3b1-1b0f-417d-9059-8b94a47197ed

Example to run with audio only:

./build/Linux-Clang-Debug/tools/mxl-gst/mxl-gst-sink \
  -d /dev/shm \
  -a b3bb5be7-9fe9-4324-a5bb-4c70e1084449

Example to run with both video and audio:

./build/Linux-Clang-Debug/tools/mxl-gst/mxl-gst-sink \
  -d /dev/shm \
  -v 5fbec3b1-1b0f-417d-9059-8b94a47197ed \
  -a b3bb5be7-9fe9-4324-a5bb-4c70e1084449