0
我目前在GStreamer工作在Windows 7下(x86_64)作爲虛擬機(VirtualBox的),我想運行一個基本的管道:的Gstreamer基本管道運行,但不顯示在Windows 7 VirtualBox的
gst-launch-1.0 -v videotestsrc pattern=snow ! autovideosync
當我運行該管道獲得:
Setting pipeline to PAUSED...
Pipeline is PREROLLING
然後出現錯誤:
Pipeline doesn't want to preroll
我解決了這個通過在管道末端添加異步處理= true,但沒有任何顯示仍然存在錯誤...
我試圖運行相同的管道編寫C++代碼。這是一個簡單的主要你可以運行。當我運行這段代碼時,我沒有遇到任何錯誤,但沒有顯示任何內容。
#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 playback\n");
gst_element_set_state(pipeline, GST_STATE_NULL);
g_print("Deleting pipeline\n");
gst_object_unref(GST_OBJECT(pipeline));
g_main_loop_unref(loop);
return 0;
}
我真的不知道它會來的。有任何想法嗎?