From 01c2af4b881b5e118a7b0ba4bfe374a094d52cd3 Mon Sep 17 00:00:00 2001 From: dawidwesierski4 Date: Wed, 18 Dec 2024 10:22:18 +0100 Subject: [PATCH] Docs: Create a simple draft of the documentaiton Simple draft of the documentation for the MTL gstreamer plugin. Co-authored-by: Kasiewicz, Marek --- ecosystem/gstreamer_plugin/README.md | 45 ++++++++++++++++++++++++++++ ecosystem/gstreamer_plugin/build.sh | 32 ++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 ecosystem/gstreamer_plugin/README.md create mode 100755 ecosystem/gstreamer_plugin/build.sh diff --git a/ecosystem/gstreamer_plugin/README.md b/ecosystem/gstreamer_plugin/README.md new file mode 100644 index 00000000..ab15d17b --- /dev/null +++ b/ecosystem/gstreamer_plugin/README.md @@ -0,0 +1,45 @@ +# Gstreamer plugin for MTL + +## Building the gstreamer plugins + +```shell +cd Media-Transport-Library/ecosystem/gstreamer_plugin +./build.sh +``` + +## Running the pipeline + +### St20 rawvideo plugin + +To run the st20 rawvideo plugin you need to pass the path to the plugin to your +gstreamer aplication. + +you need to also prepare v210 video + +```shell +export INPUT="path_to_the_input_v210_file" + +# you can produce it with gst-launch-1.0 +gst-launch-1.0 -v videotestsrc pattern=ball ! video/x-raw,width=1920,height=1080,format=v210,framerate=60/1 ! filesink location=$INPUT +``` + +```shell +# dpdk pci address binded (doc/build.md) +export VFIO_PORT_T="pci address of the device" + +# path to the builded gstreamer plugin +export GSTREAMER_PLUGINS_PATH="path to the folder with builded plugins" + +# video pipeline +gst-launch-1.0 ! filesrc location=$INPUT ! \ +'video/x-raw,width=1920,height=1080,format=(string)I422_10LE,framerate=(fraction)60/1' ! rawvideoparse ! \ +mtltxsink tx-queues=4 tx-udp-port=20000 tx-payload-type=112 dev-ip="192.168.96.3" tx-ip="239.168.75.30" dev-port=$VFIO_PORT_T \ +--gst-plugin-path $GSTREAMER_PLUGINS_PATH + + +# looping video pipeline +gst-launch-1.0 multifilesrc location=$INPUT loop=true ! \ +video/x-raw,format=v210,height=1080,width=1920,framerate=60/1 ! rawvideoparse format=v210 height=1080 width=1920 framerate=60/1 ! \ +mtltxsink tx-queues=4 tx-udp-port=20000 tx-payload-type=112 dev-ip="192.168.96.3" tx-ip="239.168.75.30" dev-port=$VFIO_PORT_T \ +--gst-plugin-path $GSTREAMER_PLUGINS_PATH +``` \ No newline at end of file diff --git a/ecosystem/gstreamer_plugin/build.sh b/ecosystem/gstreamer_plugin/build.sh new file mode 100755 index 00000000..93e55679 --- /dev/null +++ b/ecosystem/gstreamer_plugin/build.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -euo pipefail + +BUILD_DIR="builddir" +DEBUG=false + +# Parse command-line arguments +for arg in "$@"; do + case $arg in + --debug) + DEBUG=true + shift + ;; + *) + shift + ;; + esac +done + +if [ -d "$BUILD_DIR" ]; then + echo "Removing existing build directory..." + rm -rf "$BUILD_DIR" || { echo "Failed to remove existing build directory"; exit 1; } +fi + +if [ "$DEBUG" = true ]; then + meson setup --buildtype=debug "$BUILD_DIR" +else + meson setup "$BUILD_DIR" +fi + +meson compile -C "$BUILD_DIR" \ No newline at end of file