How to generate a Gstreamer pipeline diagram (graph)

From RidgeRun Developer Connection
Jump to: navigation, search


This page will allow you to create a useful diagram of your pipeline, as described in


1. Install dot:

 sudo apt-get install graphviz

The "dot" command is available in the "graphviz" package.

2. In the target, run:

 # export GST_DEBUG_DUMP_DOT_DIR=/tmp/

This will place the .dot generated files in your /tmp/ directory, you can change that directory if you need to.

3. Run your pipeline, for example:

 # gst-launch audiotestsrc num-buffers=1000 ! fakesink sync=false

After the pipeline is over, you can see the .dot generated files, and the "*PLAYING_PAUSED*" one is typically used to generate the diagram.

 # ls /tmp

4. In your host machine, generate the diagram from the dot file

This step implies you know how to transfer the .dot file from your target to your host machine. Once you've done that, you can generate the .png image using the "dot" command in your host:

 $ dot -Tpng > pipeline.png

5. Open up your image

Once the image has been created, you can open it with your favorite image viewer, for example:

 $ eog pipeline.png

Helper Script

Sometimes you can get a lot of different DOT files generated. If you want to convert each one of them to PNG pictures, you can use this script. Specify the folder where your DOT files are (DOT_FILES_DIR), and the folder where you want to place the generated PNG files (PNG_FILES_DIR).


DOT_FILES=`ls $DOT_FILES_DIR | grep dot`

for dot_file in $DOT_FILES
  png_file=`echo $dot_file | sed s/.dot/.png/`
  dot -Tpng $DOT_FILES_DIR/$dot_file > $PNG_FILES_DIR/$png_file

Generate from a gstreamer application

Add this to your app after all the elements are created and linked.


and run the app like:

# GST_DEBUG_DUMP_DOT_DIR=. ./application

Where you ran the application, you can find a file named, move it to your computer and apply follows:

$ dot -Tpng > pipeline.png

Open the pipeline.png

$ eog pipeline.png

See Also

Gstreamer Debugging


Gstreamer Debugging Tools Tutorial. Section "Getting pipeline graphs".

DOT Language

Graph Visualization Software