android-textureview

Android: What is the difference of TextureView's setTransform() and setScaleX/Y()?

懵懂的女人 提交于 2021-01-29 16:17:32
问题 I am using TextureView for displaying graphical video content. As the MediaCodec will render the content occupying the whole of the TextureView, so I need to scale it to keep the aspect ratio of the original content. We know that TextureView has its own method of transforming: setTransform(android.graphics.Matrix) And also two other methods inherited from View class: setScaleX (float scaleX) setScaleY (float scaleY) Both can be used to achieve the same purpose. However, I noticed some

preview stretches in camera2 apis

◇◆丶佛笑我妖孽 提交于 2020-06-24 20:51:52
问题 Following are the screenshots when using texture view in camera2 apis.In full screen the preview stretches,but it works when using lower resolution(second image). How to use this preview in full screen without stretching it. 回答1: Below answer assumes you are in portrait mode only. Your question is How to use the preview in full-screen without stretching it Let's break it down to 2 things: You want the preview to fill the screen The preview cannot be distorted First you need to know that this

preview stretches in camera2 apis

二次信任 提交于 2020-06-24 20:51:27
问题 Following are the screenshots when using texture view in camera2 apis.In full screen the preview stretches,but it works when using lower resolution(second image). How to use this preview in full screen without stretching it. 回答1: Below answer assumes you are in portrait mode only. Your question is How to use the preview in full-screen without stretching it Let's break it down to 2 things: You want the preview to fill the screen The preview cannot be distorted First you need to know that this

Adding images to video with help of this MediaCodec Api

岁酱吖の 提交于 2020-05-17 08:33:25
问题 I am trying to add waterMark to the video by using this library but i couldn't the get the desired result as shown in the library https://github.com/MasayukiSuda/Mp4Composer-android . can anyone point out or help me how to solve it thanks what i tried mp4Composer = new Mp4Composer(videoItem.getPath(), videoPath) // .rotation(Rotation.ROTATION_270) .size(720, 720) .fillMode(FillMode.PRESERVE_ASPECT_FIT) .filter(new GlWatermarkFilter(BitmapFactory.decodeResource(context.getResources(),R

Android video mirror effect

女生的网名这么多〃 提交于 2019-12-23 15:16:58
问题 I'm working on a camera application that has to capture video in mirror effect. I used texture view to show video preview with mirror effect. Now video preview showing mirror effect but after video being captured and saved it don't have mirror effect. I used MediaRecorder to save video file. I Google this problem but didn't find any solution. I want to save video with mirror effect as shown in camera preview. thanks in advance. 回答1: I have solved this problem by flipping the video. when the

Playing video using textureview in recyclerview

旧时模样 提交于 2019-12-17 17:33:40
问题 I am trying to implement a list with videos like vine or Instagram app. Where they play video plays when list item is shown or fully visible and video pauses when list item gets hided. I am using textureview with media player to play a video from url and added it as list item in recyclerview. Following is my code. VideosAdapter Class: public class VideosAdapter extends RecyclerView.Adapter<VideosAdapter.ViewHolder> { Context context; private ArrayList<String> urls; public static class

How to draw objects on TextureView Camera stream preview and record the stream with objects?

荒凉一梦 提交于 2019-12-13 08:50:39
问题 I need help with an application I am working on. The application has to have a custom Camera interface to record a video with audio and have to add some objects in realtime on the TextureView canvas. Old Camera API is deprecated, so I have to use Camera2 API to render the live preview on TextureView. My goal is to draw some objects on top of the TextureView Canvas, could be some text/jpg/gif while the camera stream renders in the background and being able to record the video with my overlay

how to rotate textureView to show a cameraPreview

╄→尐↘猪︶ㄣ 提交于 2019-12-13 05:23:42
问题 I use the camera2 api to show a camerapreview, and i lock the screen orientation on lanscape, my problem is that i want to rotate the textureview to display the correct camerapreview, when i rotate it using the method setRotation, it becomes smaller. I search on stack but all solutions are relative to camera(first api) so is there a solution to rotate the textureView. 回答1: You can add a rotation to the TextureView's matrix. For an example, see Grafika's "play movie activity", which sends the

Android MediaExtractor crash when decoding some mp4 files. Libc fatal signal 11

血红的双手。 提交于 2019-12-12 04:17:07
问题 I am using Google Grafika examples to display video on TextureView. "Double decode" to be more specific . Code work most of the time but for some mp4 files it crash giving only : libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 7998 Same code works for webM files and most mp4 files. Place where I expect it to fail is : extractor = new MediaExtractor(); extractor.setDataSource(sourceFile); in MoviePlayer [L:113] Any hint how to walk around or what might be the problem? 回答1: This

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