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. Access multimedia backend data
Qt 6.11 is out! See what's new in the release blog

Access multimedia backend data

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 388 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.
  • T Offline
    T Offline
    TheEnigmist
    wrote on last edited by
    #1

    Since I moved to 6.4.0 due to ffmpeg support I'm wondering if there is a way to access its functionality like adding a filter (e. chromakey) to video frames.

    I'm using an external library written in Qt 6.3 that uses ffmpeg to open all supported format (with transparency) but if I can move to 6.4 and using Qt native classes it would be better.

    Right now what I'm trying to replicate is opening a .webm video with trasparency on it and correctly show in a QLabel.

    QMediaPlayer* player = new QMediaPlayer;
    QVideoSink* vsink = new QVideoSink;
    
    QLabel* videoLabel= new QLabel(baseWidget);
    player->setVideoOutput(vsink);
    
    connect(vsink, &QVideoSink::videoFrameChanged, this, [=](const QVideoFrame& frame) {
    	qDebug() << frame.pixelFormat();
    	videoLabel->setPixmap(QPixmap::fromImage(image));
    });
    player->setSource(QUrl(videoSrc));
    videoLabel->show();
    player->play();
    

    I can see the frames correctly, but instead of transparency i get a dark gray pixel. Seems like QMediaPlayer didn't use libvpx-vp9 to open it. Indeed, that external library shows libvpx-vp9 as used codec.

    So, basically, the question are:

    • how can I change QVideoFrame format to correctly show transparency?
    • after that, how can I inject ffmpeg's filters to a QVideoFrame?
    1 Reply Last reply
    0
    • T Offline
      T Offline
      TheEnigmist
      wrote on last edited by
      #2

      It seems like there is a bug with video codec used to open webm files. Since VP9 (libvpx-vp9) can read alpha channel from a video is a bug if QVideoFrame has QColor(16,16,16,255) instead of QColor(0,0,0,0), totally transparent. I thought that 6.4 with ffmpeg could read correctly those videos

      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