0

我想使用 gstreamer xvimagesink 预览 RTMP。如果我像这样使用 autovideosink,我可以看到输出:

gst-launch-1.0 -v rtmpsrc location='rtmp://127.0.0.1:1935/live/stream' ! decodebin3 ! autovideosink

但是如果我用“xvimagesink”替换“autovideosink”,我会得到这个:

Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: Could not initialise Xv output
Additional debug info:
xvimagesink.c(1773): gst_xv_image_sink_open (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
Could not open display (null)
Setting pipeline to NULL ...
Freeing pipeline ...
4

1 回答 1

0

decodebin3和autovideosink都是自动插入GStreamer 元素。这意味着这两个元素都是自动选择可用的,并且最合适的 GStreamer 插件可以从实时 RTMP 流中解复用/解码 (decodebin3) 和渲染视频 (autovideosink)。

所以很有可能,例如,

  • decodebin3xvimagesink以无法在您的平台/硬件和/或您的 Gstreamer 版本上显示的格式解码视频,
  • xvimagesink未在您的平台上正确设置,并且与可用的显示器/监视器无关。

了解更多详情

  • 解码的视频格式decodebin3
  • 视频接收器元素“选择” autovideosink

您可以设置更高(更详细)的 GStreamer 调试级别,例如export GST_DEBUG=3,重新运行管道并检查输出。

于 2020-01-16T16:59:01.913 回答