I am building a app where i am using mobile vision sdk for face detection and showing some overlay on face. but i am facing problem while record video. Is there any solution to record video with same problem.
Thanks
Since Android 5.0 there is a new API that can be used for screen recording: MediaProjection. The MediaProjection grants the ability to capture screen content, but not system audio. Also it won't capture secure screen content. You need user permission for capturing the screen. Please refer to this for screen recording.
Screen Video Record of Current Activity Android
Related
I want to record only part of a screen
I`ve tried this sdk to record a screen, but I was able to record only full screen of device
Screen recording can be done without requiring root (Android 5+) using the MediaProjection package. An example of a recording activity can be found here.
I don't want anyone to use a screen recording app on their Android phone to VIDEO record my app's screen. I know screen capture can be prevented, but what about video?
By adding FLAG_SECURE into your Activity You can secure screen capturing functionality
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
write above setContenView();
from documentation
Android 5.0 lets you add screen capturing and screen sharing
capabilities to your app with the new android.media.projection APIs.
This functionality is useful, for example, if you want to enable
screen sharing in a video conferencing app.
The new createVirtualDisplay() method allows your app to capture the
contents of the main screen (the default display) into a Surface
object, which your app can then send across the network. The API only
allows capturing non-secure screen content, and not system audio. To
begin screen capturing, your app must first request the user’s
permission by launching a screen capture dialog using an Intent
obtained through the createScreenCaptureIntent() method.
and Also from this documentation says
Window flag: treat the content of the window as secure, preventing it
from appearing in screenshots or from being viewed on non-secure
displays.
NB
If you are using SurefaceView with media player then use SurfaceView.setSecure(true), then your video will be secured from any other apps.
Will it be possible to prevent other camera app from using the camera while my app is using it, at least until the duration of my video recording is completed?
If yes, how can I achieve it?
If no, is there any event I can listen to to know if other camera app has accessed the camera?
What's happening is that the camera instance is being taken from my app and no video is being fed to the recorded file, only audio.
I am trying to make a system wherein I need to send live video covered on an external wireless camera (not phone camera) to an android app I am going to make. The camera's I searched for only send videos to their own apps. So, is it possible in some way to design an app which will be able to take that live video? The camera is connected to the phone through Wifi. I need to process the video for some real time application, so I will need the live video only and not after it gets saved through their app. I have no prior experience in android, so any help will be appreciated. Thanks.
Basically i want VIDEO PIRACY PROTECTION
My application has video streaming and I want to protect my video streaming from other applications. Other applications should not be able to capture screen while my video is playing. Any suggestions how can i achieve this.. Thanks in advance.
You can secure screen capturing functionality by adding FLAG_SECURE into your Activity as follows
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
Check this link which says
Screen capturing and sharing
Android 5.0 lets you add screen capturing and screen sharing
capabilities to your app with the new android.media.projection APIs.
This functionality is useful, for example, if you want to enable
screen sharing in a video conferencing app.
The new createVirtualDisplay() method allows your app to capture the
contents of the main screen (the default display) into a Surface
object, which your app can then send across the network. The API only
allows capturing non-secure screen content, and not system audio. To
begin screen capturing, your app must first request the user’s
permission by launching a screen capture dialog using an Intent
obtained through the createScreenCaptureIntent() method.
Also documentation at this link says that
Window flag: treat the content of the window as secure, preventing it
from appearing in screenshots or from being viewed on non-secure
displays.
Above solution will surely prevent applications from capturing Video of your app
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
write above setContenView();
It prevents only snapshot capturing. And also prevents video capturing. But For video capturing its device specific.
Try adding this in your Activity,
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);