Skip to content
systemcoding.dev
Media

Test a display with videotestsrc ! autovideosink

Check that GStreamer can open a window with gst-launch-1.0 videotestsrc ! autovideosink, using num-buffers so the test ends on its own, on GStreamer 1.26.

1 min read
Summarize in AI

Before debugging a real pipeline, check that GStreamer can draw anything at all. videotestsrc generates colour bars, and autovideosink picks whatever video sink the system has.

Shell
gst-launch-1.0 videotestsrc num-buffers=150 ! autovideosink
Text
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:05.000000000
Setting pipeline to NULL ...
Freeing pipeline ...

Without num-buffers the pipeline runs until you press Ctrl-C. With 150 buffers at the default 30 frames per second it ends after five seconds, which makes the command usable in a script. The elapsed time printed on your machine will differ by a few microseconds.

The first four lines show the state changes. A pipeline goes to PAUSED to preroll, which means the sink has received its first buffer, and only then to PLAYING. If a window does not appear, look at where it stopped. A hang at PAUSED usually means a sink or a link problem, and a missing window with no error often means the sink chosen by autovideosink cannot reach a display. Name one explicitly with ximagesink, waylandsink or glimagesink to find out. The element is described in the videotestsrc page.

Taggedgstreamer
Share

More snippets

Media

List ALSA devices with aplay -l

List the playback cards and devices ALSA sees with aplay -l from alsa-utils 1.2, and turn the output into a hw:card,device name.

1 min read

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.