首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GStreamer shm接收器断言‘段->格式==格式’失败

GStreamer shm接收器断言‘段->格式==格式’失败
EN

Stack Overflow用户
提问于 2020-02-05 11:25:35
回答 1查看 2.9K关注 0票数 0

下面的管道使用OpenCV VideoWriter元素从我的程序内部运行。

代码语言:javascript
复制
gst-launch-1.0 -v videotestsrc ! clockoverlay ! shmsink socket-path=/tmp/sink shm-size=2000000 name=/dev/shm wait-for-connection=false

当我通过以下管道使用流时,一切都正常。

代码语言:javascript
复制
gst-launch-1.0 -v shmsrc is-live=true socket-path=/tmp/sink shm-area-name=/dev/shm ! \
    "video/x-raw, format=BGR, width=(int)160, height=(int)120, framerate=(fraction)30/1" ! \
    queue ! videoconvert ! autovideosink

但是,当我尝试用以下管道在h264中对流进行编码时

代码语言:javascript
复制
gst-launch-1.0 -vvv shmsrc is-live=true socket-path=/tmp/sink shm-area-name=/dev/shm ! \
    "video/x-raw, format=BGR, width=(int)160, height=(int)120, framerate=(fraction)30/1" ! \
    queue ! videoconvert ! x264enc bitrate=1000 ! video/x-h264,profile=baseline ! \
    rtph264pay config-interval=1 pt=96 ! queue ! udpsink host=127.0.0.1 port=5000

我得到了

(gst-launch-1.0:8119): GStreamer-CRITICAL **: gst_segment_to_running_time: assertion 'segment->format == format' failed

我在VLC上什么也看不见。我遗漏了什么?

注意事项:要重现这个问题,可以使用以下生产者/消费者管道:

代码语言:javascript
复制
gst-launch-1.0 -v videotestsrc ! clockoverlay ! shmsink socket-path=/tmp/sink shm-size=2000000 name=/dev/shm wait-for-connection=false
代码语言:javascript
复制
sudo gst-launch-1.0 -vvv shmsrc is-live=true socket-path=/tmp/sink shm-area-name=/dev/shm ! \
    "video/x-raw, format=BGR, width=(int)160, height=(int)120, framerate=(fraction)30/1" ! \
    queue ! videoconvert ! x264enc bitrate=1000 ! video/x-h264,profile=baseline ! rtph264pay config-interval=1 pt=96 ! queue ! udpsink host=127.0.0.1 port=5000

系统信息

  • Ubuntu 16.04
  • GStreamer 1.8.3
  • OpenCV 3.4.0
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-06 09:16:11

最后,我找到了帮助我解决问题的文章。

我最后的管道如下所示。

生产者管道

代码语言:javascript
复制
gst-launch-1.0 -v videotestsrc is-live=true ! clockoverlay ! shmsink socket-path=/tmp/sink shm-size=2000000 name=/dev/shm sync=true wait-for-connection=false

消费管线

代码语言:javascript
复制
gst-launch-1.0 -vvv shmsrc is-live=true do-timestamp=true socket-path=/tmp/sink shm-area-name=/dev/shm ! \
    "video/x-raw, format=BGR, width=(int)160, height=(int)120, framerate=(fraction)30/1" ! \
    queue ! videoconvert ! x264enc bitrate=1000 ! video/x-h264,profile=baseline ! rtph264pay config-interval=1 pt=96 ! queue ! udpsink host=192.168.200.255 port=5000 sync=false
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60074726

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档