My application want to read each frame from a movie file and used to other.
How can I do it?
I don't know that there's a way to do this using the built-in decoders (but would be glad to hear of it if there is). You might have to make something based on modifications to the alternative software decoder included in the android sources, or an external alternative such as ffmpeg or mplayer.
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 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.:)
I'd like to write an app that merges multiple images into a movie on Android. JMF has a basic implementation (JpegImagesToMovie). But, JMF isn't supported on Dalvik.
Is there an alternative library that I can use for this ? Or if there is no library available, does anyone have any pointers for what I need to research to implement myself.
Rgds, Kevin.
I'm not aware of any pure-Java video encoders, and the built-in video encoder in Android appears to be limited to capturing video from the camera alone, rather than a custom input source.
You could look at writing a multi-part JPEG (quite rare but well supported) writer, or even an MJPEG (used by many digicams) encoder.
Hey guys, I'm looking into creating an application that requires a video file taken on the mobile phone, open it and allow the user to cut the video using two sliders, one for IN(the beginning) and the other for out(end of the clip you want), this will then create a new file and my app will use it then.
Does this sound feasible? Where should I start looking in order to do this quite simple concept? Does anyone have any ideas?
Thanks
Android SDK has no video-editing (not even cropping) capabilities. So you'd need to write your own.
To do this you'd need to know 3gpp video/audio file format and also a way to decode the file (for showing in the UI).
This is by no means a trivial task.
Short version: What is the best way to get data encoded in an MP3 (and ideally in an
AAC/Ogg/WMA) into a Java array or ByteBuffer that I can then
manipulate?
I'm putting together a program that has slowing down and speeding up
sound files as one of its features. This works fine for WAV files,
which are a header plus the exact binary data that needs to be sent to
the speaker, and now I need to implement it for MP3 (ideally, this
would also support AAC, Ogg, and WMA, but since those are less popular
formats this is not required). Android does not expose an interface
to decode the MP3 without playing it, so I need to create that
interface.
Three options present themselves, though I'm open to others:
1) Write my own decoder. I already have a functional frame detector
that I was hoping to use for option (3), and now should only need to
implement the Huffman decoding tables.
2) Use JLayer, or an equivalent Java library, to handle the
decoding. I'm not entirely clear on what the license ramifications
are here.
3) Connect to the libmedia library/MediaPlayerService. This is what
SoundPool does, and the amount of use of that service make me believe
that while it's officially unstable, that implementation isn't going
anywhere. This means writing JNI code to connect to the service, but
I'm finding that that's a deep rabbit hole. At the surface, I'm
having trouble with the sp<> template.
I did that with libmad and the NDK. JLayer is way to slow and the media framework is a moving target. You can find info and source code at http://apistudios.com/hosted/marzec/badlogic/wordpress/?p=231
I have not tried it, but mp3transform is LGPL.