mtsahakis / MediaProjectionDemo

One Activity sample app of using Android Lollipop MediaProjection API to capture device screenshots
Other
210 stars 76 forks source link

Black Bitmap after screenshot #12

Open Raphdeumax opened 7 years ago

Raphdeumax commented 7 years ago

Hi, When i take screenshot of YouTube during movie playing, i get a black bitmap in Imagelistener. Thanks.

mtsahakis commented 7 years ago

Hi, Which Android OS version are you using and how do you watch the movie (YoutTube app, browser, which browser version, etc). Thanks, Manos

Raphdeumax commented 7 years ago

Hi manos and thank you for your answer. Actually i use android tv in version 6.1 and I try to capture the screen of my Android TV in bitmap format but when a video appears in the Youtube application for example, the pixels in the bitmap are black.

Raphdeumax commented 7 years ago

I use a part of your code to made a system similar to Ambilight on android tv with an arduino.

mtsahakis commented 7 years ago

HI, I am not familiar with Android tv, but I would imagine that the way ImageReader is created does not fit your context. If ImageReader is in fact producing images in a reasonable frame rate, but they are black, maybe try to play around with ImageReader.newInstance(mWidth, mHeight, PixelFormat.RGBA_8888, 2); and use different formats.