AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 680984
Accepted
MrMas
MrMas
Asked: 2021-12-11 12:52:06 +0800 CST2021-12-11 12:52:06 +0800 CST 2021-12-11 12:52:06 +0800 CST

为什么来自 Gstreamer 的 rtpbin 示例不起作用?

  • 772

我正在尝试运行带有 GStream 1.18.5的 Ubuntu 21.10 VirtualBox VM 的 rtpbin 示例。

  • 我设置了 GStreamer 并且已经能够运行许多基本和播放教程。
  • 我还阅读了Application Developer Manual的大部分内容。

从 C 代码做所有事情似乎很简单,但rtpbin示例使用gst-launch-1.0(在基本教程之一中介绍)。

我最初无法让rtpbin示例运行而没有错误:

  • ffenc_h263和ffdec_h263( WARNING: erroneous pipeline: no element "ffenc_h263"),所以我分别用avenc_h263和替换了它们avdec_h263
  • v4l2src正在寻找一个不可用的设备,/dev所以我切换到videotestsrc.

为了确保这些替换没有问题,我摆脱了 RTSP 和 UDP 的东西并通过运行检查:

gst-launch-1.0 videotestsrc ! videoconvert ! avenc_h263 ! rtph263pay \ 
    ! rtph263depay ! avdec_h263 ! xvimagesink

并看到了“酒吧”视频。我也跑了

gst-launch-1.0 audiotestsrc ! amrnbenc ! rtpamrpay ! rtpamrdepay ! amrnbdec ! alsasink

并听到那恼人的测试音。基于此,我认为问题出在 UDP 和 RTSP 上。

跑步

 gst-launch-1.0 rtpbin name=rtpbin \
         videotestsrc ! videoconvert ! avenc_h263 ! rtph263pay ! rtpbin.send_rtp_sink_0 \
                   rtpbin.send_rtp_src_0 ! udpsink port=5000                            \
                   rtpbin.send_rtcp_src_0 ! udpsink port=5001 sync=false async=false    \
                   udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0                           \
         audiotestsrc ! amrnbenc ! rtpamrpay ! rtpbin.send_rtp_sink_1                   \
                   rtpbin.send_rtp_src_1 ! udpsink port=5002                            \
                   rtpbin.send_rtcp_src_1 ! udpsink port=5003 sync=false async=false    \
                   udpsrc port=5007 ! rtpbin.recv_rtcp_sink_1

节目

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:59.0 / 99:99:99 # This is counting up

然后在另一个窗口中,我运行

gst-launch-1.0 rtpbin name=rtpbin                                          \
     udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H263-1996" \
             port=5000 ! rtpbin.recv_rtp_sink_0                                \
         rtpbin. ! rtph263depay ! avdec_h263 ! xvimagesink                    \
      udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0                               \
      rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false        \
     udpsrc caps="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)AMR,encoding-params=(string)1,octet-align=(string)1" \
             port=5002 ! rtpbin.recv_rtp_sink_1                                \
         rtpbin. ! rtpamrdepay ! amrnbdec ! alsasink                           \
      udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1                               \
      rtpbin.send_rtcp_src_1 ! udpsink port=5007 sync=false async=false

看看

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

我希望看到一些 UDP 端口打开(5000、5001、5002、5003、5005 和 5007)。果然,跑步netstat节目:

rtsp@rtsp-VirtualBox:~$ sudo netstat -apn | grep -w 500[0-9]
udp        0      0 0.0.0.0:5000            0.0.0.0:*                           7076/gst-launch-1.0 
udp        0      0 0.0.0.0:5001            0.0.0.0:*                           7076/gst-launch-1.0 
udp        0      0 0.0.0.0:5002            0.0.0.0:*                           7076/gst-launch-1.0 
udp        0      0 0.0.0.0:5003            0.0.0.0:*                           7076/gst-launch-1.0 
udp        0      0 0.0.0.0:5005            0.0.0.0:*                           6862/gst-launch-1.0 
udp        0      0 0.0.0.0:5007            0.0.0.0:*                           6862/gst-launch-1.0 

确保所有端口都正常工作

  • 我从 snaprtsp-test-server和 VLC安装
  • 我能够通过rtsp-test-server. 我想这不是一个完美的测试,因为使用的是 TCP 端口而不是 UDP,但它很容易测试,所以我试了一下。

但我没有看到任何视频或听到任何声音。有人可以指出我的错误吗?

gstreamer
  • 1 1 个回答
  • 518 Views

1 个回答

  • Voted
  1. Best Answer
    MrMas
    2021-12-11T12:52:06+08:002021-12-11T12:52:06+08:00

    我几乎准备好提交我的问题,我又做了一次互联网搜索。我发现本教程显示了添加到udpsrcandudpsink元素的几个额外标志。添加以下标志使示例正常工作,以便我可以通过 RTSP 看到视频和听到声音:

    • host=127.0.0.1在所有udpsink元素上
    • address=127.0.0.1在所有udpsource元素上

    我认为我离开的那个教程中的其他标志可能是默认值。

    • 0

相关问题

  • 从 gst fbdevsink 上的元素“pipeline0”获取 EOS

  • gstreamer 和 vhs 捕获:视频正常,但静音

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve