Gstreamer基本管道正在运行,但未显示在Windows7虚拟盒上

Gstreamer basic pipeline running but not displaying on windows 7 virtualbox

本文关键字:显示 Windows7 虚拟 管道 运行 Gstreamer      更新时间:2023-10-16

我目前在Windows 7(x86_64)上使用Gstreamer作为VM(Virtualbox),我想运行一个基本的管道:

gst-launch-1.0 -v videotestsrc pattern=snow ! autovideosync

当我运行这个管道时,我得到:

Setting pipeline to PAUSED...
Pipeline is PREROLLING

然后出现错误:

Pipeline doesn't want to preroll

我通过在管道末尾添加async handling=true解决了这个错误,但仍然没有显示任何内容。。。

我试着运行同样的流水线来编写C++代码。这是一个可以运行的简单main。当我运行此代码时,我没有得到任何错误,但没有显示任何内容。

#include <gst/gst.h>
#include <glib.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
GMainLoop *loop;
GstElement *pipeline, *source, *sink;
g_print("Starting...");
/* Initialisation */
gst_init(&argc, &argv);
g_print("Loop is created...");
loop = g_main_loop_new(NULL, FALSE);
/* Create gstreamer elements */
pipeline = gst_pipeline_new("gst-app-sink");
source = gst_element_factory_make("videotestsrc", "src");
sink = gst_element_factory_make("autovideosink", "sink");
if (!pipeline || !source || !sink) {
    g_printerr("One element could not be created. Exiting.n");
    return -1;
}
/* Set up the pipeline */
/* we add all elements into the pipeline */
/* source | sink */
gst_bin_add_many(GST_BIN(pipeline), source, sink, NULL);
/* we link the elements together */
/* src -> sink */
gst_element_link(source, sink);
/* Set the pipeline to "playing" state*/
gst_element_set_state(pipeline, GST_STATE_PLAYING);
/* Iterate */
g_print("Running...n");
g_main_loop_run(loop);
/* Out of the main loop, clean up nicely */
g_print("Returned, stopping playbackn");
gst_element_set_state(pipeline, GST_STATE_NULL);
g_print("Deleting pipelinen");
gst_object_unref(GST_OBJECT(pipeline));
g_main_loop_unref(loop);
return 0;

}

我真的不知道它是从哪里来的。有什么想法吗?

默认情况下,虚拟机不启用2D和3D视频加速,这是显示此类流所必需的。只需右键单击您的虚拟机->设置->显示并选中"启用3D加速"answers"启用2D视频加速"。