Android-UVC-Camera icon indicating copy to clipboard operation
Android-UVC-Camera copied to clipboard

Saving image with error

Open MustafaErkinDal opened this issue 1 year ago • 4 comments

Hi,

I am using Pure Thermal 2 Flir 3.5. I have no problems with camera stream. However, when I save an image it saves in wrong colors (purple and green) with stripes on it. I am using Android Studio. Have you ever face such a problem ? Am I doing something wrong ?

Thanks in advance.

IMG_4565

My settings are:

Packets Per Request = 4 Active Urbs = 4 AltSetting = 1 Maximal Packet Size = 642 Videoformat = YUv2 Camera Format Index = 1 Camera Framelndex = 1 Image Width = 160 Image Height = 120 Camera Frame Interval (fps) = 9 UVC Values: bUnitID = 0 bTerminaliD = 0 bcdUVC = 1.00 LibUsb = true

MustafaErkinDal avatar Feb 14 '24 08:02 MustafaErkinDal

Hoi Mustafa,

I noticed that in the method 'PreviewPrepareStream' in the 'uvc_support.cpp' file there is the part for YUV video format missing (in line 98 - 102). I think that was because YUV is not that often much in use. I will fix it in the next couple of days (depends on the time I have) and then come back to you to test it.

Wish you a happy carnival,

Peter

Peter-St avatar Feb 14 '24 14:02 Peter-St

You need to change your Videoformat to UYVY. Do so and report if it worked.

Peter-St avatar Feb 18 '24 18:02 Peter-St

Hello Peter,

I changed the format to UYVY as you said but sadly it did not work. If you may look at the StartIsoStreamActivityUvc.java file line 1302 it is like the following screenshot

ssforpeter

I assume UYVY format is purposely out of use. I tried adding "PreviewPrepareStream(mNativePtr, mPreviewSurface, new IFrameCallback()..." method, copying from other formats code, but I could not see the camera stream. If you have any other suggestions I will be appreciated.

MustafaErkinDal avatar Feb 21 '24 08:02 MustafaErkinDal

Hoi,

Your hints were right and I made some changes to solve the issue. Can you plz update your repo and test out the stream again. Thx, Peter

Peter-St avatar Feb 21 '24 17:02 Peter-St