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. Codec returns RGB32 even though I list NV12 and other YUV formats first
QtWS25 Last Chance

Codec returns RGB32 even though I list NV12 and other YUV formats first

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmediaplayervideosurfacek-litecodecyuv
1 Posts 1 Posters 977 Views
  • 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

    Hi,

    I am on Windows 7 using K-Lite codec pack and a QAbstractVideoSurface (that I subclass) attached to a QMediaPlayer (also subclassed) through player::setVideoOutput.

    I return RGB32 formats as well as YUV formats (eg NV12, YUYV, YV12) in surface::supportedPixelFormats as shown below. It does not matter the order I return the formats; the codec always gives me RGB32 in surface::present(). This is a problem on less-capable machines...for example on one machine it takes almost a full second to do the decode! There might be something else wrong, but when I use a YUV format, the decode (and thus my playback) happens at the same rate as Windows Media Player.

    If I remove the RGB32 formats from the list then I do get YUV formats in ::present and higher performance, but then the duration and seek are broken for some videos! (QMediaPlayer::durationChanged never gets called for videos with metaDataAvailable = 0, even though they do work when I return/support RGB32 formats.)

    Any ideas? I have a support case filed as well.

    MyQVideoSurface::supportedPixelFormats(
    QAbstractVideoBuffer::HandleType handleType) const
    {
    if (handleType == QAbstractVideoBuffer::NoHandle) {
    return QListQVideoFrame::PixelFormat()
    << QVideoFrame::Format_YV12
    << QVideoFrame::Format_NV12
    << QVideoFrame::Format_UYVY
    << QVideoFrame::Format_YUYV
    << QVideoFrame::Format_ARGB32
    << QVideoFrame::Format_BGRA32
    << QVideoFrame::Format_RGB32
    << QVideoFrame::Format_BGR32
    ;

    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