流式传输任务暂停、原因错误 (-5) 是什么意思?

What is meant by streaming task paused, reason error (-5)?

我用过这个管道,

 gst-launch-1.0 -e videotestsrc pattern="snow" ! video/x-raw, framerate=10/1, width=200, height=150 ! videomixer name=mix ! autovideosink videotestsrc ! video/x-raw, framerate=10/1, width=640, height=360 ! mix.

但是,关闭输出后window,

EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc1: Internal data flow error.
Additional debug info:
gstbasesrc.c(2946): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc1:
streaming task paused, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2946): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason error (-5)

这是什么意思,这个流式传输任务暂停是什么意思,原因错误 (-5) 错误是什么意思?

你的管道对我有用..但你必须用 Ctrl+C 关闭它而不是关闭 window..这是因为没有实施正确的关闭 window 处理(也许某处有用于 autovideosink 或其他视频接收器的标志。我不知道)。

即使是这个简单的管道也会出现问题(您可以尝试使用 glimagesink 和 xvimagesink,但错误类似):

GST_DEBUG=3 gst-launch-1.0 -e videotestsrc pattern="snow" ! ximagesink

检查 the error 的文档时:

GST_FLOW_ERROR Some (fatal) error occurred. Element generating this error should post an error message with more details.

好吧,我们用更高的调试日志检查问题(不过你应该已经学到了这一课!)我们看到:

0:00:02.697769439 29872 0x2647590 WARN ximagesink ximagesink.c:1423:gst_x_image_sink_show_frame: could not output image - no window

0:00:02.697815511 29872 0x2647590 WARN basesrc gstbasesrc.c:2943:gst_base_src_loop: error:

Internal data flow error.

0:00:02.697826432 29872 0x2647590 WARN basesrc gstbasesrc.c:2943:gst_base_src_loop: error: streaming task paused, reason error (-5)

嗯,错误很明显:

could not output image - no window

顺便说一句,错误代码是:

typedef enum {
  /* custom success starts here */
  GST_FLOW_CUSTOM_SUCCESS_2 = 102,
  GST_FLOW_CUSTOM_SUCCESS_1 = 101,
  GST_FLOW_CUSTOM_SUCCESS = 100,

  /* core predefined */
  GST_FLOW_OK             =  0,
  /* expected failures */
  GST_FLOW_NOT_LINKED     = -1,
  GST_FLOW_FLUSHING       = -2,
  /* error cases */
  GST_FLOW_EOS            = -3,
  GST_FLOW_NOT_NEGOTIATED = -4,
  GST_FLOW_ERROR          = -5,
  GST_FLOW_NOT_SUPPORTED  = -6,

  /* custom error starts here */
  GST_FLOW_CUSTOM_ERROR   = -100,
  GST_FLOW_CUSTOM_ERROR_1 = -101,
  GST_FLOW_CUSTOM_ERROR_2 = -102
} GstFlowReturn;

所以再次 - 解决方案是用 Ctrl+C 停止它而不是点击 window 交叉..如果这是不可接受的那么你将不得不在 C 中实现它并正确处理 windows 关闭(我发誓 gstreamer 文档中有它的教程..)