Gstreamer基本管道正在运行,但未显示在Windows7虚拟盒上
Gstreamer basic pipeline running but not displaying on windows 7 virtualbox
我目前在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视频加速"。
相关文章:
- 比较并显示使用最小值(a,b)和最大值(a、b)升序排列的4个数字
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 字符串-C++后显示的随机字符
- 继承期间显示未知行为的子类
- 仅使用绝对值对数组进行排序,并在C++中显示实际值
- 程序崩溃并显示"std::out_of_range"错误
- 如何在C++中用std::cout正确显示带十六进制的字符串文本
- 为什么在C的循环中使用printf的Rust代码不显示输出,而在C++的循环中显示std::cout
- 从数据库实时显示QT c++中的数据
- 当使用比格式支持的精度更高的精度来显示数字时,会写出什么数据
- 显示错误输出的简单数组排序程序
- Qt自定义QPush按钮未显示在布局上
- C++射线示踪剂ppm表示没有足够的数据来显示图像
- 显示基于用户输入的整数的字符
- 使用QTreeView,如何通过调用函数只突出显示特定的行/列
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- 示例外壳应用程序显示的 V8 "segmentation fault (core dumped)"错误
- 如何使 windows 命令提示符在C++可执行文件上显示返回值?
- Gstreamer基本管道正在运行,但未显示在Windows7虚拟盒上
- 如何使用C++在Windows7中将显示设置设置为EXTEND模式