Important: Please read the Qt Code of Conduct -

VideoOutput with custom source

  • Hellow!
    Try to create custom video provider to stream v4l2 video to qml. I hve Implemented VideoProvider class derived from QObject like in doc ( but VideoOutput is always black.

    With MediaPlayer it works well.

    Add QAbstractFilter to check frames on videoOutput - it receives proper data but creen is black.

    Frames for present() created with

    int bytesPerLine = m_capture->width() * 2; // 2 bytes per pixel
    int bufferSize = m_capture->height() * bytesPerLine;
    QSize frameSize(m_capture->width(), m_capture->height());
    QVideoFrame::PixelFormat format = QVideoFrame::Format_UYVY;
    QVideoFrame *frame = new QVideoFrame(bufferSize, frameSize, bytesPerLine, format);

    Surface started on setVideoSurface()

    m_format = QVideoSurfaceFormat(frameSize, format);

    What am I missed? How can I debug it?

    qt 5.7 on imx6

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    I am not sure that UYVY support was 100% supported for displaying like that by that old version of Qt.

Log in to reply