I am playing streaming in vlc player and using surfaceView to show streaming, Now, i want to take screenshot of streaming at any time.
Problem
Now problem is that we can not take screenshot of SurfaceView. I also saw a sample of Media Projection but it's asking for permission every time. So on pause method of activity is called every time, Which should not be.
Can Any one help me on this,
Is there any Xml tag which replace SurfaceView to take screenshot or we can remove the permission to capture screen using Media Projection.
Related
I'm trying to find a way to record the screen of the application and more specifically the WebView activity inside the app.
I've done some researches and people suggested using MediaProjectionManager or MediaRecorder APIs for that but I'm not very sure which one and how to implement it.
I looked at some examples and the MediaProjection only record what's in a SurfaceView.. but mine is a Webview, would it still works? Any suggestion would be appreciated.
Thanks!
I looked at some examples and the MediaProjection only record what's in a SurfaceView
No. An app using the media projection APIs does not have to have a SurfaceView at all. For example, this sample app captures a screencast, and it does not have a SurfaceView. The media projection APIs capture what is on the screen. This could be your app or other apps that are on the screen at the time that you are recording.
but mine is a Webview, would it still works?
In general, yes, bearing in mind that you are recording what is on the screen, so if another application appears (e.g., an incoming phone call), you will be recording that other application. The media projection APIs do not record a View, they record the screen.
One possible limitation with the media projection APIs would be DRM. It is possible that you will not be able to record everything, because some views are showing DRM-protected content (e.g., playing back a movie), and that might not get captured. I have not played with the media projection APIs in this situation to see how they behave.
I want to make video player with next option to keep playing video after rotate device.
I created service with MediaPlayer and set SurfaceHolder of SurfaceView after rotate sceen. It works only for Android 4.x. For Android 2.3.X after replace second call setDisplay user doesn't see video, but hears sound of video.
Could you give me direction or example how to implement this option at custom player?
PS. Player shows streaming video.
Okay, I've found solution. It's so easy. I set configChanges="orientation|screenSize" for activity with custom player. In this case activity won't be recreated after rotate device it's changed on the same instance.
As result, I don't need service for keeping MediaPlayer and don't need replace SurfaceHolder.
I want to show filtered camera preview while recording a video using media recorder. To filter the preview i need frames normally which i can get that from onPreviewFrame() function but while recording video with media recorder, onPreviewFrame() function does not get called. So what i want to know , is there any other ways to get these frames for filtering and then show them after modification ? I checked some apps from Google Play for example, Videocam Illusion. Its showing preview with effects during recording videos. I want to do something like that but have no hint how to do so. So i will appreciate any help/hints/code/sample regarding the issue. Thanks.
I haven't done it myself, but searched for it not so long ago. There's an answer on StackOverflow to show modified buffer of PreviewFrame:
https://groups.google.com/forum/?fromgroups=#!topic/android-developers/yF6CmrIJzuo
And here, a google groups link on the same topic.
How can I manipulate the camera preview?
Hope this helps, I'm planning on an application that modifies the preview frames, but is not going to record anything.
Best Regars.
I am developing an android application in which a specific video is played when the poster of a specific movie is shown infront of the camera in android, i found many AR tutorial just show 3D object when detect a pattern, i need some advice to make application that can play video with AR application using android camera and qcar SDK
I don't know qcar, but of course you can put a SurfaceView upon an existing SurfaceView from your CameraPreview and play a video in it.
What I would do is implementing your poster-recognition logic, this will be tricky enough and then, If it works reliable, I would add another SurfaceView in which the video is played.
You will find out, that the CameraPreview surface has actually to be on top of the video surface.
I assume you are trying to play video on glsurface ,it is possible by using surface video texture ,but only ics(4.0) and above devices support surface video texture.Vuforia have a very good sample of this here,you can handle what to do for lower devices such as playing video fullscreen etc..
I want to make an app which takes a video from the camera, adds additional visual info (overlays) and creates a video file from it which can later be uploaded to a server.
How to do that?
Without prior experience with such tasks, I assume there are 2 options:
screen-capture and encoding to video file. However the resulting framerate may not be sufficient.
record the video to sdcard and reencode later with added overlays. Live encoding is not needed, thus it's ok for the encoding process to be slower then realtime.
You will have to resort to using for instance ffmpeg and the NDK to encode your own video. There's plenty of examples out there, but it's still somewhat cumbersome.
Hope this helps:
Use RelativeLayout. Put the camera
preview as the first child of the
RelativeLayout and the VideoView as
the second child. The VideoView will
appear to be "on top of" the
SurfaceView for the camera preview.
BTW, VideoView really is a
SurfaceView. Note that you may decide
someday to use a SurfaceView and
MediaPlayer, rather than a VideoView,
so you can get more control on video
playback
Source: http://osdir.com/ml/Android-Developers/2010-03/msg00077.html