2

我正在olimex a13船上工作,eglfs即没有窗口系统。由于这些Qt Multimedia东西,视频和相机不能用作反过来需要的Qt用途。所以我正在使用这里的库。GstreamerXQtGstreamer

我已经按照这些示例创建了一个按预期工作的媒体播放器。现在,我想做一个相机,并使用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());

//cameraplayer.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网络摄像头吗?提前致谢。

4

1 回答 1

1

我意识到缺少一些插件(multifilesink)。用参数启动我的Qt应用程序,然后报告缺少插件。--gst-debug-level=4gstreamer

于 2016-05-03T12:52:20.913 回答