homebridge-camera-rpi icon indicating copy to clipboard operation
homebridge-camera-rpi copied to clipboard

Inconsistent white balance

Open jankais3r opened this issue 5 years ago • 10 comments

In the Live streaming mode the camera picture is correctly white-balanced. However, the static snapshots have this awful yellow tint.

See here: https://imgur.com/YfVnA7Y

We start with a yellow tint, then I switch to the Live mode and the picture gets properly white-balanced, then I exit the Live mode and another yellow snapshot gets generated.

Would it be possible to use the same settings for both the Live feed and the snapshots?

jankais3r avatar Aug 07 '18 18:08 jankais3r

Seems like the first seconds of livestream have the same tint.

Maybe I could try to capture a few seconds before taking a snapshot... but that would probably break things like live notifications on motion detection, door bell etc. because of the delay.

moritzmhmk avatar Aug 08 '18 09:08 moritzmhmk

The first seconds of livestream (at least for me) are not an actual livestream. They have the same tint, some artifacts and it's just a still picture without any movement. Once the frames start moving, they start with the right color balance right away.

jankais3r avatar Aug 08 '18 09:08 jankais3r

Here you could add the option -ss 1.0 to seek the first second (or more maybe) and try if it helps with the tint. I can't test this currently.

moritzmhmk avatar Aug 08 '18 09:08 moritzmhmk

img_2702 This is a result of adding -ss 1.0. I tried adding it to the input part, to the output part and to both parts of the command. Same result for all of them. :(

jankais3r avatar Aug 08 '18 22:08 jankais3r

Does using something longer than 1.0 seconds change the effect?

moritzmhmk avatar Aug 13 '18 19:08 moritzmhmk

This is what -ss 3.0 looks like. img_2356

jankais3r avatar Aug 13 '18 19:08 jankais3r

does something like 15s look any better?

moritzmhmk avatar Aug 13 '18 20:08 moritzmhmk

  let ffmpegCommand = `\
-f video4linux2 -input_format mjpeg -ss 15.0 -video_size ${request.width}x${req$
-vframes 1 -f mjpeg -`

the only notable difference is that it now takes longer to generate this crappy snapshot

img_2790

jankais3r avatar Aug 13 '18 20:08 jankais3r

Would it be possible to generate the static snapshots using raspistill instead of ffmpeg? It seems that people are getting better quality photos with it.

jankais3r avatar Aug 13 '18 22:08 jankais3r

Would it be possible to generate the static snapshots using raspistill instead of ffmpeg? It seems that people are getting better quality photos with it.

To answer my own question, it is possible and it gives better results. See comparison below. I'll submit a pull request tonight after I do some more testing. camera

jankais3r avatar Jul 15 '19 05:07 jankais3r