EliasKotlyar / Xiaomi-Dafang-Hacks

4.19k stars 1k forks source link

Dafang - Pink tinted picture after installing the hack #599

Closed Tramsrepus closed 5 years ago

Tramsrepus commented 6 years ago

Hi,

I installed this resp. and after that my camera got a pink tinted picture. Most notable is at night when the whole pic is very pink. The upper left pic is from a cam on the opposite side of the Dafang on the upper right.

The lower pics are from daylight

image

saipsa commented 6 years ago

It happens when you switch on IR LED, but night mode has not kicked in.

Switching on IR LED should start night mode automatically, but it is not the case at present.

Tramsrepus commented 6 years ago

@saipsa Hi, Turning ON the IR-filter solved it. I turned it off last night as if it ON night time the camera did't see anything in the dark, with or without IR-LED or Auto-night (ON by default). But i will try again later when it gets dark again.

Thanks

Tramsrepus commented 6 years ago

Another problem I have is that I only gets about 3-5 FPS out of it at 720P. The other cameras (XiaoFang fanghacks_v0.2.0) are at 1080P at 20-25FPS. I plan to add another 25 Dafangs at another setup at our factory later when i have learned to master it. Im using Blue Iris but they dont have Dafang-settings so im running it on Xiaofang's settings. It just shows the pics but no ohter functions works. Does Dafang emulates any other "well-known" camera? Asking as it may be in the list of cameras in the software.

Tramsrepus commented 6 years ago

I still have problems to get night vision starting automatically.

Any suggestions?

Tramsrepus commented 6 years ago

Yea, it does not work as it should. It switches OFF the night vision as it should on the morning, but it never comes on again at night time. IR-cut is on and IT-led off and night vision on and RTSP night vision is off, even as i set them on the opposite last night... Even LED-Blue has been turned on even though i set it on OFF.... Any suggestions?

jmtatsch commented 6 years ago

Have a look at #332. A whole thread about debugging / tuning the threshold.

badabing2005 commented 6 years ago

I have the same issue. Things are very pinkish. If I enable IR-Cut, colors are normal Why are they pink if there is no IR turned on?

I made sure there was no IR turned on, by checking with a phone camera. I have Wyze Pan, so I know auto-night does not work as it does not have the LDR, however I don't expect the colors to look pinkish without any IR turned on.

Thanks

saipsa commented 6 years ago

Why are they pink if there is no IR turned on?

Sunlight has IR component too, you know, that is how you feel warm when in sun.

badabing2005 commented 6 years ago

Thanks @saipsa,

I never thought sun's IR can reach my basement, with all the windows having opaque blinds.

How does the IR cut work? I hear a click when I toggle, is it mechanical filter in front of the lens? Is there a way to adjust the hue to compensate for it?

Thanks BB

saipsa commented 6 years ago

@badabing2005

LOL. other light sources also have IR component. why you don't want to turn on ir cut?

badabing2005 commented 6 years ago

@saipsa The camera is in my media / entertainment room which is in the basement with no sun light. However we have lights. When the lights are off, I want the camera to run in night mode to capture details which requires IR on and IR cut off, and night vision (grayscale) on. When the lights are on, I want the camera to run in daylight mode, with IR off (can remain on), IR cut on and night vision (grayscale) off so that I don't have pink captures.

Auto night off would have taken care of all that, but unfortunately there is no LDR on this camera (Wyze Pan) Issue #332.

I can automate night mode based on time of day / sunset ... but that is useless for me as even during broad daylight, if the lights are off, the room is dark, and IR cut needs to be off.

For now, I'm leaving IR cut off, and IR Led on, all the time, and living with pink images, which is why I'm trying to understand where this pinkness is coming from, and if I can play with the hue.

Things I'm trying to understand

BB

hubmon commented 6 years ago

https://www.networkwebcams.co.uk/blog/2012/09/18/day-night-switching-ir-cut-filters/

badabing2005 commented 6 years ago

@hubmon Thank you for a reference to an excellent explanation. So these cheap cameras are true day/night cameras.

Hopefully software (camera image) based LDR solution will be available soon for these cameras so that auto-night detection works and pink images will no longer be an issue.

Thanks BB

jmtatsch commented 6 years ago

for image based ldr you can try #699

badabing2005 commented 6 years ago

Thanks @jmtatsch,

Worked beautifully :) It would still be nice to have a way of adjusting the colors / hue / brightness ... With proper IR cutting, I find my images having a little bit of yellowish hue (not much), it would be nice if those could be adjusted, but I digress, the pink issue is definitely resolved. Awesome job.

Thanks BB

badabing2005 commented 6 years ago

Just curious, I'm seeing Will execute detectionOn followed by detectionOff constantly in the logs. Is this expected?

RTCPInstance::RTCPInstance error: totSessionBW parameter should not be zero!
2018-09-19 19:28:42.194 (  11.127s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOn.sh
2018-09-19 19:28:42.393 (  11.327s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOn.sh returned:0
2018-09-19 19:28:42.394 (  11.327s) [ivsMoveDetection]         ImpEncoder.cpp:599      0| Detect !!
2018-09-19 19:28:44.595 (  13.529s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOff.sh
2018-09-19 19:28:44.783 (  13.717s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOff.sh returned:0
2018-09-19 19:28:47.107 (  16.041s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOn.sh
2018-09-19 19:28:47.350 (  16.284s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOn.sh returned:0
2018-09-19 19:28:47.351 (  16.284s) [ivsMoveDetection]         ImpEncoder.cpp:599      0| Detect !!
2018-09-19 19:28:49.546 (  18.479s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOff.sh
2018-09-19 19:28:49.699 (  18.633s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOff.sh returned:0
2018-09-19 19:28:53.874 (  22.807s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOn.sh
2018-09-19 19:28:54.073 (  23.007s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOn.sh returned:0
2018-09-19 19:28:54.074 (  23.007s) [ivsMoveDetection]         ImpEncoder.cpp:599      0| Detect !!
2018-09-19 19:28:56.026 (  24.960s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOff.sh
2018-09-19 19:28:56.194 (  25.127s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOff.sh returned:0
2018-09-19 19:29:08.634 (  37.567s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOn.sh
2018-09-19 19:29:08.839 (  37.773s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOn.sh returned:0
2018-09-19 19:29:08.839 (  37.773s) [ivsMoveDetection]         ImpEncoder.cpp:599      0| Detect !!
2018-09-19 19:29:10.905 (  39.838s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOff.sh
2018-09-19 19:29:10.907 (  39.841s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOff.sh returned:-1
2018-09-19 19:29:17.610 (  46.543s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOn.sh
2018-09-19 19:29:17.614 (  46.548s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOn.sh returned:-1
2018-09-19 19:29:17.614 (  46.548s) [ivsMoveDetection]         ImpEncoder.cpp:599      0| Detect !!
2018-09-19 19:29:20.041 (  48.974s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOff.sh
2018-09-19 19:29:20.043 (  48.977s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOff.sh returned:-1
2018-09-19 19:29:35.371 (  64.304s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOn.sh
2018-09-19 19:29:35.373 (  64.307s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOn.sh returned:-1
2018-09-19 19:29:35.373 (  64.307s) [ivsMoveDetection]         ImpEncoder.cpp:599      0| Detect !!
2018-09-19 19:29:37.681 (  66.636s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOff.sh
2018-09-19 19:29:37.710 (  66.643s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOff.sh returned:-1
2018-09-19 19:29:40.059 (  69.035s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOn.sh
2018-09-19 19:29:40.138 (  69.071s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOn.sh returned:-1
2018-09-19 19:29:40.138 (  69.072s) [ivsMoveDetection]         ImpEncoder.cpp:599      0| Detect !!
2018-09-19 19:29:42.734 (  71.722s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOff.sh
2018-09-19 19:29:42.832 (  71.765s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOff.sh returned:-1
2018-09-19 19:29:45.289 (  74.275s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOn.sh
2018-09-19 19:29:45.493 (  74.429s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOn.sh returned:-1
2018-09-19 19:29:45.520 (  74.454s) [ivsMoveDetection]         ImpEncoder.cpp:599      0| Detect !!
2018-09-19 19:29:47.702 (  76.731s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOff.sh
2018-09-19 19:29:48.131 (  77.068s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOff.sh returned:-1
2018-09-19 19:29:49.246 (  78.255s) [main thread     ]       DeviceSource.cpp:110      0| V4L2DeviceSource::doStopGettingFrames
2018-09-19 19:29:50.140 (  79.275s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOn.sh
2018-09-19 19:29:50.603 (  79.536s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOn.sh returned:-1
2018-09-19 19:29:50.610 (  79.544s) [ivsMoveDetection]         ImpEncoder.cpp:599      0| Detect !!
2018-09-19 19:29:52.442 (  81.388s) [main thread     ]ServerMediaSubsession.c:25       0| Creating Source...
2018-09-19 19:29:52.542 (  81.476s) [ivsMoveDetection]         ImpEncoder.cpp:405      0| Will execute command /system/sdcard/scripts/detectionOff.sh
2018-09-19 19:29:52.734 (  81.667s) [ivsMoveDetection]         ImpEncoder.cpp:407      0| Execute /system/sdcard/scripts/detectionOff.sh returned:-1
2018-09-19 19:29:52.742 (  81.675s) [main thread     ]ServerMediaSubsession.c:29       0| Creating H264 Source...
2018-09-19 19:29:52.960 (  81.898s) [main thread     ]ServerMediaSubsession.c:51       0| Creating Sink for format : video/H264

Thanks

jmtatsch commented 6 years ago

Yes, that is just motion detection debugging output

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.