【问题标题】:Gstreamer videomixer Very low framerateGstreamer videomixer 非常低的帧率
【发布时间】:2016-07-15 09:45:40
【问题描述】:

我正在尝试合成来自三个 Rapsberry PI 的三个流。

一旦我使用 videomixer 插件将两个流连接在一起,我就会收到一条以以下结尾的消息:

管道:pipeline0/GstOSXVideoSink:osxvideosink0: 可能存在时间戳问题,或者这台计算机太慢。

奇怪的是,我的任务监视器只显示 gst 大约 15% 的 CPU 使用率

使用三个流,帧率变得不可用。我希望我的 I7 macbook 能够毫无问题地处理这个问题......

这是我用于混合的代码,在这种情况下只有一个流(/sink?)。 谁能告诉我是否有明显的错误?或者我应该在哪里寻找瓶颈并改进它? 谢谢 !

gst-launch-1.0 videomixer name=m sink_1::xpos=400 sink_2::ypos=300 ! autovideosink \
-v udpsrc port=9000 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264'! rtph264depay ! video/x-h264,width=400,height=300,framerate=30/1 ! h264parse ! avdec_h264 ! videoconvert ! m. \
-v udpsrc port=9001 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! video/x-h264,width=400,height=300,framerate=30/1 ! h264parse ! avdec_h264 ! videoconvert ! m. \
-v udpsrc port=9002 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! video/x-h264,width=400,height=300,framerate=30/1 ! h264parse ! avdec_h264 ! videoconvert !  m.

这是我用来从 RPI 摄像头发送流的代码。

raspivid -n -w 640 -h 480 -t 0 -o - \
| gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay \ 
config-interval=10 pt=96 ! udpsink host=192.168.1.3 port=9000

【问题讨论】:

  • 嗯glvideomixer怎么样?我现在不确定 OpenGL 在 RPI 上的功能如何
  • 你能粘贴你正在使用的代码吗?两个流连接到混音器?我也没有在您的管道中看到任何 queue 元素。
  • @otopolsky videomixer 在 Mac 上,由于某种原因 glvideomixer 没有出现在我的设置中。我已经搜索了如何安装它,但我找不到任何关于它的信息。我一定是看错了方向。你能告诉我如何在 Mac 上安装 glvideomixer(我已经安装了插件库,好、坏、丑和 libav)但是当我执行 gst-inspect-1.0 时没有出现 gl 元素
  • @mpr 感谢您的回复,我编辑了代码以反映完整的命令。
  • 也许当您在安装了一些 opengl 开发包的 mac 上重新编译时?我不知道该怎么做..也许在#gstreamer freenode IRC上询问..

标签: raspberry-pi gstreamer frame-rate


【解决方案1】:

尝试为每个视频解码添加队列元素并将sync=false 添加到视频接收器。

gst-launch-1.0 videomixer name=m sink_1::xpos=400 sink_2::ypos=300 ! videoconvert ! ximagesink sync=false \
udpsrc port=9000 ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264 ! rtph264depay ! video/x-h264,width=400,height=300 ! h264parse ! avdec_h264 ! queue ! videoconvert ! m. \
udpsrc port=9001 ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264 ! rtph264depay ! video/x-h264,width=400,height=300 ! h264parse ! avdec_h264 ! queue ! videoconvert ! m. \
udpsrc port=9002 ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264 ! rtph264depay ! video/x-h264,width=400,height=300 ! h264parse ! avdec_h264 ! queue ! videoconvert !  m.

现在我对此的免责声明是,我不确定视频是否会正常流畅和同步,但看起来不错。

此外,在 raspivid 上,您可能希望将 config-interval 属性添加到 rtph264pay 元素。

raspivid -n -w 640 -h 480 -t 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 ! multiudpsink clients=192.168.1.3:9000,192.168.1.3:9001,192.168.1.3:9002

【讨论】:

  • 感谢您的回复。该解决方案确实消除了图像中的抖动和有关丢帧的消息。不幸的是,它也给图像带来了巨大的延迟(大约 5 秒),这对我的目的来说是不合适的。由于低延迟,我开始使用 gstreamer,这正是我所追求的。
  • 我有一个 Pi 来测试。在接收端添加了队列并在 rtph264pay 上设置了一个配置间隔,现在它似乎可以正常执行并在任一端处理重启。
  • 感谢您的反馈。添加您建议的修改确实似乎可以提高性能。太好了!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多