Record video with overlay image in android - android

Is it possible to record video with overlay view? While recording the video I have displayed one small image on the overlay view. What I want to do is I want those overlay image along with the video recorded. So when I will open that recorded video, I will be able to see that overlapped image that recorded with video also.
Friends, I need this solution ASAP. Please suggest proper solution :)

Unfortunately, there is no way in the current Android API to get between the camera input and the encoder. Any solution would either involve capturing frames from the video source, overlaying the additional image, and then including an encoder for the captured frames. Even in native code with NEON optimizations on a fast system, this is going to be a slow process. Alternatively, the whole stream could be post-processed in a similar fashion, but this would also require a decoder.

For future reference: This is possible using the CameraView library, at least in "snapshot video" mode.

Related

Capture images when the video is being played in the Android view

I want to capture images when the video is being played in the android app. It will be great if anyone can please let me know the libraries for the application
What you can do is capture the video and the do some sort of post-processing that splits the video file into the frames that you want.
There are a few libraries/tools available that enable you to do this in java.
https://bigflake.com/mediacodec/
http://www.xuggle.com/xuggler/
https://github.com/jcodec/jcodec

Android - Add text or image while recording video?

I am struggling with recording and editing videos. For editing, I found a useful library in Android named ffmpeg4Android. However, I am still get stuck in recording video. Here is what I want:
1/ Add text or images in video while recording
2/ Add filter while recording video
I found there is a library GPUImage for Android but it has only some examples related to taking a photo, not to recording video)
Please let me know if you have any ways or any suggested libraries which can do it.
Thank you in advance!
Links which I read when researching:
Add overlay while record video on Android
How to Record video with GPUImage?
FFMpeg add text to actual video file after recording in Android
You can add an overlay image on video using a blend filter.
You cannot add text directly but you can add the text to the image writing on a canvas.
android-gpuimage library does not natively support video recording but you can try using the android-gpuimage-videorecording library. It is a fork of the gpu-image for android that provides also the video recording functionality
android-gpuimage-videorecording
see the GPUImageMovieWriter class
It should point you in the right direction for developing your own video writer on top of GPUImage.
The idea is to:
draw on current screen surface
switch to encoder input surface and draw previous frame buffer again on it
switch back to screen surface
other useful links: EGL surface helper, Media encoder

Android Video File Processing and re display = performance issue

I am working on a project to read a video file from sdcard then process frames and re diplay as a video in real time. So far I didn't manage to come up with a solution for directly extract frames from the MediaPlayer like MediaPlayer.getCurrentFrame();. MediaMetadataRetriever.getFrameAtTime() is super slow, difficult to get a descent frame rate.
The only thing I have right now is using a TextureView surface with MediaPlayer. Here I start the MediaPlayer and in real time read the bitmap form TextureView asTextureView.getBitMap(), then process BitMap and display it on another ImageView. Here this gives me a a descent frame rate.
The problem here is TextureView has to be in the xml layout and should visible, Which I do not want.
Can some one please shed some light here? Is it possible to somehow hide the TextureView which is attaching to the MediaPlayer, without fake hiding like using RelativeLayouts :). iOS has a solution for this which is AVPLAyerItemVideoOutput, I need something like that with android.
Or any other work around to extract frames from video file?
Thank you
For video processing ...... you can use the FFMPEG Library for getting frames of videos but for that you have the knowledge of android native integration.
I hope this will help you.enter link description here

Recording text/image overlay on Android

How can I put text or transparent image into a video? I can display text overlayed camera output but how can I record it? Using opencv is an alternative but I don't really want to use opencv manager(or 25+ mb binary).
Is there a way to record overlayed video with Android SDK or 3rd party library. What are my options?
Update: I'm not looking for a "record to disc then load recorded video and process every frame" solution. I'm trying to find a way to process every camera frames before recording. Something like opencv.
You can get help from here to get video byes array of each frame from camera and then save them using some third party encoder. Now you can create bitmap from byte array, and using bitmap you can write a overlay text on it. Example code here and here is the link for the third party encoder AndroidFFmpeg

render overlay graphics into camera video

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

Categories

Resources