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 video frames from QMediaPlayer to apply online/ofline image filters to frames
Qt 6.11 is out! See what's new in the release blog

Access video frames from QMediaPlayer to apply online/ofline image filters to frames

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

    Hi,
    I would like to implement a feature which applies a custom filter to all frame images of a video and then stores the altered video to file. This is offline filtering, meaning that no camera is involved and videos are loaded from stored media files and should be stored to a file with the custom filter(s) applied to video frames.

    I implemented code which which loads a video to QMediaPlayer (with video output being either QGraphicsVideoItem or alternatively QVideoWidget , than through some QPushButton::pressed (and GUI check box selection of a filter to be applied) calls a slot FileManipulator::createFilteredVideo(). I got this far.

    Now: This slot should then call QMediaPlayer::play() and connect a custom image filter slot MyFilter::applyFilter() to a signal emited by a QMediaPlayer signal or something like QVideoProbe::videoFrameProbed(QVideoFrame) (I know QVideoProbe does not exist any more in Qt6 and besides it wouldn't have done the job as it only monitored video frames but as I dont know any other helpful classes, I am mentioning it as an example) so MyFilter::applyFilter() can than filter the image and send it back for displaying live in GUI and at the same time (in a different thread instance) save a copy of the video to a file (with audio signal being unchanged, same as before and video being altered by the filter).

    I realize this is a very general question which an be divided in at least 2 problems

    • apply an online filter to video and display the filtered video live with the GUI

    • apply an offline image filter to each frame of a video file and store altered video to file.

    so I am just fishing for useful Qt classes and signals/slots which I can study and learn about to get going on this topic.

    I thank you up front for your inspiration.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You should go with Qt6, the new QtMultimedia module is better suited for what you want to do.

      Check the QVideoSink class and friends.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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