I need to make movie (MP4) using sequence of bitmaps. I am using Jcodec it's working fine but if i share the video which one is builded using Jcodec, it's not supported by whatsapp. So i plan to make the movie from ffmpeg (Prebuilt libraries https://github.com/tanersener/mobile-ffmpeg) it's working fine. But my universal apk size was increased up to (50mb). I just need to make movie from sequance of images so i don't need any external libraries and audio features also. So please help me someone to build the ffmpeg for only convert the sequance images to video only.
Thank you.
You can remove some packages like an opus.
probably you don't need all future.
you should change this file
Related
I'm developing an app which creates x264 videos with the following library:
com.arthenica:mobile-ffmpeg-full:4.2.2.LTS
but the result apk file is too big (~71mb), so I tried:
com.arthenica:mobile-ffmpeg-min-gpl:4.2.2.LTS
and this way, as the library downloads only a few codecs -included the ones I need- apk size was reduced to ~49mb, what is much better, but still looks too big to me, so I'd need to know if any of you know a better way to reduce apk size, because people generally refuse to download such big apps
Regarding the rest of the app (drawables, resources and so) they're well optimized, because if I remove this library and rebuild, the size of the app drops to 10mb
I was reading this question:
FFMPEG Android Library Increase Size
and user S.R suggests to compress all cpu architecture models in one archive file and extract target cpu lib based on cpu model on app's directory and load ffmpeg from there, but I really don't know how to do that.
I'm checking my app's folder structure and noticed there are this next folders regarding ffmpeg lib:
arm64-v8a => ~16mb
armeabi-v7a => ~29mb
x86 => ~17mb
x86_64 => ~21mb
But not sure if I could remove any of them, and as you can see armeabi-v7a is the largest.
As per your requirement, FFmpeg is the best option to so much of video processing task but the problem with FFmpeg is it will increase the size of the app. So I will suggest you to compile this FFMPEG library in your project, it also has many inbuilt functions like add music, add image on Video etc. It will definitely help you with your work as well as size is also very small ~11mb.
You can use Android App Bundle (aab) to reduce app size
further.
use
implementation "com.arthenica:mobile-ffmpeg-min:4.4.LTS"
according to documentation
First, I'm new in this Import thing
I've compiled latest version of ffmpeg with NDK r14b,
and managed to get some Library after compiling(like libavutil.so,libavcodec.so,libavfilter.so,etc)
Click here for pic
but im a bit confused importing it to my android project.
First, I want to make an Audio editing app that can merge several mp3 file at specific time, and adjust volume (Increase or Decrease its sound) mp3 file.
I've read about ffmpeg recently, since most people recommended to use this Library.
For merging :
-https://superuser.com/questions/1092291/merge-many-audio-files-with-specific-positions/1092346#1092346
For adjust volume :
-Decode MP3, then increase the audio volume, and then encode the new audio
What i want to ask is:
-from guardian's ffmpeg project and WritingMinds ffmpeg lib (can't post the link since i got not enough rep and this 2 are often mentioned in stackoverflow), does this 2 Libraries have what i needed? I'm a bit confused in this thing. An explanation would be a help.
-from http://ffmpeg-android.blogspot.co.id/ i cant run the ndk-build command at the last part. How should i use it?
Thank you in advance!
I want to compress video and found only one solution to use ffmpeg.
I found this Trying to use FFMPEG for android. Compiling but still not working but not able to get how he compiled it.
You could use precompiled libs from the JavaCPP Presets along with FFmpegFrameRecorder from JavaCV to compress images, as shown in the RecordActivity sample, for example.
I am working on an Android Camera Application which have capability of Image and Video capturing. Later users can annotate on the image and add watermark to Video. All went fine when drawing Annotation on Image but failed to get no solution. In iPhone there AVComposition Library to draw watermark on Videos. I don't know whether such library exists for android or not but I would like to know if someone has come across such requirement and got any solution.
Can some one guide how to get it started for composing an image on Video. Atleast adding text to the Video somewhere
In case anyone is still looking for this - ffmpeg can be used on Android to add a watermark to a video, but you do need to be aware that video processing on a power and processing limited device like a mobile may be slow and may run down battery if used extensively.
An example of the ffmpeg command to add a watermark to a video using ffmpeg, from the ffmpeg documentation is:
ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map '[out]' out.mkv
See here for the official documentation: https://ffmpeg.org/ffmpeg.html and look at '-filter_complex filtergraph (global)'
ffmpeg can be used in Android projects using one of the wrapper libraries that exist to support this. Although, ffmpeg was designed as a command line tool, this approach does work reliably in my experience.
The library below is a good example of a well supported Android ffmpeg wrapper library and it includes a sample APK so you may be able to actually try out the ffmpeg command you need with that to ensure it works before adding to your own project.
https://github.com/WritingMinds/ffmpeg-android-java
We need an Android app that can encode a folder of images to a video. I have been looking for solutions a while now, but cannot find anything good. The Android API does not support it. We are trying ffmpeg, but cannot get it to work. We need a working solution, using ffmpeg is not mandatory. A full Android Java solution is also a possibility, since this would work on all Android devices, possibly at the cost of some performance.
The app also needs to be able to add an audio track to the movie if the user chooses to do this.
Any help would be appreciated.
Kind regards,
AƤron
From the FFmpeg FAQ entry "How do I encode single pictures into movies?":
First, rename your pictures to follow a numerical sequence. For example, img1.jpg, img2.jpg, img3.jpg,... Then you may run:
ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
Adding an audio track should just involve add another input (e.g., -i audio.mp3), but could also require explicit -maping with older versions.