Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very long processing time . . . 10 times longer than the other lib. #161

Open
sench93 opened this issue Nov 7, 2016 · 22 comments
Open

Very long processing time . . . 10 times longer than the other lib. #161

sench93 opened this issue Nov 7, 2016 · 22 comments

Comments

@sench93
Copy link

sench93 commented Nov 7, 2016

I have one command to create video from images and attach mp3 . 209 images, 25 fps. Total 9 sec video. The library takes 50 seconds to create the video on HTC One M7.

http://androidwarzone.blogspot.am/2011/12/ffmpeg4android.html

The library in the link mentioned above is also using ffmpeg and processing time is only 5-6 seconds. Somehow they put 400 $ licence on their library.

I want to know what's the problem with your library, because in core you are using same ffmpeg commands. Is there anything that i did wrong ?

I am using your sample app.
My command is

-start_number 1 -y -r 25 -i /storage/emulated/0/Tickle/temp/files/sht%d.jpg -i /storage/emulated/0/Tickle/files/mp3/weightlifting_audio.mp3 -strict experimental -ar 44100 -ac 2 -ab 256k -b 2097152 -ar 22050 -vcodec mpeg4 -b 2097152 -s 640x385 /storage/emulated/0/Tickle/files/mp4/weightlifting.mp4"

Image sizes are 640x385 jpegs. Video output size is about 2 megabytes. Frame quantity is 209. Fps is 25.

Is there anything that i am doing wrong or it's because of your library ?

@stefanodefaria
Copy link

I'm also having peformance issues with this lib.

@ruha9005
Copy link

ruha9005 commented Nov 8, 2016

@sench93 Have you tried to add -preset ultrafast? In an article that you provided, there is a section "Performance Tuning", which are some details on which we can assume that maybe used some other global presets. It may be wrong, but it can be useful.

@sench93
Copy link
Author

sench93 commented Nov 8, 2016

@ruha9005 -preset ultrafast is for h264 encoding. I am using the most simple mpeg4`.

@sench93
Copy link
Author

sench93 commented Nov 8, 2016

While creating the video, program is using only 3.4 % of CPU . . . -threads X is not helping. Result is the same. What's the point of using only 3.4 percent of CPU during video creation and encoding ? Does anybody knows how make the library to use more CPU power and reach faster results ?

@stefanodefaria
Copy link

I've got something similar: using x264 with preset ultrafast, it gets only 20% CPU usage and 45 threads.

@maxglu
Copy link

maxglu commented Dec 19, 2016

This is great library, but I have same isuue with low performance and -threads X or -preset ultrafast parameters not working. In log on Android studio i dont see any usages of cpu or gpu. How i can increase cpu using?

@sench93
Copy link
Author

sench93 commented Dec 22, 2016

Everyone here has that issue . . . but it looks like developers of library don't care :)

@matteinn
Copy link

+1

6 similar comments
@douglasfeitosa
Copy link

+1

@palmithor
Copy link

+1

@olafurr
Copy link

olafurr commented Dec 28, 2016

+1

@ruha9005
Copy link

+1

@fxhereng
Copy link

+1

@jossydeleon
Copy link

+1

@jossydeleon
Copy link

Converting a .M4A music file of 4 minutes to mp3 is taking 3 minutes and the cellphone gets hot

@AhhhhDong
Copy link

This lib is just a simple , the author has other two lib but not free , lol.

@Aditya94A
Copy link

Aditya94A commented Apr 13, 2017

+100

Joining two mp3s...

-i A.mp3 -i B.mp3 -filter_complex concat=n=2:v=0:a=1 C.mp3

takes all of 5 seconds on my computer, but with this library it takes more time than the length of the files I'm combining in the first place. Same with all the other commands, converting formats, cropping videos/audio etc. @zoedevelopers Yes! I too noticed my phone getting hot.

Is there any alternative for this library? All the resources I've looked at are outdated or long defunct. Has someone used the link mentioned in the first comment? Is it any better? (It seems a bit shady at first sight..)

@wjd19941224 what other libs? Can you please share the link?

@hiteshsondhi88 any thoughts?

@RafagSL
Copy link

RafagSL commented Jul 26, 2017

+1

2 similar comments
@daufinsyd
Copy link

+1

@erleizh
Copy link

erleizh commented Jan 2, 2018

+1

@mwshubham
Copy link

Any community updates or comments ?
@sench93

@Aditya94A
Copy link

Aditya94A commented Aug 6, 2018

Yes @mwshubham. Use bravobit/FFmpeg-Android. It's a lot better and up-to-date, there are some slight API changes but they're all for the better.

As for the performance, it still sucks everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests