Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving image with error #42

Open
MustafaErkinDal opened this issue Feb 14, 2024 · 4 comments
Open

Saving image with error #42

MustafaErkinDal opened this issue Feb 14, 2024 · 4 comments

Comments

@MustafaErkinDal
Copy link

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

@Peter-St
Copy link
Owner

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
Copy link
Owner

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

@MustafaErkinDal
Copy link
Author

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.

@Peter-St
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants