ffmpeg-android-java
ffmpeg-android-java copied to clipboard
How to speed up the video compression?
Hi ,
I am using following command to compress video in android . but it takes more time. e.g for 1 min video it takes 50sec to compress.
-y -i "+mInputPath+" -vf -s 640x480 -threads 5 -preset ultrafast -strict -2 "+mOutputPath.getAbsolutePath();
Does anyone know how to increase speed?
I'd love to know this too. I think though for the line you pasted doing -threads 5 might make it slower since -threads is default auto. If it can actually use more threads, you would be limiting it.
http://ffmpeg.org/ffmpeg-all.html
@romedtino .. Thank you for the information.
Still cannot solve this .. can anyone help me out?
If you can use libx264, use this command.
-y -i "+mInputPath+" -c:v libx264 -preset ultrafast -tune fastdecode -vf -s 640x480 -threads 5 -strict -2 "+mOutputPath.getAbsolutePath();
-preset ultrafast
maybe will not work without libx264. libx264 has the preset ultrafast.
To using libx264, you must build libx264 and rebuild ffmpeg.(as --enable-libx264
)
In my case, when using x264 ultrafast, performance was about 3-4 times faster in reverse filter.
@novawoo-kr I'm facing with same problem. Can you help me to rebuild ffmpeg? Do you have any tutorials ?
i am facing the same problem: video compression taking so much time to compress video, i am using this command - String cmd1[] = new String[]{"-y", "-i", sourcePath, "-strict", "experimental", "-r", "25", "-vcodec", "mpeg4", "-c:v", "libx264", "-preset", "ultrafast", "-b", "2097152", "-ab", "48000", "-ac", "2", "-ar", "48000", destinationPath}; how could i speed up this?
minSdkVersion 19 targetSdkVersion 28
What should be the configuration for the Pie version
Any Luck Anyone I am Facing similar issue