textureview

Crop camera preview for TextureView

允我心安 提交于 2019-12-17 15:36:00
问题 I have a TextureView with a fixed width and height and I want to show a camera preview inside of it. I need to crop the camera preview so that it doesn't look stretched inside my TextureView. How to do the cropping? If I need to use OpenGL, how to tie the Surface Texture to OpenGL and how to do the cropping with OpenGL? public class MyActivity extends Activity implements TextureView.SurfaceTextureListener { private Camera mCamera; private TextureView mTextureView; @Override protected void

How to reduce latency in MediaCodec video/avc decoding

我与影子孤独终老i 提交于 2019-12-17 07:38:27
问题 I performed some simple timing of MoviePlayer.java in the Grafika MediaCodec sample code running on a Nexus 5. I put a log statement at these locations: At line 203 just before decoder.queueInputBuffer At line 244 after decoder.dequeueOutputBuffer I correlated the log statements using presentationTimeUs . Here is an excerpt from logcat: 01-29 10:56:43.295: I/Grafika(21286): queueInputBuffer index/pts, 2,0 01-29 10:56:43.305: I/Grafika(21286): queueInputBuffer index/pts, 0,33100 01-29 10:56:43

How to animate TextureView?

℡╲_俬逩灬. 提交于 2019-12-13 06:09:47
问题 I am trying to fade in a TextureView but for some reason its not animating. It just simply pops in the video, no fade at all and i dont really know why that is because after some research i have found that TextureView can be animated normally. Here is my code, i hope you guys can give me a pointer in the right direction. PS, i have left out all irrelevant code that does not concern itself with the textureview and the animation. public class MainActivity extends AppCompatActivity implements

GLTextureView create hole behind it

若如初见. 提交于 2019-12-12 02:59:28
问题 Hello I worked on a GLTextureView to display an alpha video, but because of the alpha channel I setted setEGLConfigChooser(8, 8, 8, 8, 16, 0); I tried a first time with a GLSurfaceView but the problem was that it needed a setZOrderOnTop(true) to show it and the view wasn't anymore attached to it's container (which is a zoomView). A TextureView is better but now I've my video in a hole rectangle on my container sadly! Source: wanted --[EDIT]-- Here some exemple : On top it's an GLSurfaceView

Stopping video in TextureView

百般思念 提交于 2019-12-12 02:49:07
问题 I inserted textureview in my recyclerview,this guide I found in StackOverflow https://stackoverflow.com/a/17450763/6241501 but when I try to i,plement this in my recycler view I saw that video are all playing,but I need to all video be stopped when I starting my app.How can I do that? TextureView class: public class MyVideoView extends TextureView implements TextureView.SurfaceTextureListener { private MediaPlayer mMediaPlayer; private Uri mSource; private MediaPlayer.OnCompletionListener

why my video doesnot fit the size of the texture as i change the size of the texture

五迷三道 提交于 2019-12-11 16:08:24
问题 Iam trying to animate a video rendered using texture view, the animation works fine , but when i scale the texture to a different size the media player does not scale to fit the size of the texture,the video is always playing full screen in the background and i can only see part of the video when i scale the texture my code works fine on some android devices running android 4.0 but does not work on devices with later versions of android . heres my code for the animation kindly tell me where

How to check a video has sound or not in Android?

这一生的挚爱 提交于 2019-12-11 14:36:30
问题 I am using a TextureView with a MediaPlayer to play an mp4 video from a url. Is there any way I can programatically check if the video I am playing has sound? Edit: I'm using API 14, so I don't have access to the MediaPlayer method getTrackInfo Many Thanks 回答1: In API level 16 or later, the MediaPlayer class has a getTrackInfo method that returns a TrackInfo[]. You could then call getTrackType for each element in the array and see if you get MEDIA_TRACK_TYPE_AUDIO . 来源: https://stackoverflow

How to draw Buffer[] to a TextureView on Android?

纵然是瞬间 提交于 2019-12-11 12:18:06
问题 I'm using JavaCV's FFmpegFrameGrabber to retrieve frames from a video file. This FFmpegFrameGrabber return a Frame which basically contain a Buffer[] to hold image pixels for a video frame. Because performance is my top priority, I would like to use OpenGL ES to display this Buffer[] directly without converting it into Bitmap . The view to be displayed is only taking less than half of the screen and following the OpenGL ES document: Developers who want to incorporate OpenGL ES graphics in a

Make video fill screen and keep aspect ratio

烂漫一生 提交于 2019-12-11 11:45:53
问题 Java and C# (Xamarin.Android) accepted I have a MediaRecorder that streams the cameraframes onto a TextureView (basic camera2 approach) the TextureView fills my screen. I want the video to fill the screen but keep the aspect ratio. I know I have to eventually cut of either left/right or top/bottom parts of the video, to keep the aspect ratio. How can I make the video fit the TextureView and "zoom in" until the whole screen is filled? I don't want "black bars" that compromise for the ratio to

Texture View video and Bitmap display

放肆的年华 提交于 2019-12-11 11:42:32
问题 I have a TextureView that displays a bitmap(placeholder image) and when the user loads a video the textureView should show the video. I managed to get video playback in the texture view and showing a bitmap in a textureview, but when done in sequence i just get a black screen. In my onSurfaceTextureAvailable method i draw a bitmap on the surface view as followed: @Override public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { Bitmap bm = BitmapFactory