Questions tagged [image-reader]

The ImageReader class allows direct application access to image data rendered into a Surface. This tag is to be used for questions relating to the android.media.ImageReader class in Java. Also include the "android" tag when you use this tag.

More information about this class can be found here.

34 questions
4
votes
0 answers

onImageAvailable() function not being invoked after unlocking screen

While testing performance of Android Camera2 API I noticed bug connected with ImageReader. When application is launched onImageAvailable() function is being invoked correctly but after locking and unlocking screen it is not invoked at all. The part…
wkurek
  • 43
  • 6
3
votes
1 answer

Trying to attach an opaque image into a non-opaque ImageWriter, or vice versa

In Android, I have an ImageReader which emits images onImageAvailable. I'm trying to forward those images to an ImageWriter to preview on a SurfaceView. When I attempt to do so, I receive the error stated above. java.lang.IllegalStateException:…
hellowill89
  • 1,337
  • 2
  • 12
  • 24
3
votes
2 answers

Unable to find PixelFormat Enum for Xamarin Android

I have the below code where i am creating a ImageReader instance in xamarin android, how to change Image Format from ImageFormatType.Rgb565 to PixelFormat.RGBA_8888 i am unable to find the Library or a Enum class for it. mImageReader =…
VINNUSAURUS
  • 1,349
  • 3
  • 15
  • 32
3
votes
1 answer

Why is Android's ImageReader class so slow?

I tried OpenCV for Android 3.4.1's brand new JavaCamera2View but it was too slow(~15fps for just showing camera view). When I tried the older JavaCameraView instead, it gave me good results(~30fps, which is the limit of my camera). I wondered the…
eivour
  • 1,559
  • 10
  • 18
2
votes
1 answer

ImageReader format compatibility for FirebaseVisionImageMetadata (via Camera2 API on Android)

I'd like to use the image byte array from the ImageReader to construct a FirebaseVisionImageMetadata object for barcode scanning (as part of the ML Kit ). I'm using the Camera2 API and following this PR for supporting frame previews. Size sz =…
VIN
  • 4,721
  • 5
  • 26
  • 58
1
vote
0 answers

How to add a watermark to an Android video as it is being recorded

I have an app that records video and overlays the preview with some data. The data can change while the video is being recorded and I would like to be able to have that data "baked in" to the video itself while the recording is taking place. Just…
user443654
  • 503
  • 3
  • 14
1
vote
1 answer

Android screenshot error: RGBA override BLOB format buffer should have height == width

I am trying to take screenshots of my Android device (Samsung Galaxy Tab S5e) using a service. I am using the code from here. In the code linked, ImageReader.newInstance(mWidth, mHeight, PixelFormat.RGBA_8888, 2); is used. Note the…
pookie
  • 2,890
  • 5
  • 34
  • 70
1
vote
0 answers

Camera2 live stream example

I am new to the Camera2 APIs and would like to see them in action in a project that captures live camera frames, post-processes them (ideally showing how to access the raw data buffer[] using ImageReader), and previews the post-processed data. Are…
Lolo
  • 3,411
  • 4
  • 34
  • 45
1
vote
0 answers

Should I use ImageReader during decoding with MediaCodec to access Image

I'm trying to decode frames, modify then, and encode to separate file. I have simplified code here: encoder = MediaCodec.createEncoderByType(MIME_TYPE); encoder.configure(outputFormat, null, null,…
404pio
  • 812
  • 1
  • 11
  • 29
1
vote
0 answers

OnImageAvailableListener is not being invoked for Camera2 API for taking a photo

I am trying to take a photo using the Camera2 API. The API is currently used to produce a preview on a SurfaceView on my screen which works fine, but when i try to capture image, the OnImageAvailable listener doesn't get called at all. I need this…
Hazed 2.0
  • 135
  • 9
1
vote
1 answer

Can I getBuffer after image.close?

I camera2 api, I save continuously image to Image[] and when want to capture picture, I call image.getPlanes()[0].getBuffer but app crashed and show error: Image is already close. How can I getBuffer after image.close ? Thank you!
1
vote
0 answers

ImageReader - discard some frames (decrease FPS)

I have application which is using hardware camera to make some analysis in OpenCV. I am using ImageReader to get frames, and then I am passing them to algorithm. But I would like to get only let's say 1 or 2 frames per second from ImageReader. I…
voximodo
  • 21
  • 1
1
vote
1 answer

Process Images obtained with ImageReader on Android

I am receiving an image from the ImageReader, with format PixelFormat.RGBA_8888 What I want is to transform that image to ARGB. Get the buffer is simple private OnImageAvailableListener frameObserver = new OnImageAvailableListener() { public…
Jano
  • 167
  • 1
  • 12
1
vote
1 answer

android camera2 preview lag when getting frame

I am using Android camera2 in order to extract frames in real time in preview mode to stitch them in NDK side(openCv). I use ImageReader surface to get frames, but it is limited to a max frame…
1
vote
1 answer

Difference between acquireNextImage Vs acquireLatestImage

I am working on Camera2 API to take pictures continuously and it's working fine, Here I am able to save the captured image using following code: ImageReader.OnImageAvailableListener readerListener = new ImageReader.OnImageAvailableListener() { …
Shailendra Madda
  • 16,925
  • 14
  • 71
  • 115
1
2 3