Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMediaPlayer connected to QAbstractVideoSurface returns QVideoFrame::Format_NV12, but the data seems to be 8-bit per pixel instead of 12-bit per pixel
Forum Updated to NodeBB v4.3 + New Features

QMediaPlayer connected to QAbstractVideoSurface returns QVideoFrame::Format_NV12, but the data seems to be 8-bit per pixel instead of 12-bit per pixel

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 682 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GeorgePTVS
    wrote on last edited by
    #1

    I was having trouble using QMediaPlayer with video output connected to a QAbstractVideoSurface with format QVideoFrame::Format_BGRA32, QVideoFrame::Format_BGR32 or other combos like that (present not called reliably or called slowly if at all.)

    But with QVideoFrame::Format_NV12, QAbstractVideoSurface::present gets called reliably and decoding seems to happen at the right rate. But the data is only 8-bit (e.g. with a video frame width = 1920, height = 1080 the frame returned in QAbstractVideoSurface::present only seems to have 1920 x 1080 bytes (8-bits per pixel) whereas I expect it should have 12-bits per pixel because it's NV12.

    Using the 8-bit data does work to give the luminance (Y) correctly. But where is my color data (U, V)?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      GeorgePTVS
      wrote on last edited by
      #2

      Ah, I see that QVideoFrame::planeCount() returns 2 when the frame is mapped. That is where the data is.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved