Important: Please read the Qt Code of Conduct -

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

  • 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

  • Lifetime Qt Champion


    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.

  • 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?

  • Lifetime Qt Champion

    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.

Log in to reply