QtGstreamer camerabin2 usage
QtGstreamer camerabin2 usage
我正在olimex a13
板上工作,只有eglfs
即没有窗口系统。由于这个Qt Multimedia
视频和相机的东西无法正常工作,因为Qt
使用Gstreamer
而而这反过来又需要X
。所以我正在使用这里的QtGstreamer
库。
我已经按照这些示例创建了一个按预期工作的媒体播放器。现在,我想做一个相机并使用来自不良插件的camerabin2
。
这是我的代码:
//init QGst
QGst::init(&argc, &argv);
//create video surface
QGst::Quick::VideoSurface* videoSurface = new QGst::Quick::VideoSurface(&engine);
CameraPlayer player;
player.setVideoSink(videoSurface->videoSink());
相机播放器.cpp
void open()
{
if (!m_pipeline) {
m_pipeline = QGst::ElementFactory::make("camerabin").dynamicCast<QGst::Pipeline>();
if (m_pipeline) {
m_pipeline->setProperty("video-sink", m_videoSink);
//watch the bus for messages
QGst::BusPtr bus = m_pipeline->bus();
bus->addSignalWatch();
QGlib::connect(bus, "message", this, &CameraPlayer::onBusMessage);
//QGlib::connect(bus, "image-done", this, &CameraPlayer::onImageDone);
} else {
qCritical() << "Failed to create the pipeline";
}
}
}
//-----------------------------------
void CameraPlayer::setVideoSink(const QGst::ElementPtr & sink)
{
m_videoSink = sink;
}
//-----------------------------------
void CameraPlayer::start()
{
m_pipeline->setState(QGst::StateReady);
m_pipeline->setState(QGst::StatePlaying);
}
然后我打电话给cameraPlayer.start()
它不起作用,即没有视频。我在这里错过了什么吗?有没有人使用QtGstreamer
来流式传输网络摄像头?提前谢谢。
我意识到缺少一些插件(multifileink(。用--gst-debug-level=4
参数启动了我的Qt
应用程序,然后gstreamer
报告缺少插件。
相关文章:
- C++ Usage of AsyncCallback
- std::visit and std::variant usage
- QLoggingCategory::setFilterRules usage
- C++ std::initializer_list usage
- Direct3D typedef usage
- Windows SetupAPI DIF_REMOVE usage
- C++ unique_ptr() Usage
- c++14 static constexpr auto with odr usage
- The usage of snprintf
- pcre2 UTF32 usage
- Qt QProccess with ping utility usage
- Usage of InternetGetConnectedStateEx
- Usage of QOpenGLVertexArrayObject
- QtGstreamer camerabin2 usage
- pcl::PCLPointCloud2 usage
- Zlib usage - deflateEnd() error
- OpenCV C++ usage of cv::Moments
- libGL heap usage
- 为什么"find usage"不适用于不同子项目中的信号
- Qt connect() usage