kepeter
Posts: 2
Joined: Wed Mar 11, 2020 6:32 am

Green tinted image with Waveshare OV2710 2MP USB Camera and Ubuntu

Wed Mar 11, 2020 6:50 am

Hi,

I have a Waveshare OV2710 2MP USB Camera attached to Raspberry Pi (it is 2 / Model B, but tested this also on 3 and 4 too with no difference)...
All I wanted is to get a real-time video stream on screen, so I run mplayer in TV mode (tried cheese and vlc, but they are way too resource hungry to run smoothly)...
The problem is that the stream has no colors - all are shades of green... (checking the same camera on my Fedora desktop shows that the problem not with the camera)
After a lot of search I came across guvcview and qv4l2 and was able to configure the image to something bearable (has harsh red and green colors but in between there are true - or near true - colors too), however wasn't able to keep those configuration over restart or camera remove and wasn't able to configure mplayer the same way...

I have Ubuntu MATE (latest) on the raspberry, and it's screen colors are look OK...

So some questions that I have:

1. Obviously the why? Why green shades?
2. There are other software I should try instead of mplayer?
3. There is a way to pass configuration from guvcview or qv4l2 to mplayer to get something better?
4. A replacement camera I should buy if nothing works with this one? I need a 'naked' camera, that has no plastic box, but the PCB and the lens so I can stick it to the flat inner wall of a box...

Thank you!

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Green tinted image with Waveshare OV2710 2MP USB Camera and Ubuntu

Wed Mar 11, 2020 11:00 am

If you run this with plain Raspbian 2020-03-13 do you get the same effect? That would suggest a hardware fault.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

kepeter
Posts: 2
Joined: Wed Mar 11, 2020 6:32 am

Re: Green tinted image with Waveshare OV2710 2MP USB Camera and Ubuntu

Wed Mar 11, 2020 6:59 pm

A bit more research and found a solution...
It boiled down to the fact that mplayer did not read the settings from the command line as expected (by me at least)...
So after configuring the image using guvcview to the most perfect color I run mplayer like this:
mplayer tv:// -tv driver=v4l2:device=/dev/video0:brighness=60:contrast=40:saturation=40:hue=0
Even those numbers gave a near-to perfect image in guvcview mplayer still painted anything green...
That's the point I found this:
https://www.linuxquestions.org/question ... 175493692/
The article states that the way to set those values for v4l2 driver is passing the set commands as input file to mplayer, so I created a file (named it v4l2.settings) with this content:

Code: Select all

run "v4l2-ctl --set-ctrl brightness=60"
run "v4l2-ctl --set-ctrl contrast=40"
run "v4l2-ctl --set-ctrl saturation=40"
run "v4l2-ctl --set-ctrl hue=0"
After that changed the command like this:
mplayer tv:// -tv driver=v4l2:device=/dev/video0 -slave -input file=v4l2.settings

And that's all folks...

Return to “Ubuntu”