AndroidUSBCamera icon indicating copy to clipboard operation
AndroidUSBCamera copied to clipboard

sometimes the screen is gray in huawei mate10 while is preview

Open zhancaihai opened this issue 5 years ago • 27 comments

sometimes the screen is gray in huawei mate10 while is preview

zhancaihai avatar Sep 11 '19 07:09 zhancaihai

sometimes?when?

jiangdongguo avatar Sep 18 '19 13:09 jiangdongguo

I think it is because of camera. Camera has auto focus feature, it will give a little gray, then light. If camera preview is full gray, can not display video then, that is another bug => pls capture screenshot

quocnhat7 avatar Sep 20 '19 07:09 quocnhat7

就是在mate10上预览的时候,预览一段时间后,屏幕变成灰色的,偶尔会出现一点画面,退出去,重新进来就好了

zhancaihai avatar Sep 23 '19 01:09 zhancaihai

不知道是不是fps变低了导致的

zhancaihai avatar Sep 23 '19 01:09 zhancaihai

Sorry I dont really understand the reason, it is better to give us a video. My app also is used in many phones and many cameras but I dont see many problems with video quality.

quocnhat7 avatar Sep 26 '19 03:09 quocnhat7

same problem i have https://drive.google.com/file/d/1TVjQUHuTqXqg9iIAnmvXtwFsvvqTgoKU/view?usp=sharing

heaveninfosoft avatar Oct 14 '20 13:10 heaveninfosoft

@quocnhat7 urgent please

heaveninfosoft avatar Oct 14 '20 13:10 heaveninfosoft

  • try another phone
  • try another camera => give conclusion: problem caused by camera or phone. I think it is because of camera.

Then, use camera Helper to adjust camera encoder setting (codec, camera resolution such as VGA, HD, ...) => you might see which case can give good video. => you try more tests to analyze

quocnhat7 avatar Oct 15 '20 03:10 quocnhat7

@quocnhat7 it is related to because of high resolution camera? i am using samsung 9 plus with 1080p camera and right now resolution is default resolution 640*480

heaveninfosoft avatar Oct 15 '20 05:10 heaveninfosoft

When using lib external camera, you needs to open camera. Default lib will open with VGA (640x480). You can ask camera open with another size such as HD, FHD by using mUVCCameraHellper.setDefaultPreviewSize(1280, 720); => pls also try to:

  • get supported preview sizes of camera (you can dig into the UVCCameraHelper.java class to find it)
  • try to open camera with any size there to see which size might be ok to use.

Those comments are for testing, I am not sure what your problem is (the gray video). You should analyze the issue by testings.

quocnhat7 avatar Oct 15 '20 06:10 quocnhat7

"Default lib will open with VGA (640x480)." => a faster way: pls open UVCCameraHelper.java, find variable previewWidth, previewHeight and change it to another number. Such as 1920x1080, 1280x720, 960x640, 640x360, 352x288, ...

quocnhat7 avatar Oct 15 '20 06:10 quocnhat7

right now i m testing on default VGA (640x480) with i have 3 camera 480p ,720p and 1080p issue occur only in 1080p camera will test according to your guide.

i have one more question if really help me than it s good for me i am doing streaming to youtube ,fb using this project it work well but in samsung 9 plus(Android 10) with 1080p camera audio recording stop can you guide me to overcome this??this issue only occur when app in go to background

so that mean when go to background in android 10 audio record any problem??

heaveninfosoft avatar Oct 15 '20 06:10 heaveninfosoft

You can add callback into audio recorder to get exact error code, then trace the reason on google. Perhaps android10 disallow to record in background, maybe. Or after some minutes, Doze mode of phone will disallow app use system resource such as microphone , ... => check error code to confirm this.

https://gist.github.com/Venryx/e1f772b4c05b2da08e118ccd5cc162ff You can ggle some samples such as this.

quocnhat7 avatar Oct 15 '20 06:10 quocnhat7

Gray Video Effect is mocking from Days . Cant fix it . Did everything mentioned

Please someone help

mCameraHelper = UVCCameraHelper.getInstance() mCameraHelper?.setDefaultPreviewSize(1024, 768) mCameraHelper?.setDefaultFrameFormat(UVCCameraHelper.FRAME_FORMAT_MJPEG) mCameraHelper?.initUSBMonitor(this, mUVCCameraView, listener) mCameraHelper?.updateResolution(1024, 768)

idr-pt avatar Oct 22 '20 07:10 idr-pt

@has yuo got rid from grey line???????

heaveninfosoft avatar Oct 22 '20 07:10 heaveninfosoft

@Has yuo got rid from grey line???????

NO. Only when Frame format Changed to YUYV . But i need MJPEG

idr-pt avatar Oct 22 '20 09:10 idr-pt

@quocnhat7 in some phone video recording video is blue/violent i can confirm this because of your video encoder can you change so it can work in all mobile??

heaveninfosoft avatar Oct 28 '20 06:10 heaveninfosoft

@jiangdongguo 我也有这个问题灰屏

RayCaiNZ avatar Oct 30 '20 05:10 RayCaiNZ

@RayCaiNZ

mCameraHelper = UVCCameraHelper.getInstance(); mCameraHelper.setDefaultFrameFormat(UVCCameraHelper.FRAME_FORMAT_YUYV); this will fix

@RayCaiNZ i know you we both meet in upwork please msg me so we can work together or at least tell me soution that i can increase project optimization. some time in dual camera it attach-detach automically please solve me this

heaveninfosoft avatar Oct 30 '20 06:10 heaveninfosoft

@RayCaiNZ

mCameraHelper = UVCCameraHelper.getInstance(); mCameraHelper.setDefaultFrameFormat(UVCCameraHelper.FRAME_FORMAT_YUYV); this will fix

are you able to capture pics ?

idr-pt avatar Oct 30 '20 14:10 idr-pt

@idr-pt

Still going grey

RayCaiNZ avatar Nov 02 '20 11:11 RayCaiNZ

@jiangdongguo 我也遇到灰屏问题,重新release再打开摄像头可以恢复正常,但是过一会可能又会出现

JinChangSheng avatar May 06 '21 08:05 JinChangSheng

一般设备开机运行时间久了容易出现,预览一段时间,屏幕变成灰色,顶部出现一点画面,预览返回帧率变低

JinChangSheng avatar May 06 '21 08:05 JinChangSheng

一般设备开机运行时间久了容易出现,预览一段时间,屏幕变成灰色,顶部出现一点画面,预览返回帧率变低

我也遇到了,请问解决了吗

hjywyj avatar Apr 28 '24 08:04 hjywyj

这是来自QQ邮箱的假期自动回复邮件。

您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

zhancaihai avatar Apr 28 '24 08:04 zhancaihai