Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QMediaPlayer with reduced video resolution

QMediaPlayer with reduced video resolution

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 2 Posters 130 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.
  • S Offline
    S Offline
    sapvi
    wrote on last edited by
    #1

    Hi all, I was using QLabel with setting pixmal and some external package (OpenCV) for reading & downsampling the video frames before displaying them in the GUI.

    I was thinking to transition from QLabel to QMediaPlayer + QVideoWidget combination. Problem is, my videos are very high-res and the result is lagging even on a better PC. I do not need the display of the videos in full res, hence the original solution with resizing the frame + using QLabel. I do not need audio either. I need possibility to go to specific frame in my video (that requires closing & re-opening video stream in OpenCV, which is also not perfect).

    Is there any way to smartly do it while using QMediaPlayer? I cannot pre-process full videos as the overhead is too much here, I need to downscale every time only the specific frame to be shown next. However, I could not find any possibilities like this in the docs.

    I have both solutions, i.e. with QLabel and QMediaPlayer technically working, but I am not sure for which I should decide. So I thought to ask someone with more experience: is it better to go with QLabel for such a use case (downsampled frames, no audio, navigation in video available), or are there some significant advantages in using QMediaPlayer? Is there any workaround to downsample the frames while using QMediaPlayer? Maybe even option to user to dynamically select the quality he'd need (imaging something like quality selection in YouTube video)?

    Thanks in advance for advices.

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

      Hi,

      Version of Qt are you using ?

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

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Version of Qt are you using ?

        S Offline
        S Offline
        sapvi
        wrote on last edited by
        #3

        @SGaist said in QMediaPlayer with reduced video resolution:

        Version of Qt are you using ?

        Oh, apologies, it was some time after midnight and somehow I forgot to include that. I am on Qt6 via PySide6, but I guess this is a general question to Qt widgets, it is not really related to Python. The video has really high res (>4000x3000), while it is enough for me to visualize ~400x300 preview.

        1 Reply Last reply
        0
        • SGaistS SGaist moved this topic from General and Desktop on
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          So the backend uses ffmpeg however I don't think that you currently can delegate the resizing to it.

          You could do it in a sink though but I am unsure about the performance of it.

          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