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.

43 questions
4
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,538
  • 2
  • 15
  • 26
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
4
votes
0 answers

android camera2 how to achieve continuous capture with 30 pictures 1second

When saving a bitmap, an error appear. How to achieve continuous capture? Do I do it right? This is my imageReader //wight 480, height 640, format JPEG,maxnum 30 //when I set format is YUV_420_888, I do not know how to translate it //to bitmap,so I…
zhangheng
  • 41
  • 3
3
votes
3 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,518
  • 3
  • 18
  • 38
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,678
  • 12
  • 20
2
votes
0 answers

java.lang.ArrayIndexOutOfBoundsException error when converting TIFF files

I am writing a code the convert tiff files to pdf using pdfbox but I receive the below error when reading some pages of the TIFF file. This does not happen to all files or all pages. PDDocument pdfDoc = new PDDocument(); ImageInputStream…
2
votes
1 answer

How to convert .png/.jpg format file to android.media.Image object?

I have an android app and noticed that it is onImageAvailable(ImageReader imagereader) function that takes images from the ImageReader when available and processes them. My aim is to manipulate that Image object so that it would process a png file…
2
votes
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
  • 3,796
  • 6
  • 49
  • 105
2
votes
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
  • 1,080
  • 1
  • 12
  • 32
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
  • 6,385
  • 7
  • 38
  • 77
1
vote
0 answers

In Android how can I take multiple images using ImageReader class

I am trying to take multiple images but the ImageAvailabeListener function is not moving forward. I guess it is waiting for next image. I tried aquireNextImage() but it is also not working. I'm taking images while MediaProjection. class…
1
vote
0 answers

Media Projection and Image Reader duo not working on Netflix/Youtube on Android TV

Media Projection and Image Reader duo not working on Netflix/Youtube on Android TV. I am trying to get image from android TV with Media Projection and Image Reader. On the log side, a warning catches my eye; probably because Image Reader uses…
1
vote
0 answers

Image Reader Works on Virtual Device, Not on Real Device

Image Reader Not Working on Real Device In Media Projection, when trying to capture the screen with the createVirtualDisplay function, ImageReader is running in Virtual Device and it always captures different images, but after capturing several…
1
vote
1 answer

How to use ImageReader to read OpenGL surface?

I'm trying to draw something use OpenGL ES 1.0, the rendering to screen works good. Then I want to use ImageReader to get the image data from surface, but its callback ImageReader.OnImageAvailableListener is not called at all while rendering, what's…
sunjinbo
  • 2,137
  • 4
  • 22
  • 45
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
  • 821
  • 1
  • 7
  • 21
1
2 3