QtGstreamer camerabin2 usage

QtGstreamer camerabin2 usage

本文关键字:usage camerabin2 QtGstreamer      更新时间:2023-10-16

我正在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报告缺少插件。