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. Qt Video Widget / Video Player black borders depending on the scale
Forum Update on Monday, May 27th 2025

Qt Video Widget / Video Player black borders depending on the scale

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.6k 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.
  • K Offline
    K Offline
    KonradMD
    wrote on last edited by KonradMD
    #1

    Hi,

    I am developing a nice Training software and I already implemented a Videoplayer but its not perfect, because the Video has some ugly black borders depending on the width and height of the Main Window. Does anyone has expierience in how to get rid of it or do I need to calculate the Videowidget size again and again in my resize event?

    ![0_1498816294927_Videowidget schwarzer rand.png](Uploading 100%) !

    Picture of Video with black borders

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

      Hi,

      The pillar boxing effect is normal. That's the result of your video keeping its aspect ratio. If you don't want them you are going to either distort your video or cut the upper and lower part.

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

      K 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

        The pillar boxing effect is normal. That's the result of your video keeping its aspect ratio. If you don't want them you are going to either distort your video or cut the upper and lower part.

        K Offline
        K Offline
        KonradMD
        wrote on last edited by KonradMD
        #3

        Thanks @SGaist

        So it is not possible to give the widget the same ratio, best would be that the user can change between 16:9 or 4:3. So that qt is scaling in the resize event, that the widget is increasing its size by this aspect ratio? Is there a direct qt function or do I need to programm that on my own?

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

          You'll have to manage that yourself.

          IIRC you can find several solutions on this forum for that. Looks for Qt widget aspect ratio or maybe take the Flow Layout example as inspiration to manage that particular widget.

          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
          1

          • Login

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