Useful GStreamer Commands and Tools¶
Frequently used GStreamer command-line tools for inspection, playback, testing, and debugging.
This English edition preserves the original commands, configuration fragments, and diagrams so the steps can be reproduced directly.
Commands and configuration¶
hywelstar@hywelstar-virtual-machine:~$ gst-device-monitor-1.0 --version
gst-device-monitor-1.0 version 1.20.1
GStreamer 1.20.3
https://launchpad.net/distros/ubuntu/+source/gst-plugins-base1.0
hywelstar@hywelstar-virtual-machine:~$ gst-device-monitor-1.0 --help
Usage:
gst-device-monitor-1.0 [OPTION…] [DEVICE_CLASSES[:FILTER_CAPS]] [DEVICE_CLASSES[:FILTER_CAPS]] …
Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gst Show GStreamer Options
Application Options:
--version Print version information and exit
-f, --follow Don't exit after showing the initial device list, but wait for devices to added/removed.
-i, --include-hidden Include devices from hidden device providers.
hywelstar@hywelstar-virtual-machine:~$ gst-inspect-1.0 --help
Usage:
gst-inspect-1.0 [OPTION…] [ELEMENT-NAME | PLUGIN-NAME]
Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gst Show GStreamer Options
Application Options:
-a, --print-all Print all elements
-b, --print-blacklist Print list of blacklisted files
--print-plugin-auto-install-info Print a machine-parsable list of features the specified plugin or all plugins provide.
Useful in connection with external automatic plugin installation mechanisms
--plugin List the plugin contents
-t, --types A slashes ('/') separated list of types of elements (also known as klass) to list. (unordered)
--exists Check if the specified element or plugin exists
--atleast-version When checking if an element or plugin exists, also check that its version is at least the version specified
-u, --uri-handlers Print supported URI schemes, with the elements that implement them
--no-colors Disable colors in output. You can also achieve the same by setting 'GST_INSPECT_NO_COLORS' environment variable to any value.
--sort=<sort-key> Sort plugins and features. Sorting keys: name (default), none.
-C, --color Color output, even when not sending to a tty.
--version Print version information and exit
#查询元素的属性信息
gst-inspect-1.0 <element-name>
hywelstar@hywelstar-virtual-machine:~$ gst-inspect-1.0 audioconvert
...<省略很多>
# 播放本地文件
gst-play-1.0 <file>
gst-play-1.0 video.mp4
# 播放网络流
gst-play-1.0 <url>
gst-play-1.0 rtsp://example.com/stream
# 指定视频和音频输出设备
gst-play-1.0 <file> --videosink=<sink> --audiosink=<sink>
# 调整播放速度
gst-play-1.0 <file> --rate=<rate>
# 比如1.5倍播放视频
gst-play-1.0 video.mp4 --rate=1.5
# 显示播放进度状态
gst-play-1.0 <file> --verbose
Notes¶
Use these examples as a starting point and adjust versions, device names, codecs, and network addresses for the target platform.