pipeline-snapshot

This tracer provides an easy way to take a snapshot of all the pipelines without having to modify the application. One just has to load the tracer and send the SIGUSR1 UNIX signal to take snapshots. It currently only works on UNIX systems.

When taking a snapshot pipelines are saved to DOT files, but the tracer may be extended in the future to dump more information.

Example:

$ GST_TRACERS="pipeline-snapshot" GST_DEBUG_DUMP_DOT_DIR=. gst-launch-1.0 audiotestsrc ! fakesink

You can then trigger a snapshot using:

$ kill -SIGUSR1 $(pidof gst-launch-1.0)

Parameters can be passed to configure the tracer:

  • dot-dir (string, default: None): directory where to place dot files (overriding GST_DEBUG_DUMP_DOT_DIR).
  • xdg-cache: Instead of using GST_DEBUG_DUMP_DOT_DIR or dot-dir, use $XDG_CACHE_DIR/gstreamer-dots to save dot files.
  • dot-prefix (string, default: "pipeline-snapshot-"): when dumping pipelines to a dot file each file is named $prefix$pipeline_name.dot.
  • dot-ts (boolean, default: "true"): if the current timestamp should be added as a prefix to each pipeline dot file.
  • cleanup-mode (enum, default: "none"): Determines how .dot files are cleaned up:
    • "initial": Removes all existing .dot files from the target folder when the tracer starts
    • "automatic": Performs cleanup before each snapshot. If folder-mode is enabled, cleans up .dot files within folders. If folder-mode is None, cleans up .dot files directly in the target directory
    • "none": Never removes any .dot files
  • folder-mode (enum, default: "none"): Controls how .dot files are organized in folders:
    • "none": All .dot files are stored directly in the target directory without subfolder organization
    • "numbered": Creates a new numbered folder (starting from 0) for each snapshot operation
    • "timed": Creates a new folder named with the current timestamp for each snapshot operation
  • dots-viewer-websocket-url: A websocket URL to connect to a dots-viewer server instance, allowing the user to snapshot running pipelines from the web page. To trigger a snapshot, the user should send a json message with the following format: json { "type": "Snapshot" }

Examples:

Basic usage with custom prefix and timestamp:

$ GST_TRACERS="pipeline-snapshot(dot-prefix="badger-",dot-ts=true,xdg-cache=true)" GST_DEBUG_DUMP_DOT_DIR=. gst-launch-1.0 audiotestsrc ! fakesink

Using numbered folders with automatic cleanup:

$ GST_TRACERS="pipeline-snapshot(folder-mode=numbered,cleanup-mode=automatic)" GST_DEBUG_DUMP_DOT_DIR=. gst-launch-1.0 audiotestsrc ! fakesink

Using timestamped folders with initial cleanup:

$ GST_TRACERS="pipeline-snapshot(folder-mode=timed,cleanup-mode=initial)" GST_DEBUG_DUMP_DOT_DIR=. gst-launch-1.0 audiotestsrc ! fakesink

Named constants

Pipeline-snapshot-cleanup-mode

Members

initial (0) – CleanupInitial: Remove all .dot files from folder when starting
automatic (1) – CleanupAutomatic: cleanup .dot files before each snapshots if pipeline-snapshot::folder-mode is not None otherwise cleanup `.dot` files in folders
none (2) – None: Never remove any dot file

Pipeline-snapshot-folder-mode

Members

none (0) – None: Do not use folders to store dot files
numbered (1) – Numbered: Use folders to store dot files, each time `.snapshot()` is called a new folder is created and named with a number starting from 0.
timed (2) – Timed: Use folders to store dot files, each time `.snapshot()` is called a new folder is created and named with the current timestamp.

GstPipelineSnapshot

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstTracer
                ╰──GstPipelineSnapshot

Action Signals

snapshot

g_signal_emit_by_name (param_0, "snapshot");
ret = param_0.emit ("snapshot")
let ret = param_0.emit ("snapshot");

Parameters:

param_0 (GstElement *)
No description available

Flags: Run Last / Action


Properties

cleanup-mode

“cleanup-mode” Pipeline-snapshot-cleanup-mode *

Cleanup mode

Flags : Read / Write

Default value : none (2)


dot-dir

“dot-dir” gchararray

Directory where to place dot files

Flags : Read / Write / Construct Only

Default value : NULL


dot-pipeline-ptr

“dot-pipeline-ptr” gboolean

Add pipeline ptr value to dot files

Flags : Read / Write

Default value : false


dot-prefix

“dot-prefix” gchararray

Prefix for dot files

Flags : Read / Write

Default value : pipeline-snapshot-


dot-ts

“dot-ts” gboolean

Add timestamp to dot files

Flags : Read / Write

Default value : true


dots-viewer-ws-url

“dots-viewer-ws-url” gchararray

gst-dots-viewer websocket URL

Flags : Read / Write / Construct Only

Default value : NULL


folder-mode

“folder-mode” Pipeline-snapshot-folder-mode *

How to create folder each time a snapshot of all pipelines is made

Flags : Read / Write

Default value : none (0)


xdg-cache

“xdg-cache” gboolean

Use $XDG_CACHE_DIR/gstreamer-dots

Flags : Read / Write / Construct Only

Default value : false


The results of the search are