Camera Testing Linux with GStreamer

From The Imaging Source Knowledgebase
Jump to navigation Jump to search

This guide is especially suitable for headless Linux, i.e. without a graphical user interface or only SSH access.

If The Imaging Source tiscamera package is installed, some tools and the Gstreamer module are available.

The call

$ tcam-ctrl -l

provides a list of the connected cameras. This is always a first step in finding errors and checking whether the camera is actually there.

With the GStreamer tool gst-launch-1.0 command line program, GStreamer pipelines can be easily tested without having to write your own program:

$ gst-launch-1.0 tcambin ! videoconvert ! aasink

This pipeline displays the live video as ASCII graphics with the aasink module and therefore also allows a function test in the terminal and via SSH.

The trigger mode of a camera can also be easily tested:

$ gst-launch-1.0 tcambin tcam-properties=tcam,TriggerMode="On" ! videoconvert ! aasink

However, this assumes that an external hardware trigger is connected to the camera. As long as there is no trigger pulse, there is also an image. Attention: The camera remains in trigger mode, so that another gst-launch-1.0 test without a trigger will not produce any images. You are on the safe side if you then use

$ gst-launch-1.0 tcambin tcam-properties=tcam,TriggerMode="Off" ! videoconvert ! aasink

is executed.

With the following input, images can easily be saved automatically with every trigger signal:

$ gst-launch-1.0 tcambin tcam-properties=tcam,TriggerMode="On" ! videoconvert ! jpegenc ! multifilesink location=img_%06d.jpg

If a graphical user interface (GUI) is available, the "ximagesink" can also be used instead of the "aasink".

For further questions, please use our contact form