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
1
vote
0 answers

android screenrecord is not working for presentation displays

I tried screencap utility to take screen shot of hdmi display, it is working fine as expected. The command is screencap -d 1 /sdcard/print.png The screenrecord utility is not working for non-default displays. I tried editing and recompiling the…
nmxprime
  • 1,506
  • 3
  • 25
  • 52
1
vote
1 answer

Reliable screen capturing using Android Media Projection API

Our implementations using the Media Projection API work fine. But we often lose frames while trying to write the captured images to files. Even if all the io code is executed in separate threads. We wanted to do some online image analysis on the…
1
vote
0 answers

Screen recording in android using MediaRecorder api

Hey I'm trying to record a screencast app in android lolipop using mediarecorder api. Problem is that my application acts weird. Whenever I call start recording on the VideoRecorder class even when hardcoding the configuration like video size and…
1
vote
1 answer

MediaProjectionManagerService internally throws DeadObjectException

I have used the Media projection API to capture the screen. I am getting the below warning while stopping the media projection. 10-07 10:32:57.394 537-537/? W/MediaProjectionManagerService﹕ Failed to notify media projection has stopped …
M Vignesh
  • 1,586
  • 2
  • 18
  • 55
1
vote
1 answer

How to change the Media Projector API system activity(MediaProjectionPermissionActivity) shown alert dialog text in android?

I am working on MediaProjection API to capture the screen. I have used the below code to call the android System Activity to capture the screen, MediaProjectionManager mProjectionManager =…
1
vote
0 answers

Android media projection produces an empty movie file

I'm trying to create a simple screencast app which would capture the screen and the save to a movie file. So far my application has been producing only empty movie files(black screen) of correct length and size. I'm not sure if this helps but when…
0
votes
1 answer

How to take a screenshot using MediaProjection API?

I am new to MediaProjection API and I have very limited knowledge in computer graphics. I need help with as in how to use this particular API. What should I study to learn to use this API. Google documentation gives little information. And…
Parag
  • 55
  • 6
0
votes
0 answers

Create videos with react native and generate uri to share or save on device

I have a component that renders a short animation, with a maximum duration of 8s, I need to generate a video of this component and get a uri, so the user can share it or save it on the device. It doesn't seem like anything in react native supports…
0
votes
0 answers

How to exclude overlay/floating icons or contents from Android screen recording using MediaProjection API or when taking screenshot

I'm working with the MediaProjection API in Android to record the screen. I've noticed that some built-in screen recorder apps manage to overlay icons on the screen during recording, but these icons are not included in the recorded video. How can I…
0
votes
0 answers

Reusing media projection Intent on Android 14

I have an Android screen recording app. In my app the user can start a screen recording directly in the app, as well as via a button in a notification (bound to a foreground service). To start a recording I retrieve the intent for creating media…
jhain
  • 1
  • 1
0
votes
1 answer

Allow MediaProjection Automatically without having the user interventions

I want to add a screen capture activity in my app but I don't want to show the below dialog for the permissions. Is there any way that I can set permissions automatically for screen capture/screen share and by-pass this dialog? How to get the intent…
0
votes
0 answers

Recording and Casting permission dialog is getting canceled immediately

I am developing an android app that requires screen capturing. I am using MediaProjectionManager to take screen shots. The problem is the permission dialog is being displayed for a sec and closing immediately. Permission Dialog This is how I am…
0
votes
0 answers

How to stream Google.ARCore output to WebRTC in Xamarin android?

I am developing an Android application that uses google's ARCore in Xamarin. So far I have managed to do this: I created a GlSurfaceView and I am able to see the output of ARCore (rendered by opengl) in it. I am using OpenVidu as WebRtc media…
Luka
  • 4,075
  • 3
  • 35
  • 61
0
votes
0 answers

Can use MediaProjection to detec sharing screen or screen record?

I try to create an Android application to detect sharing screens and screen recording. I use DisplayManager but it's not working on some devices so I want to try another way. MediaProjection is a library to capture screen content and/or record…
Hoàng Vũ Anh
  • 647
  • 1
  • 8
  • 24
0
votes
0 answers

Is it possible to capture Android Screen multiple times simultaneously?

Is it possible to capture Android screen multiple times with different settings on Android 13? I've tried two approaches: Create two media projections using the same Activity.RESULT_OK and intent Create one media projection and two virtual displays…