首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么GStreamer的元素总是不处于空状态?

为什么GStreamer的元素总是不处于空状态?
EN

Stack Overflow用户
提问于 2021-03-07 19:37:34
回答 1查看 571关注 0票数 1

最近我想用python中的GStreamer+opencv工具接收来自UDP的H.264流。然而,当我执行下面的句子时:

代码语言:javascript
复制
video = cv2.VideoCapture(
    'udpsrc port=5600 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264"'
    ' ! rtph264depay'
    ' ! avdec_h264'
    ' ! videoconvert'
    ' ! appsink', cv2.CAP_GSTREAMER)

代码卡住并报告错误,就像Trying to dispose element avdec_h264-0, but it is in PLAYING instead of the NULL state.一样,当我再次运行代码时,索引增加了1。为什么所有元素都不是处于正确的NULL状态?

感谢您的阅读,如果可能的话,我想知道在执行这段代码之前我应该做什么。还有没有其他方法可以用H.264编码来流式传输图片呢?

以下是我中断运行时的完整错误报告:

代码语言:javascript
复制
(python:2946615): GStreamer-CRITICAL **: 19:24:31.287:
Trying to dispose element avdec_h264-0, but it is in PLAYING instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.


(python:2946615): GStreamer-CRITICAL **: 19:24:31.287:
Trying to dispose element rtph264depay0, but it is in PLAYING instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.


(python:2946615): GStreamer-CRITICAL **: 19:24:31.287:
Trying to dispose element udpsrc0, but it is in PLAYING instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.


(python:2946615): GStreamer-CRITICAL **: 19:24:31.287: gst_mini_object_unref: assertion '(g_atomic_int_get (&mini_object->lockstate) & LOCK_MASK) < 4' failed

(python:2946615): GStreamer-CRITICAL **: 19:24:31.287:
Trying to dispose element pipeline0, but it is in PAUSED instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.

[ WARN:0] global /home/Users/dqy/myLibs/opencv/modules/videoio/src/cap_gstreamer.cpp (914) open OpenCV | GStreamer warning: unable to start pipeline

(python:2946615): GStreamer-CRITICAL **: 19:24:31.287:
Trying to dispose element videoconvert0, but it is in PLAYING instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.

[ WARN:0] global /home/Users/dqy/myLibs/opencv/modules/videoio/src/cap_gstreamer.cpp (501) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created

(python:2946615): GStreamer-CRITICAL **: 19:24:31.287:
Trying to dispose element appsink0, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyboardInterrupt
EN

回答 1

Stack Overflow用户

发布于 2021-09-01 16:40:23

尝试将drop=1添加到视频捕获行的appsink参数中。请参考this

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66516076

复制
相关文章

相似问题

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