gst-discoverer-0.10 gst-inspect-0.10 gst-launch-1.0 gst-typefind-1.0 gst-xmllaunch-0.10
查看所有插件
beijing:/usr/lib/gstreamer-1.0 #
查看某一个插件的信息
beijing:/usr/lib/gstreamer-1.0 # gst-inspect-1.0 v4l2src
Factory Details:
Rank primary (256)
Long-name Video (video4linux2) Source
Klass Source/Video
Description Reads frames from a Video4Linux2 device
Author Edgard Lima
Plugin Details:
Name video4linux2
Description elements for Video 4 Linux
Filename /usr/lib64/gstreamer-1.0/libgstvideo4linux2.so 该插件库的位置
Version 1.4.3
License LGPL
Source module gst-plugins-good
Source release date 2014-09-24
Binary package GStreamer Good Plug-ins source release
Origin URL Unknown package origin
GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstBaseSrc
+----GstPushSrc
+----GstV4l2Src
实现的接口:
GstURIHandler
GstTuner
GstColorBalance
GstVideoOrientation
Pad Templates:
SRC template: 'src'
Availability: Always
Capabilities:
image/jpeg
video/mpeg
mpegversion: 4
systemstream: false
video/mpeg
mpegversion: 2
video/mpegts
systemstream: true
video/x-bayer
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-dv
systemstream: true
video/x-h263
variant: itu
video/x-h264
stream-format: byte-stream
alignment: au
video/x-pwc1
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-pwc2
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw
format: { RGB15, RGB16, BGR, RGB, BGRx, BGRA, xRGB, ARGB, GRAY8, YVU9, YV12, YUY2, UYVY, Y42B, Y41B, NV12_64Z32, YUV9, I420, YVYU, NV21, NV12 }
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-sonix
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-vp8
Element Flags:
no flags set
Element Implementation:
Has change_state() function: 0x7fd05e4ebb10
Element has no clocking capabilities.
URI handling capabilities:
Element can act as source.
Supported URI protocols:
v4l2
Pads:
SRC: 'src'
Implementation:
Has getrangefunc(): gst_base_src_getrange
Has custom eventfunc(): gst_base_src_event
Has custom queryfunc(): gst_base_src_query
Has custom iterintlinkfunc(): gst_pad_iterate_internal_links_default
Pad Template: 'src'
Element Properties:
name : The name of the object
flags: 可读, 可写
String. Default: "v4l2src0"
parent : The parent of the object
flags: 可读, 可写
Object of type "GstObject"
blocksize : Size in bytes to read per buffer (-1 = default)
flags: 可读, 可写
Unsigned Integer. Range: 0 - 4294967295 Default: 4096
num-buffers : Number of buffers to output before sending EOS (-1 = unlimited)
flags: 可读, 可写 指定输出缓冲区有几个
Integer. Range: -1 - 2147483647 Default: -1
typefind : Run typefind before negotiating
flags: 可读, 可写
Boolean. Default: false
do-timestamp : Apply current stream time to buffers
flags: 可读, 可写
Boolean. Default: false
device : Device location
flags: 可读, 可写
String. Default: "/dev/video0"
device-name : Name of the device
flags: 可读
String. Default: "Lenovo EasyCamera"
device-fd : File descriptor of the device
flags: 可读
Integer. Range: -1 - 2147483647 Default: -1
flags : Device type flags
flags: 可读
Flags "GstV4l2DeviceTypeFlags" Default: 0x00000000, "(none)"
(0x00000001): capture - Device supports video capture
(0x00000002): output - Device supports video playback
(0x00000004): overlay - Device supports video overlay
(0x00000010): vbi-capture - Device supports the VBI capture
(0x00000020): vbi-output - Device supports the VBI output
(0x00010000): tuner - Device has a tuner or modulator
(0x00020000): audio - Device has audio inputs or outputs
brightness : Picture brightness, or more precisely, the black level
flags: 可读, 可写, 可控制
Integer. Range: -2147483648 - 2147483647 Default: 0
contrast : Picture contrast or luma gain
flags: 可读, 可写, 可控制
Integer. Range: -2147483648 - 2147483647 Default: 0
saturation : Picture color saturation or chroma gain
flags: 可读, 可写, 可控制
Integer. Range: -2147483648 - 2147483647 Default: 0
hue : Hue or color balance
flags: 可读, 可写, 可控制
Integer. Range: -2147483648 - 2147483647 Default: 0
norm : video standard
flags: 可读, 可写
Enum "V4L2_TV_norms" Default: 0, "none"
(0): none - none
(45056): NTSC - NTSC
(4096): NTSC-M - NTSC-M
(8192): NTSC-M-JP - NTSC-M-JP
(32768): NTSC-M-KR - NTSC-M-KR
(16384): NTSC-443 - NTSC-443
(255): PAL - PAL
(7): PAL-BG - PAL-BG
(1): PAL-B - PAL-B
(2): PAL-B1 - PAL-B1
(4): PAL-G - PAL-G
(8): PAL-H - PAL-H
(16): PAL-I - PAL-I
(224): PAL-DK - PAL-DK
(32): PAL-D - PAL-D
(64): PAL-D1 - PAL-D1
(128): PAL-K - PAL-K
(256): PAL-M - PAL-M
(512): PAL-N - PAL-N
(1024): PAL-Nc - PAL-Nc
(2048): PAL-60 - PAL-60
(16711680): SECAM - SECAM
(65536): SECAM-B - SECAM-B
(262144): SECAM-G - SECAM-G
(524288): SECAM-H - SECAM-H
(3276800): SECAM-DK - SECAM-DK
(131072): SECAM-D - SECAM-D
(1048576): SECAM-K - SECAM-K
(2097152): SECAM-K1 - SECAM-K1
(4194304): SECAM-L - SECAM-L
(8388608): SECAM-Lc - SECAM-Lc
io-mode : I/O mode
flags: 可读, 可写
Enum "GstV4l2IOMode" Default: 0, "auto"
(0): auto - GST_V4L2_IO_AUTO
(1): rw - GST_V4L2_IO_RW
(2): mmap - GST_V4L2_IO_MMAP
(3): userptr - GST_V4L2_IO_USERPTR
(4): dmabuf - GST_V4L2_IO_DMABUF
(5): dmabuf-import - GST_V4L2_IO_DMABUF_IMPORT
extra-controls : Extra v4l2 controls (CIDs) for the device
flags: 可读, 可写
Boxed pointer of type "GstStructure"
pixel-aspect-ratio : Overwrite the pixel aspect ratio of the device
flags: 可读, 可写
String. Default: null
force-aspect-ratio : When enabled, the pixel aspect ratio will be enforced
flags: 可读, 可写
Boolean. Default: true
Element Signals:
"prepare-format" : void user_function (GstElement* object,
gint arg0,
GstCaps* arg1,
gpointer user_data);
beijing:/usr/lib/gstreamer-1.0 #
这个插件jpegenc是将流编码成jpeg格式
beijing:/usr/lib/gstreamer-1.0 # gst-inspect-1.0 jpegenc
Factory Details:
Rank primary (256)
Long-name JPEG image encoder
Klass Codec/Encoder/Image
Description Encode images in JPEG format
Author Wim Taymans
Plugin Details:
Name jpeg
Description JPeg plugin library
Filename /usr/lib64/gstreamer-1.0/libgstjpeg.so
Version 1.4.3
License LGPL
Source module gst-plugins-good
Source release date 2014-09-24
Binary package GStreamer Good Plug-ins source release
Origin URL Unknown package origin
GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstVideoEncoder
+----GstJpegEnc
实现的接口:
GstPreset
Pad Templates:
SINK template: 'sink'
Availability: Always
Capabilities:
video/x-raw
format: { I420, YV12, YUY2, UYVY, Y41B, Y42B, YVYU, Y444, RGB, BGR, RGBx, xRGB, BGRx, xBGR, GRAY8 }
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
SRC template: 'src'
Availability: Always
Capabilities:
image/jpeg
width: [ 16, 65535 ]
height: [ 16, 65535 ]
framerate: [ 0/1, 2147483647/1 ]
sof-marker: { 0, 1, 2, 9 }
Element Flags:
no flags set
Element Implementation:
Has change_state() function: gst_video_encoder_change_state
Element has no clocking capabilities.
Element has no URI handling capabilities.
Pads:
SINK: 'sink'
Implementation:
Has chainfunc(): gst_video_encoder_chain
Has custom eventfunc(): gst_video_encoder_sink_event
Has custom queryfunc(): gst_video_encoder_sink_query
Has custom iterintlinkfunc(): gst_pad_iterate_internal_links_default
Pad Template: 'sink'
SRC: 'src'
Implementation:
Has custom eventfunc(): gst_video_encoder_src_event
Has custom queryfunc(): gst_video_encoder_src_query
Has custom iterintlinkfunc(): gst_pad_iterate_internal_links_default
Pad Template: 'src'
Element Properties:
name : The name of the object
flags: 可读, 可写
String. Default: "jpegenc0"
parent : The parent of the object
flags: 可读, 可写
Object of type "GstObject"
quality : Quality of encoding
flags: 可读, 可写
Integer. Range: 0 - 100 Default: 85
idct-method : The IDCT algorithm to use
flags: 可读, 可写
Enum "GstIDCTMethod" Default: 1, "ifast"
(0): islow - Slow but accurate integer algorithm
(1): ifast - Faster, less accurate integer method
(2): float - Floating-point: accurate, fast on fast HW
这个插件filesink的功能是将流写入文件
beijing:/usr/lib/gstreamer-1.0 # gst-inspect-1.0 filesink
Factory Details:
Rank primary (256)
Long-name File Sink
Klass Sink/File
Description Write stream to a file
Author Thomas Vander Stichele
Plugin Details:
Name coreelements
Description GStreamer core elements
Filename /usr/lib64/gstreamer-1.0/libgstcoreelements.so
Version 1.4.3
License LGPL
Source module gstreamer
Source release date 2014-09-24
Binary package GStreamer source release
Origin URL Unknown package origin
GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstBaseSink
+----GstFileSink
实现的接口:
GstURIHandler
Pad Templates:
SINK template: 'sink'
Availability: Always
Capabilities:
ANY
Element Flags:
no flags set
Element Implementation:
Has change_state() function: gst_base_sink_change_state
Element has no clocking capabilities.
URI handling capabilities:
Element can act as sink.
Supported URI protocols:
file
Pads:
SINK: 'sink'
Implementation:
Has chainfunc(): gst_base_sink_chain
Has custom eventfunc(): gst_base_sink_event
Has custom queryfunc(): gst_base_sink_sink_query
Has custom iterintlinkfunc(): gst_pad_iterate_internal_links_default
Pad Template: 'sink'
Element Properties:
name : The name of the object
flags: 可读, 可写
String. Default: "filesink0"
parent : The parent of the object
flags: 可读, 可写
Object of type "GstObject"
sync : Sync on the clock
flags: 可读, 可写
Boolean. Default: false
max-lateness : Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited)
flags: 可读, 可写
Integer64. Range: -1 - 9223372036854775807 Default: -1
qos : Generate Quality-of-Service events upstream
flags: 可读, 可写
Boolean. Default: false
async : Go asynchronously to PAUSED
flags: 可读, 可写
Boolean. Default: true
ts-offset : Timestamp offset in nanoseconds
flags: 可读, 可写
Integer64. Range: -9223372036854775808 - 9223372036854775807 Default: 0
enable-last-sample : Enable the last-sample property
flags: 可读, 可写
Boolean. Default: true
last-sample : The last sample received in the sink
flags: 可读
Boxed pointer of type "GstSample"
blocksize : Size in bytes to pull per buffer (0 = default)
flags: 可读, 可写
Unsigned Integer. Range: 0 - 4294967295 Default: 4096
render-delay : Additional render delay of the sink in nanoseconds
flags: 可读, 可写
Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0
throttle-time : The time to keep between rendered buffers (0 = disabled)
flags: 可读, 可写
Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0
max-bitrate : The maximum bits per second to render (0 = disabled)
flags: 可读, 可写
Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0
location : Location of the file to write 指定要写入的文件
flags: 可读, 可写
String. Default: null
buffer-mode : The buffering mode to use
flags: 可读, 可写
Enum "GstFileSinkBufferMode" Default: -1, "default"
(-1): default - Default buffering
(0): full - Fully buffered
(1): line - Line buffered
(2): unbuffered - Unbuffered
buffer-size : Size of buffer in number of bytes for line or full buffer-mode
flags: 可读, 可写
Unsigned Integer. Range: 0 - 4294967295 Default: 65536
append : Append to an already existing file
flags: 可读, 可写
Boolean. Default: false
beijing:/usr/lib/gstreamer-1.0 #
使用v4l2src采集图像,使用jpegenc编码,使用filesink写入文件 。
beijing:/home/shell.albert # gst-launch-1.0 v4l2src ! jpegenc ! filesink location=./zsy.jpg
设置暂停管道 ...
管道正在使用且不需要 PREROLL ...
设置播放管道 ...
New clock: GstSystemClock
^Chandling interrupt.
中断: 中止管道 ...
Execution ended after 0:00:07.098121000
设置暂停管道 ...
设置备用管道 ...
设置 NULL 管道 ...
释放管道资源 ...
beijing:/home/shell.albert #
不知道怎么停止? 只能按Ctrl+C了。图像是采集到了。查看正常。
找到了,通过查看v4l2src插件的信息,发现一个有用的参数:
num-buffers : Number of buffers to output before sending EOS (-1 = unlimited)
flags: 可读, 可写
Integer. Range: -1 - 2147483647 Default: -1
所以我把刚才的命令改一下,让v4l2src只有一个缓冲区可用,这样是不是就只输出一帧图像了呢?
beijing:/home/shell.albert # gst-launch-1.0 v4l2src num-buffers=1 ! jpegenc ! filesink location=./zsy.jpg
设置暂停管道 ...
管道正在使用且不需要 PREROLL ...
设置播放管道 ...
New clock: GstSystemClock
收到来自组件“pipeline0”的 EOS 信号。
Execution ended after 0:00:00.862794904
设置暂停管道 ...
设置备用管道 ...
设置 NULL 管道 ...
释放管道资源 ...
beijing:/home/shell.albert #
的确是这样,今天研究到这里,回家给豆豆做饭去了。