This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Artifacts on H.264 videos playing on Qt5

Hi,

We have a Qt5 application with a video player similar to the one provided as an example in Qt5 (http://doc.qt.io/qt-5/qtmultimedia-multimediawidgets-player-example.html

gst_caps_from_string("video/x-raw, width=640, height=360, pixel-aspect-ratio=1/1, framerate=2787/100, format=BGRx")

but the video still shows the artifact at the top.

If I use "gst-launch-1.0 playbin" and use "waylandsink" as the sink, the video displays correctly. If I force Qt to use "waylandsink" as the sink (by setting QT_GSTREAMER_WIDGET_VIDEOSINK and QT_GSTREAMER_WINDOW_VIDEOSINK) the video displays correctly as well.

In a related note; is it possible to remove the green bands on the border of the video or is this too the result of some form of padding done by the codecs?

Thanks,

  • Hi Rodrigo,

    Your question has been forwarded to experts.

    BR,
    Dobrin
  • The padding (green artifacts on the sides) from codecs are generally stored as crop metadata. Waylandsink extracts this info to crop out the extra padding. To remove the green padding, the sink you are using should be capable of cropping the padding by retrieving the crop metadata.

  • Hi Pooja,

    Thanks for response.

    It seems that my post got cut off in some parts and is not correctly reflecting the main issue I wanted to report.

    What I was trying to report was that when I played a video on Qt5 the size of the video frames doesn't seem to be correct. If I add debug messages in QtMultimedia (function QGstVideoRendererSink::set_caps()) to print the caps used I get 768 x 464 frames, but if I use "mediatool" to get the same information I get 640 x 360. The piece of code I posted, forced the caps to be of the size reported by "mediatool".

    The visual artifact I get is that the pixels on the border of the video seems to be repeating until the size of the container of the video. It's similar to what you see when applying OpenGLTextures and the wrap option GL_CLAMP_TO_EDGE (https://open.gl/textures).

    After forcing the caps, the area of the video si reduced but I still see the visual artifact (the "GL_CLAMP_TO_EDGE-effect"). Is this still part of the padding used by the video codec? Or is this a different issue altogether?

    Regards,
    Rodrigo