Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-849

QVideoFrame bits error

    XMLWordPrintable

Details

    • Linux/X11, Windows
    • 28fa0a6baba7a79ce85f8d62c2c296aa9f98de4c (pyside/pyside-setup/5.13.2)

    Description

      I wrote a simple VideoSureface example similar to https://github.com/qt/qtmultimedia/blob/5.11/examples/multimediawidgets/customvideosurface/customvideowidget/videowidgetsurface.cpp using Pyside2.

      And I have this traceback in Python:

      TypeError: 'PySide2.QtGui.QImage' called with wrong argument types:
      PySide2.QtGui.QImage(int, int, int, int, PySide2.QtGui.QImage.Format)
      Supported signatures:
      PySide2.QtGui.QImage()
      PySide2.QtGui.QImage(PySide2.QtCore.QString, int, int, PySide2.QtGui.QImage.Format)
      PySide2.QtGui.QImage(PySide2.QtCore.QString, int, int, int, PySide2.QtGui.QImage.Format)
      PySide2.QtGui.QImage(PySide2.QtGui.QImage)
      PySide2.QtGui.QImage(PySide2.QtCore.QSize, PySide2.QtGui.QImage.Format)
      PySide2.QtGui.QImage(unicode, bytes = nullptr)
      PySide2.QtGui.QImage(char[])
      PySide2.QtGui.QImage(int, int, PySide2.QtGui.QImage.Format)
      PySide2.QtGui.QImage(PySide2.QtCore.uchar, int, int, PySide2.QtGui.QImage.Format, QImageCleanupFunction = nullptr, void = nullptr)
      PySide2.QtGui.QImage(PySide2.QtCore.uchar, int, int, int, PySide2.QtGui.QImage.Format, QImageCleanupFunction = nullptr, void = nullptr)

      But in docs PySide2.QtMultimedia.QVideoFrame.bits() return type: PySide2.QtCore.uchar

      And when created QImage class PySide2.QtGui.QImage(data, width, height, bytesPerLine, format[,cleanupFunction=nullptr[, cleanupInfo=nullptr]])
      and get data - PySide2.QtCore.uchar

      When I try use a Qimage created from current video frame, get segfault in my program.

      Maybe I'm not working correctly with QVideoFrame.bits() from a current video frame?! How I can create QImage from QVideoFrame?

      Attachments

        1. video.py
          9 kB
        2. video_probe.py
          2 kB
        3. video_probe.qml
          0.7 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              valentyn.doroshchuk Valentyn Doroshchuk
              ivan_pilin Ivan Pilin
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes