In my app I have a requirement to create a video from the screen activities programatically. (ie: I am running some animations for some time I need to convert these animations to a video, like video demos.)
I have been searching for this for the last week, but I haven't found any solution. I don't know whether it is possible in Android or not. If it is, please tell me the way or suggest me some links.
If you want to capture the screenshots from "within your activity", it is possible. Follow this post
Having grabbed the screenshoton a bitmap, you need to encode the frames to a video yourself.
Captured bitmap --> JNI (Native-bitmap) --> feed input buffer to a native encoder (ffmpeg) --> save to file
This project will meet your request Android-MJPEG-Video-Capture-FFMPEG
It is just to convert jpegs into a movie file by ffmpeg bin
Related
i want to build a video editor like this app Link
my problem is that should i use ffmpeg or any other similar library to encode the videos to edit and then to decode them
or should i use completely different approach to edit the videos.
any help will be appreciated
Why not make a list of your proposed features then check if FFmpeg can do them? That will answer your own question.
You can use FFmpeg to decode various formats to raw data like pixels (for image) and PCM (for audio) then use the audio programming skills or pixel manipulation skills you already have to modify the data. If you have no skills then you're limited to making a user-interface for FFmpeg, aren't you?
For example : If a user moves the slider to adjust image (video frame) brightness is your code using a for loop to adjust each pixel values or maybe you're using a colorMatrix? How will you show live preview since FFmpeg must first encode the entire video with new brightness. This information is missing from your question.
Then use FFmpeg again to re-encode to output format (some formats like MPEG require a paid license to encode data in its format by any "paid-for" software so check your rights as Android developer, maybe Google covered that step for you).
I'm creating an Android app that makes use of OpenCV to implement augmented reality. One of the needed features is that it saves the processed video. I can't seem to find any sample code on real-time saving while using OpenCV.
If the above scenario isn't possible, another option is to save the video first and have it post-processed by OpenCV and saved back as a new file. But I can't find any sample code for this either.
Could someone be kind enough to point me to either direction, or give me an alternative? It's ok if the alternative doesn't use OpenCV.
Typical opencv flow is, you receive frames from camera, convert to RGB format, perform matrix operations then return to activity to display in View. You can actually store the modified frames as images somewhere in sdcard and use jcodec to create your mp4 out of your images. See Android make animated video from list of images.
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.
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
I have a small application that stream pictures from a device using android. I'm able to take pictures and save into sdcard and now I have been willing to do some video recording with that. I have done it using IOS: I save the pictures into an array and for each pictures, I create a mjpeg video with these combined pictures.
I have thought of using pure java to do so, but most of the import libraries cannot be supported in Android.
I have tried to use this: https://github.com/lessthanoptimal/BoofCV/blob/master/main/io/src/boofcv/io/video/CreateMJpeg.java
But it cannot be played for some unknown reason.
I'm out of ideas. Please help me.
Thank you
You can use MJPEGGenerator.java to create an AVI from a set of jpg images
This is example of using MJPEGGenerator in russian language. Use translate.google.com to understand.