Wrong colors on Raspberry Pi 4

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Wrong colors on Raspberry Pi 4

moritz.vieli
Hi all

I have a simple pipe on a Raspberry Pi 4:
gst-launch-1.0 -v videotestsrc ! videoconvert ! glimagesink

The image is supposed to look like this:
<http://gstreamer-devel.966125.n4.nabble.com/file/t378671/testsrc.png>

However, all colors are wrong and it looks like this:
<http://gstreamer-devel.966125.n4.nabble.com/file/t378671/testsrc_wrong.png>

As you can see, the colors should be white, yellow, blue, green, etc. but
are white, blue, yellow, green, etc. If I play a video, all colors are wrong
as well and a blue sky with clouds has lots of yellow and green in.

Omxplayer works well, I therefore think it's a Gstreamer-specific problem
and not related to the Raspberry or the HDMI connection.

Everything works well on a Raspberry Pi 3.

Does anyone have an idea, where the problem could be?

Thanks a lot for your feedback and best,
Moritz



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Wrong colors on Raspberry Pi 4

Nicolas Dufresne-5
Le vendredi 15 novembre 2019 à 08:54 -0600, moritz.vieli a écrit :

> Hi all
>
> I have a simple pipe on a Raspberry Pi 4:
> gst-launch-1.0 -v videotestsrc ! videoconvert ! glimagesink
>
> The image is supposed to look like this:
> <http://gstreamer-devel.966125.n4.nabble.com/file/t378671/testsrc.png>
>
> However, all colors are wrong and it looks like this:
> <http://gstreamer-devel.966125.n4.nabble.com/file/t378671/testsrc_wrong.png>
>
> As you can see, the colors should be white, yellow, blue, green, etc. but
> are white, blue, yellow, green, etc. If I play a video, all colors are wrong
> as well and a blue sky with clouds has lots of yellow and green in.
Indeed, red and blue component are inverted.
>
> Omxplayer works well, I therefore think it's a Gstreamer-specific problem
> and not related to the Raspberry or the HDMI connection.

I would be more looking toward a Mesa bug here (make sure you have the
latest and greatest). I have done video playback with GStreamer on RPi4
recently, and it worked fine for me (tried both glimagesink and
waylandsink). Maybe there is a specific color format that is broken,
add the -v to gst-launch-1.0, that will provide more details. This code
is common to PC, and it works on PC, so that's why I blame the GL
implementation (which is rather young on the latest Pi).

>
> Everything works well on a Raspberry Pi 3.
>
> Does anyone have an idea, where the problem could be?
>
> Thanks a lot for your feedback and best,
> Moritz
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Wrong colors on Raspberry Pi 4

moritz.vieli
Thanks a lot for your response! I upgraded and updated everything, including
the firmware. Unfortunately, the problem persists. One thing to mention: I
am testing on a freshly installed Raspbian Lite without X support.

Interestingly, with the fbdevsink, the colors are correct. They are only
mixed with the glimagesink. I also tried different color formats but without
success.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Wrong colors on Raspberry Pi 4

Peter Maersk-Moller-2
In reply to this post by moritz.vieli
As far as I remember the last time i looked GStreamer uses byte-order convention for defining color models. In byte-order RGBA refers to Red being byte-0, Blue being byte-1, Green being byte-2 and Alpha being byte-3. Raspberry Pi programming documentation uses Word-order for color models. For this reason byteorder RGBA is defined in Raspberry Pi programming documentation as ABGR8888. Byte-order BGRA is in Raspberry Pi documentation defined as ARGB8888.

This difference/confusion can be an explanation for the colour change if one of the modules get it wrong although it does not explain if the exact same version produces one result in Rasp3 and another in Rasp4 .... unless Rasp4 has a different definition for its colour model or one of the modules compiles different code for Rasp4 compared to Rasp3. I believe the graphical API changed somewhat for Rasp4 so code may be different.

Regards
Peter MM

On Fri, Nov 15, 2019 at 3:51 PM moritz.vieli <[hidden email]> wrote:
Hi all

I have a simple pipe on a Raspberry Pi 4:
gst-launch-1.0 -v videotestsrc ! videoconvert ! glimagesink

The image is supposed to look like this:
<http://gstreamer-devel.966125.n4.nabble.com/file/t378671/testsrc.png>

However, all colors are wrong and it looks like this:
<http://gstreamer-devel.966125.n4.nabble.com/file/t378671/testsrc_wrong.png>

As you can see, the colors should be white, yellow, blue, green, etc. but
are white, blue, yellow, green, etc. If I play a video, all colors are wrong
as well and a blue sky with clouds has lots of yellow and green in.

Omxplayer works well, I therefore think it's a Gstreamer-specific problem
and not related to the Raspberry or the HDMI connection.

Everything works well on a Raspberry Pi 3.

Does anyone have an idea, where the problem could be?

Thanks a lot for your feedback and best,
Moritz



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Wrong colors on Raspberry Pi 4

Nicolas Dufresne-5
In reply to this post by moritz.vieli


Le dim. 17 nov. 2019 05 h 40, moritz.vieli <[hidden email]> a écrit :
Thanks a lot for your response! I upgraded and updated everything, including
the firmware. Unfortunately, the problem persists. One thing to mention: I
am testing on a freshly installed Raspbian Lite without X support.

Interestingly, with the fbdevsink, the colors are correct. They are only
mixed with the glimagesink. I also tried different color formats but without
success.

So that means that GBM backend is being used. That I have never tested on the Pi. Though you could try kmssink. If you can reproduce the issue with kmssink, pleas add -v and share the caps reported. That will be needed to report the issue to the kernel devs.

If it's only an issue for GBM, some investigation will be needed. Maybe build and run kmscube test app, to see if it's the drivers (Mesa or kernel) or GStreamer.




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Wrong colors on Raspberry Pi 4

moritz.vieli
Thanks a lot for your support!

It's correct with *kmssink*. Also, the colors with *kmscube* look good! What
does this mean now exactly?

Here's the output -v for my pipe:

root@raspberrypi:~# gst-launch-1.0 -v videotestsrc ! videoconvert !
glimagesink
Setting pipeline to PAUSED ...
error: XDG_RUNTIME_DIR not set in the environment.
Pipeline is PREROLLING ...
Got context from element 'sink': gst.gl.GLDisplay=context,
gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayGBM\)\ gldisplaygbm0";
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps =
video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1,
multiview-mode=(string)mono, format=(string)RGBA,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps =
video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1,
multiview-mode=(string)mono, format=(string)RGBA,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0.GstGhostPad:sink.GstProxyPad:proxypad0:
caps = video/x-raw, width=(int)320, height=(int)240,
framerate=(fraction)30/1, multiview-mode=(string)mono, format=(string)RGBA,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLUploadElement:gluploadelement0.GstPad:src:
caps = video/x-raw(memory:GLMemory), width=(int)320, height=(int)240,
framerate=(fraction)30/1, multiview-mode=(string)mono,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
format=(string)RGBA, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLColorConvertElement:glcolorconvertelement0.GstPad:src:
caps = video/x-raw(memory:GLMemory), width=(int)320, height=(int)240,
framerate=(fraction)30/1, multiview-mode=(string)mono,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
format=(string)RGBA, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLColorBalance:glcolorbalance0.GstPad:src:
caps = video/x-raw(memory:GLMemory), width=(int)320, height=(int)240,
framerate=(fraction)30/1, multiview-mode=(string)mono,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
format=(string)RGBA, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink.GstPad:sink:
caps = video/x-raw(memory:GLMemory), width=(int)320, height=(int)240,
framerate=(fraction)30/1, multiview-mode=(string)mono,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
format=(string)RGBA, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLColorBalance:glcolorbalance0.GstPad:sink:
caps = video/x-raw(memory:GLMemory), width=(int)320, height=(int)240,
framerate=(fraction)30/1, multiview-mode=(string)mono,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
format=(string)RGBA, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLColorConvertElement:glcolorconvertelement0.GstPad:sink:
caps = video/x-raw(memory:GLMemory), width=(int)320, height=(int)240,
framerate=(fraction)30/1, multiview-mode=(string)mono,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive,
format=(string)RGBA, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLUploadElement:gluploadelement0.GstPad:sink:
caps = video/x-raw, width=(int)320, height=(int)240,
framerate=(fraction)30/1, multiview-mode=(string)mono, format=(string)RGBA,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0.GstGhostPad:sink:
caps = video/x-raw, width=(int)320, height=(int)240,
framerate=(fraction)30/1, multiview-mode=(string)mono, format=(string)RGBA,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps =
video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1,
multiview-mode=(string)mono, format=(string)RGBA,
pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

Do you see anything?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel