【问题标题】:udpsink doesnt seem to stream anything but filesink worksudpsink 似乎没有流任何东西,但 fileink 工作
【发布时间】:2019-07-14 15:06:53
【问题描述】:

我无法通过 rtp 将脉冲音频监视器流式传输到带有 udpsrc 的 vlc 或 gst-launch 等音频播放器

此命令有效且文件有当前正在播放的音频

gst-launch-1.0 -v pulsesrc device = "alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" ! opusenc ! oggmux ! filesink location=test.ogg 

但是当我使用这个时,

gst-launch-1.0 -v pulsesrc device="alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" ! opusenc ! rtpopuspay ! udpsink host=0.0.0.0 port=4000

vlc(来自安卓手机)告诉我它无法使用 uri rtp://ip-addr:4000 播放流

和 gst-launch 从同一台机器启动,但生成的文件是空的。

gst-launch-1.0 -v udpsrc uri=rtp://0.0.0.0:4000 ! rtpopusdepay ! oggmux ! filesink location=test.ogg

gstreamer 版本是

$ gst-launch-1.0 --version  
gst-launch-1.0 version 1.16.0  
GStreamer 1.16.0

【问题讨论】:

    标签: linux audio gstreamer audio-streaming suse


    【解决方案1】:

    刚开通这个账号,我想把它添加为评论,但由于代表限制无法添加。

    我没有使用 vlc 的经验,但如果我将上限、rtp 流参数的定义添加到 rtpopusdepay,至少我可以让你的 GStreamer 管道正常工作。

    所以而不是:

    gst-launch-1.0 -v udpsrc uri=rtp://0.0.0.0:4000 ! rtpopusdepay ! oggmux ! filesink location=test.ogg

    你需要使用:

    gst-launch-1.0 udpsrc uri=udp://0.0.0.0:4000 ! application/x-rtp,payload=96,encoding-name=OPUS ! rtpopusdepay ! opusdec ! autoaudiosink

    用于 GStreamer。强制性部分是有效负载和编码名称,其他部分可以从 gst-inspect-1.0 rtpopuspay/rtpopusdepay 中找到。您可能需要根据您在服务器端定义的内容/机器上的默认值来更改数字。

    总之,我通过将 rtp 定义移动到 rtpopusdepay 的上限来使 GStreamer 管道正常工作。正如我所说,我不熟悉 vlc,所以我不知道如何在那里定义那些 GStreamer 上限,如果它甚至取决于那些,但我希望这能让你对你的工作有所了解。

    【讨论】:

      猜你喜欢
      • 2023-02-02
      • 2021-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多