Questions tagged [android-mediaprojection]

MediaProjection is an Android class that facilitates capturing the screen and recording system audio.

The android.media.projection classes were introduced in Android API 21 to allow applications to record still images, video, and (potentially) audio from the device. In previous releases, applications were only allowed to capture their own rendering, and different approaches were required for View-based UI and OpenGL ES rendering.

Because capturing content outside of the current application has security implications, applications wishing to use these features must get permission from the user first. This is handled through the MediaProjectionManager.

An official screen capture example can be found on github.

The images captured by the MediaProjection are sent to a virtual display, which takes a Surface as an argument. The Surface can be provided by a SurfaceView (for immediate display), an ImageReader (for access from software), constructed from a SurfaceTexture (for use as an OpenGL ES texture), or by MediaCodec/MediaRecorder (for video encoding).

178 questions
0
votes
1 answer

How to handle image capture with MediaProjection on orientation change?

I wrote test application for capturing the images with MediaProjection class. imageReader = ImageReader.newInstance(currentWidth, currentHeight, PixelFormat.RGBA_8888, 2); imageReader.setOnImageAvailableListener(this, null); virtualDisplay =…
user2318724
  • 259
  • 5
  • 16
0
votes
2 answers

Enable screen casting feature of Android from our application

I am working on casting application. I am able to cast local videos from my app on TV using chromecast device. Now I want to cast(mirror) complete android phone on the TV. I know Android provides this as a default feature by using Cast feature in…
0
votes
0 answers

Android MediaProjection performance improvements

I Would like to ask, if it's possible to improve performance for MediaProjection. Edited after fadden answer. Pseudo structure of app: 1) Fullscreen FrameLayout in AppCompatActivity:
0
votes
0 answers

Sending the output Mediaprojection API android through Socket

I want to share screen of the android with pc through Socket, the version of android don't matter. What i found after a lot of search: MediaProjection.createVirtualDisplay to ImageReader to Bitmap and send it through Socket Network. What do you…
0
votes
1 answer

IllegalStateException when reusing MediaRecorder instance

Hey I'm trying to make MediaRecorder record the contents of my screen. It works when I'm making a recording for a first time but when I try to record the screen for a second time it fails. Here is relevant code: void startRecording(String…
0
votes
1 answer

Supported video sizes MediaRecorder API android

I'm trying to record the contents of the screen using mediarecorder and mediaprojection api. When I'm trying to change the video to HD on my device the recording fails but it works fine with 640 x 480 resolution. So my question is how could I get…
0
votes
1 answer

Android Record screen and display it on uppermost Surface MediaProjection Manager

I record my android device screen by using MediaProjectionManager (since Lollipop). But i want to display this record on the same screen on a new uppermost Surface. This surface shouldn't be touched by the recording MediaProjectionManager (records a…
Martin
  • 80
  • 8
0
votes
1 answer

Mediarecorder resolution

I am developing a screen recording app that uses the mediaprojection class for lollipop. Now here is my question how do I set resolution of the recording? Let's say I want to record in 1920 x 1080 p Do i only need to set video size to 1920,…
YOYOYO
  • 211
  • 1
  • 2
  • 12
0
votes
0 answers

Mediarecorder setCaptureRate not doing anything

I have a screen recorder which i want the users to choose whether they want to record in timelapse mode or not. The user can choose timelapse or not in the settings and im getting info about what setting they have picked. However whenever i try to…
YOYOYO
  • 211
  • 1
  • 2
  • 12
0
votes
2 answers

android 5 , capture screen as raw rgb buffers

How can I capture the screen as raw rgba buffers ( without encoding ) using MediaProjectionManager ? I have seen many examples of how to capture the screen and encode it using MediaCodec but I want to use my own encoder instead.
jacob
  • 1,397
  • 1
  • 26
  • 53
-1
votes
1 answer

Start screen recording permission android java

I want to Record a screen automatically, without any permissions like in the image below. Is there any solution for it or any examples? if not then, I want to check that the user clicked on don't show again check box. Or is there any other way to…
-1
votes
1 answer

Save recorded phone screen

I'm trying to record phone screen in Android 5.0 Lollipop using MediaProjection and to save recorded video. I tried this code, but after I added saveFile(uri) to onActivityResult the app crashes when I start recording. What is the right way to get…
user3051755
  • 1,497
  • 2
  • 16
  • 27
-3
votes
1 answer

Android Screen Recording

Is MediaProjection (Screen Recording)can be used to record a specific view for some time instead of whole screen?.
1 2 3
11
12