gst-launch伪造“无元素“ udpsrc””错误

时间:2019-09-13 23:21:33

标签: udp gstreamer

命令: gst-launch udpsrc port = 5000 返回:错误:无法构造管道:没有元素“ udpsrc”

命令: gst-launch-1.0 udpsrc uri = udp://239.194.0.177:1026 不会,并且(正确地)执行正确。

第一个命令来自许多流媒体教程,例如this one
第二个命令取自here。只是为了证明udpsrc存在。
他们被削减到令人讨厌的部分。

我拥有gstreamer1.0的所有内容-最新(适用于Ubuntu 16.04.6):

gstreamer1.0-clutter-3.0 is already the newest version (3.0.18-1).
gstreamer1.0-clutter is already the newest version (2.0.18-1).
gstreamer1.0-crystalhd is already the newest version (1:0.0~git20110715.fdd2f19-11build1).
gstreamer1.0-dvswitch is already the newest version (0.1.1-1).
gstreamer1.0-espeak is already the newest version (0.4.0-1).
gstreamer1.0-fluendo-mp3 is already the newest version (0.10.32.debian-1).
gstreamer1.0-nice is already the newest version (0.1.13-0ubuntu2).
gstreamer1.0-pocketsphinx is already the newest version (0.8.0+real5prealpha-1ubuntu2).
gstreamer1.0-alsa is already the newest version (1.8.3-1ubuntu0.3).
gstreamer1.0-doc is already the newest version (1.8.3-1~ubuntu0.1).
gstreamer1.0-plugins-base is already the newest version (1.8.3-1ubuntu0.3).
gstreamer1.0-plugins-base-apps is already the newest version (1.8.3-1ubuntu0.3).
gstreamer1.0-plugins-base-dbg is already the newest version (1.8.3-1ubuntu0.3).
gstreamer1.0-plugins-base-doc is already the newest version (1.8.3-1ubuntu0.3).
gstreamer1.0-plugins-good is already the newest version (1.8.3-1ubuntu0.4).
gstreamer1.0-plugins-good-dbg is already the newest version (1.8.3-1ubuntu0.4).
gstreamer1.0-plugins-good-doc is already the newest version (1.8.3-1ubuntu0.4).
gstreamer1.0-pulseaudio is already the newest version (1.8.3-1ubuntu0.4).
gstreamer1.0-tools is already the newest version (1.8.3-1~ubuntu0.1).
gstreamer1.0-x is already the newest version (1.8.3-1ubuntu0.3).
libgstreamer1.0-0 is already the newest version (1.8.3-1~ubuntu0.1).
libgstreamer1.0-0-dbg is already the newest version (1.8.3-1~ubuntu0.1).
libgstreamer1.0-dev is already the newest version (1.8.3-1~ubuntu0.1).
gstreamer1.0-libav is already the newest version (1.8.3-1ubuntu0.2).
gstreamer1.0-libav-dbg is already the newest version (1.8.3-1ubuntu0.2).
gstreamer1.0-packagekit is already the newest version (0.8.17-4ubuntu6~gcc5.4ubuntu1.4).
gstreamer1.0-plugins-bad is already the newest version (1.8.3-1ubuntu0.2).
gstreamer1.0-plugins-bad-dbg is already the newest version (1.8.3-1ubuntu0.2).
gstreamer1.0-plugins-bad-doc is already the newest version (1.8.3-1ubuntu0.2).
gstreamer1.0-plugins-bad-faad is already the newest version (1.8.3-1ubuntu0.2).
gstreamer1.0-plugins-bad-videoparsers is already the newest version (1.8.3-1ubuntu0.2).
gstreamer1.0-plugins-ugly is already the newest version (1.8.3-1ubuntu0.1).
gstreamer1.0-plugins-ugly-amr is already the newest version (1.8.3-1ubuntu0.1).
gstreamer1.0-plugins-ugly-dbg is already the newest version (1.8.3-1ubuntu0.1).
gstreamer1.0-plugins-ugly-doc is already the newest version (1.8.3-1ubuntu0.1).
gstreamer1.0-vaapi is already the newest version (1.8.3-1~ubuntu0.1).
gstreamer1.0-vaapi-doc is already the newest version (1.8.3-1~ubuntu0.1).
gstreamer1.0-hybris:i386 is already the newest version (1.8.3-1ubuntu0.2).



$ gst-inspect-1.0 udpsrc
Factory Details:
  Rank                     none (0)
  Long-name                UDP packet receiver
  Klass                    Source/Network
  Description              Receive data over the network via UDP
  Author                   Wim Taymans <wim@fluendo.com>, Thijs Vermeir <thijs.vermeir@barco.com>

Plugin Details:
  Name                     udp
  Description              transfer data via UDP
  Filename                 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstudp.so
  Version                  1.8.3
  License                  LGPL
  Source module            gst-plugins-good
  Source release date      2016-08-19
  Binary package           GStreamer Good Plugins (Ubuntu)
  Origin URL               https://launchpad.net/distros/ubuntu/+source/gst-plugins-good1.0

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSrc
                         +----GstPushSrc
                               +----GstUDPSrc

Implemented Interfaces:
  GstURIHandler

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      ANY


Element Flags:
  no flags set

Element Implementation:
  Has change_state() function: 0x7f38aa386e10

Element has no clocking capabilities.

URI handling capabilities:
  Element can act as source.
  Supported URI protocols:
    udp

Pads:
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "udpsrc0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  blocksize           : Size in bytes to read per buffer (-1 = default)
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4096 
  num-buffers         : Number of buffers to output before sending EOS (-1 = unlimited)
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  typefind            : Run typefind before negotiating
                        flags: readable, writable
                        Boolean. Default: false
  do-timestamp        : Apply current stream time to buffers
                        flags: readable, writable
                        Boolean. Default: true
  port                : The port to receive the packets from, 0=allocate
                        flags: readable, writable
                        Integer. Range: 0 - 65535 Default: 5004 
  multicast-group     : The Address of multicast group to join. (DEPRECATED: Use address property instead)
                        flags: readable, writable, deprecated
                        String. Default: "0.0.0.0"
  multicast-iface     : The network interface on which to join the multicast group
                        flags: readable, writable
                        String. Default: null
  uri                 : URI in the form of udp://multicast_group:port
                        flags: readable, writable
                        String. Default: "udp://0.0.0.0:5004"
  caps                : The caps of the source pad
                        flags: readable, writable
                        Caps (NULL)
  socket              : Socket to use for UDP reception. (NULL == allocate)
                        flags: readable, writable
                        Object of type "GSocket"
  buffer-size         : Size of the kernel receive buffer in bytes, 0=default
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 0 
  timeout             : Post a message after timeout nanoseconds (0 = disabled)
                        flags: readable, writable
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  skip-first-bytes    : number of bytes to skip for each udp packet
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 0 
  close-socket        : Close socket if passed as property on state change
                        flags: readable, writable
                        Boolean. Default: true
  used-socket         : Socket currently in use for UDP reception. (NULL = no socket)
                        flags: readable
                        Object of type "GSocket"
  auto-multicast      : Automatically join/leave multicast groups
                        flags: readable, writable
                        Boolean. Default: true
  reuse               : Enable reuse of the port
                        flags: readable, writable
                        Boolean. Default: true
  address             : Address to receive packets for. This is equivalent to the multicast-group property for now
                        flags: readable, writable
                        String. Default: "0.0.0.0"
  loop                : Used for setting the multicast loop parameter. TRUE = enable, FALSE = disable
                        flags: readable, writable
                        Boolean. Default: true

什么鬼?
或者,如果“不清楚我要问的是”:我需要做什么/重新排序/调整/重新配置/重新编译/等以接收来自端口5000的流?我见过的大多数示例都以“ gst-launch udpsrc port = ...”开头。

2 个答案:

答案 0 :(得分:1)

在第一个命令中,您使用gst-launch,但是在第二个gst-launch-1.0中,这就是问题的原因。您应该始终使用gst-launch-1.0gst-launch与GStreamer 0.1相关

答案 1 :(得分:0)

我今天也有此错误,但原因有所不同。我发布此答案是为了以防其他人碰巧遇到它。

事实证明,我没有安装所有的GStreamer开发包,特别是 gstreamer-1.0-msvc-x86_64-1.16.0.msi (应该在Windows机器上注意)。安装完该文件后,GStreamer能够找到udpsrc。