Closed sumitatcs closed 6 years ago
You can check the example MultiTextureActivity or MergeVideoActivity in https://github.com/ChillingVan/android-openGL-canvas I have added feature last week.
I checked those examples but I have not been able to figure out how to simultaneously record using the encoder. How do i proceed to integrate the encoder with multitexture?
@sumitatcs Your encoder can provide a Surface right? Then you can pass the surface to MultiTexOffScreenCanvas. And when MultiTexOffScreenCanvas draws, what it draws will output to encoder then the encoder can produce video frames.
Unfortunally, this AndroidInstantVideo lib has not integrated the MultiTexOffScreenCanvas. You can wait or DIY. Maybe tomorrow I will integrate it.
I have added the example of Multi Texture. Check the TestMp4MuxerActivity
I am trying to do something similar but with a list of videos. I am encountering android.media.MediaCodec$CodecException: Error 0xffffffde. What I did was set InitialTextureCount for CameraPreviewTextureView to videoList size + 1, similarly for streampublisher, creating list of mediaplayerhelpers and surfaces for videos and putting the corresponding play/stop events for all of the mediaplayerhelpers in activity callbacks like in example. What I am not sure is when to call addProducedGLTexture to add textures for multiple videos.
@inventionsbyhamid I think you need not to call addProducedGLTexture since you have set initial count and your media list size is fixed. You should be able to get the producedTexture through surfaceCreatedListener. Does the MultiTex sample work? If it works, you can add more media player and add initialCount. If it works, you may be able to find why yours does not work.
Or you can upload your demo code here.
I have seen the TestMp4MuxerActivity and can draw images over camera preview. How do i draw video over camera preview? I want to achieve real time video filters(like stars and all) like other photo editing apps. For this i want to draw the filter videos over camera preview and record it simultaneously. I am able to decode a video to another surface but not able to draw it on the camera preview itself. How to achieve this?