Gst-nvdsaudiotemplate ====================== The OSS Gst-nvdsaudiotemplate plugin is a template plugin which provides a custom library hooking interface for single/batched audio frame(s) processing. Custom lib implementation may have algorithms to transform or process input buffers depending upon the use case. It can support `S16LE` and `F32LE` inputs. The plugin accepts batched NVMM HW and RAW SW buffers, and outputs batched HW and SW buffers. .. image:: /content/DS_plugin_gst-nvdsaudiotemplate.png :align: center :alt: Gst-nvdsaudiotemplate Inputs and Outputs ----------------------- * Inputs * NVMM or RAW Gst Buffers. Supported formats are `S16LE` and `F32LE` * Control parameters * customlib-name * gpu-id * customlib-props * Output * Transformed Gst Buffer Features ----------- The following table summarizes the features of the plugin. .. csv-table:: Gst-nvdsaudiotemplate features :file: ../text/tables/Gst-nvdsaudiotemplate tables/DS_Plugin_gst-nvdsaudiotemplate_features.csv :widths: 30, 30, 30 :header-rows: 1 customlib_impl Interfaces --------------------------- * ``SetInitParams`` - Based on the negotiated caps, this API creates output buffer pool of the negotiated resolution * ``HandleEvent`` - This API handles standard Gstreamer events as well as custom events such as PAD_ADDED PAD_DELETED etc. * ``GetCompatibleCaps`` - This API returns the fixated caps to be set on either SINK / SRC pad of the plugin * ``ProcessBuffer`` - This API passes the GstBuffer to customlib for further processing * ``SetProperty`` - This API sets the customlib properties that are used by the underlying library for processing Gst Properties ---------------- The following table describes the Gst properties of the Gst-nvdsaudiotemplate plugin. .. csv-table:: Gst-nvsaudiotemplate gst properties :file: ../text/tables/Gst-nvdsaudiotemplate tables/DS_Plugin_gst-nvdsaudiotemplate_gst-properties.csv :widths: 20, 20, 20, 20, 20 :header-rows: 1 Sample pipelines ---------------- **For single stream:** :: gst-launch-1.0 audiotestsrc wave=0 num-buffers=1000 ! audioconvert ! nvdsaudiotemplate \ customlib-name="libcustom_impl.so" customlib-props="noise-factor:100" ! \ wavenc ! filesink location=audio.wav **For Multi-stream (Ensure that new nvstreammux is enabled):** :: export USE_NEW_NVSTREAMMUX=yes gst-launch-1.0 audiotestsrc wave=0 ! audioconvert ! m.sink_0 nvstreammux name=m \ ! nvdsaudiotemplate customlib-name="libcustom_impl.so" customlib-props="noise-factor:10" ! nvstreamdemux name=d d.src_0 \ ! wavenc ! filesink location=audio.wav audiotestsrc wave=1 ! audioconvert ! m.sink_1