1 (edited by vlaine 2016-07-28 01:44:59)

Topic: <Fixed>Camera red and blue inverted only in FreeLSS

If you have this issue, here's the fix:

1. Kill the FreeLss process if it's running
2. In MmalStillCamera.cpp and MmalVideoCamera.cpp, replace MMAL_ENCODING_BGR24 with MMAL_ENCODING_RGB24
3. Make
4. Start FreeLss as usual
http://soliforum.com/i/?En9WIsV.jpg
--
Update.
My previous title was "Camera missing red only in FreeLSS"
What I discovered today is that the red and blue colors are inverted.
In the new picture below the red wire is displayed in blue, but  the blue wire is displayed in red. 
The pliers are supposed to be red.

I reinstalled Raspbian and freelss
When using python or raspistill, everything is ok.
The issue is only in Freelss. 

http://soliforum.com/i/?TpoeO8x.jpg
--

I have an issue with the camera when using FreeLSS.
I am missing the red color. 
The camera is working properly when using raspistill so it's not an issue with the hardware.
How can I correct it ?
Thanks

FreeLSS:
http://soliforum.com/i/?KhxWZoP.jpg

Raspistill:
http://soliforum.com/i/?CuR6DPm.jpg

Thanks

2 (edited by vlaine 2016-07-27 16:56:31)

Re: <Fixed>Camera red and blue inverted only in FreeLSS

I found this post on the Raspberry Pi forum and it might explain the issue
https://www.raspberrypi.org/forums/view … p;p=997301

This is a quick call for any application or library developers who are using MMAL_ENCODING_RGB24 / MMAL_ENCODING_BGR24, or OMX_COLOR_Format24bitRGB888 / OMX_COLOR_Format24bitBGR888 direct from the camera component under IL or MMAL.
...

In testing some other features I've found that the camera component has swapped RGB for BGR in the enum handling.
...
hairu526 wrote:
We use MMAL_ENCODING_BGR24 in FreeLSS (https://github.com/hairu/freelss/) in order to get RGB. I would have to imagine that many other projects do also, and simply aren't seeing your post. Is there a way to detect the if the MMAL version has the fix so that we can code in backwards compatibility to the older firmware?
...
Hi hairu526, thanks for the response.
If lots of people had shouted then I was going to add a very simple parameter, but no one did until now so it's a little more involved. Googling hadn't produced any results, but I guess it may skip github code.

All mmal components support MMAL_PARAMETER_SUPPORTED_ENCODINGS on each port to retrieve the 4cc values for the encodings it supports (Missing out opaque). The order of RGB24 and BGR24 has been swapped in the new firmware revisions, and it actually works on the stills port (it failed before). I'll push up my raspistillyuv update to github and provide a link to it. Scan the list and find which occurs first to determine version.

If others shout saying they are using it then I may reevaluate and add something easier, or add a helper function to the mmal utils directory, but for now that is the route I'd gone. (Actually I may do the helper function anyway. Watch this space).