尝试创建仅发送 WebRTC 管道时出错

mir*_*ris 5 gstreamer webrtc

我已经从源代码安装了 GStreamer-1.18.0 以及基本的、好的、坏的和丑陋的插件。

我不熟悉 WebRTC,所以我决定从演示开始,看看它是如何工作的。我在https://github.com/centricular/gstwebrtc-demos/tree/master/sendonly找到了一个小演示。

不幸的是,当运行演示并浏览到该位置时,我在终端中收到以下错误:

WebRTC page link: http://127.0.0.1:57778/
Processing new websocket connection 0x6d14c0
** (webrtc-unidirectional-h264:168870): ERROR **: Could not create WebRTC pipeline: could not link payloader to webrtcbin, webrtcbin can't handle caps application/x-rtp, media=(string)video, encoding-name=(string)H264, payload=(int)96

Trace/BPT trap (core dumped)
Run Code Online (Sandbox Code Playgroud)

这是演示应用程序尝试的管道命令:

gst-launch-1.0 webrtcbin name=webrtcbin stun-server=stun://stun.l.google.com:19302 v4l2src ! videorate ! video/x-raw,width=640,height=360,framerate=15/1 ! videoconvert ! queue max-size-buffers=1 ! x264enc bitrate=600 speed-preset=ultrafast tune=zerolatency key-int-max=15 ! video/x-h264,profile=constrained-baseline ! queue max-size-time=100000000 ! h264parse ! rtph264pay config-interval=-1 name=payloader ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! webrtcbin.
Run Code Online (Sandbox Code Playgroud)

这对我来说似乎很奇怪,因为当我检查 webrtcbin 时,它确实说它具有 application/x-rtp 的功能(也在 GStreamer 文档中):

Prompt--> gst-inspect-1.0 webrtcbin
...
Pad Templates:
  SINK template: 'sink_%u'
    Availability: On request
    Capabilities:
      application/x-rtp
    Type: GstWebRTCBinPad
    Pad Properties:
      transceiver         : Transceiver associated with this pad
                            flags: readable
                            Object of type "GstWebRTCRTPTransceiver"
  
Run Code Online (Sandbox Code Playgroud)

有没有关于如何解决这个问题的建议?也许 GStreamer 包中没有正确安装某些东西?或者我在操作系统权限\设置中遗漏了什么?

mir*_*ris 10

GStreamer 缺少不错的插件。通过确保 libgstnice.so 位于正确的位置解决了此问题。