gstreamer filesrc不适用于错误“ sink-actual-sink-d3dvideo”,但gst-launch在Windows上正常工作

时间:2019-01-21 12:53:18

标签: gstreamer gstreamer-1.0

我想读取文件并播放。非常简单。

* windows10,Visual Studio 2017社区。

在命令提示符下,这正常工作。

gst-launch-1.0 filesrc location="C:/test.webm" ! decodebin ! autovideosink

但是我的代码无法正常工作。

int main(int argc, char *argv[]) {

  ..... declare variable

  /* Initialize GStreamer */
  gst_init (&argc, &argv);

  /* Create the elements */
  source = gst_element_factory_make ("filesrc", "source");
  decode = gst_element_factory_make("decodebin", "decode");
  sink = gst_element_factory_make ("autovideosink", "sink");
  pipeline = gst_pipeline_new ("test-pipeline");
  gst_bin_add_many (GST_BIN (pipeline), source, decode, sink, NULL);
  g_object_set (G_OBJECT(source), "location", "C:/test.webm", NULL);
  bus = gst_element_get_bus (pipeline);

  ... error processing
}

我的错误是这个

Error received from element sink-actual-sink-d3dvideo: Output window was closed
Debugging information: ../sys/d3dvideosink/d3dhelpers.c(1911): d3d_render_buffer (): /GstPipeline:test-pipeline/GstAutoVideoSink:sink/GstD3DVideoSink:sink-actual-sink-d3dvideo

请帮助我,我有什么问题。

  • 我的代码与official tutorial几乎相同。我只是将videotestsrc更改为filesrc,在源和接收器之间添加了debugbin,设置用于提供媒体文件位置的属性

0 个答案:

没有答案