videos editing in android, insert and remove frames from video - android

I've been working on this videos thing in android and I thought to make it more functional. I have a question that, is there any way we can insert or remove frames from some video, like edit videos the same way we edit images, give them effects and all. I think, I am clear. Any links, sample codes, hints or books would be useful to start with this.
thanks :)

Here are multiple things you can look for video editing.
The more efficient in FFMpeg android sample for processing video (so that effects on video applied and saved on device as new video with applied effects) FFmpeg android java
For run time effects, just to show the user effect on video while running in your app, can use Vitamio

Related

How to trim a video without using ffmpeg on Android?

I am building an application in which I need to trim videos. It is possible to do this using ffmpeg, but I can't use it because it uses the gpl license.
I tried using mediaCodec but can't use the codes I found.
How can i trim videos on android?
I had to develop trim functionality into my app a few months back and found that FFMPEG is very heavy and wasn't as accurate as MediaCodec.
None of the examples helped me but as I was developing in Kotlin I had to rewrite it anyway.
Here is the breakdown of how to use MediaCodec:
Pass the file to your mediacodec class
Extract the video from a file
Create your buffer size
Seek to where you want to file to be trimmed from or to
Mux your audio and video together
We tried to find a way to do the start and finish times together but we ended up just duplicating the clip first and passing both in with a start and and end time.
You'll need to post your code and show where you're having the issue with MediaCodec for people to help you.

Get frames of the video and perform modifications in that frame in android

I need to get the frames a video and do some modification on it like drawing something on it or write some text. Then on saving I need that video with that modifications.
Please suggest me the best way to do that. Any help is appreciated.
Please see the below app for to understand my problem
https://play.google.com/store/apps/details?id=com.techsmith.apps.coachseye.free
You can try INDE Media Pack - https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials
It has transcoding\remuxing functionality as MediaComposer class and several sample effects like Grayscale, TextOverlayEffect etc. For exampe effect to put text: https://github.com/INDExOS/media-for-mobile/blob/master/Android/samples/effects/src/com/intel/inde/mp/effects/TextOverlayEffect.java. It could be easily enhanced to other effects

How to display preview thumbnail while scrubbing the video.

I am trying to display the preview thumbnail when user move his finger over video scrubber.
The only solution I m finding is to extract thumbnails using some 3rd party tool and save it to server or pass it to app via some JSON.
What I m trying to do is something similar to JwPlayer (http://jwplayer.electroteque.org/controls-preview)
Any idea where to start?
Or is here any standard protocol that support manual generated thumbnails? Or i need to go with my own feed format.
I don't quite know what the configuration of your project is, but one possibility is too actually instantiate a mini player and display the progress of the video as the user the slides. So essentially this "mini player" would appear when the user begins drag, and skip to whatever time is specified, and pause. It is similar to a project I am working on now. This is a great reference as well: http://www.autodeskresearch.com/pdf/p1159-matejka.pdf. This technique is much different then the one I suggested, but is another alternative depending on your scenario.

Image display for few seconds in YouTube video

In my application, we are capturing a video and uploading it to YouTube. But the requirement is, we need to display one image for 2 seconds before the video and after the video (similar to ads in Youtube videos)
And also we need to display a logo at bottom right corner of the video.
I searched for YouTube API for this and couldn't find any clue. Is there any way to do this?
Thanks in advance.
As far as the logo goes, your best bet would probably be to extend the YouTubePlayerView and add the logo on top of the video.
For displaying the image, I would create a layout that can hold either the video or the image. You could then use a FragmentManager to switch between the image and the video. Use a Timer to display the image for 2 seconds and then use the FragmentManager to switch to the YouTubePlayerView (or whatever your extended class is).
Then you will have to extend the YouTubePlayer.PlaybackEventListener to work with your new view. Call the onStopped() method of this listener to switch back to the image after the video is done playing.
EDIT
What it appears you want to do is some video editing. This is definitely not something that you will be able to do through the YouTube API, so you have no choice but to do it natively though the app.
First, you will have to convert the image to an mp4 file. This is no easy task, but this code seems to provide a solution. Make sure that the video from the image has the same encoding as the original video. This makes it possible to combine the videos using MP4Parser (although I have never actually used this library, it claims to work for this).
Finally, to make the video upload to YouTube with the logo, you will need to decode the video, embed the image onto every frame, and encode again. Doing this manually would be difficult, so I recommend using something like ffmpeg. FFmpeg contains a bunch of useful libraries and functions for multimedia data handling like this. Here is a link to an Android wrapper for FFmpeg. I have used ffmpeg alot in the past and the man page is pretty helpful, but I have not tried it on Android.

Transforming images and mp3 files into a video file on android

I am thinking to start the development of a new project and I have some ideas in mind, but I am not sure how much is doable in android.
The steps of the app would be:
The user selects a set of images from Gallery
The user selects an audio file from external storage
I combine the images and the sound (each image is displayed for a timeframe) into a movie file that can be exported to YouTube
From my research I wasn't able to find any way to create the movie. All the answers contained links to android NDK and external codecs.
So my question is: which would be the easiest way of making this on android?
Okay, your idea is feasible. You need to have Ffmpeg compiled for android. First have a look for it at Stack link.Then decide yourselves as per need.
After you have Ffmpeg compiled for android, you can just search and extract/add audio as per your needs. To give a a start have a look at this and FFmpeg Docs Guide/Official Example.
To make video from images have a look at Ffmpeg official example. You can find plenty of these on google.
After having all these things on your hand, you are ready for your project. I would suggest to try and familiarize yourself for Ffmpeg on Windows/Linux as per your need first.
Hope this would help.
Cheers.:)

Categories

Resources