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

ARM support enhancement for ARM-v7 and ARM-v8 with libx264 #24

Open
tsoumalis opened this issue Mar 11, 2018 · 7 comments
Open

ARM support enhancement for ARM-v7 and ARM-v8 with libx264 #24

tsoumalis opened this issue Mar 11, 2018 · 7 comments

Comments

@tsoumalis
Copy link

Hello,

Using the FFMPEG executable from this project I notice in the logs that it is using "cpu capabilities: ARMv6-neon" on devices with arm v7 and v8 CPUs. This of course gives a great performance boost against "using cpu capabilities: none!" but I was wondering if there could be even more performance in case libx264 could use the full capabilities of the CPU.

Thanks in advance for your response.

@tsoumalis
Copy link
Author

An update on this: using the static builds from the official ffmpeg site actually display CPU capabilities: ARMv7-neon (and ARMv8-neon for 64 bit) with some performance increase both in x264 and especially in other operations such as mp3 operations with libmp3lame or aac sound commands. Unfortunately, these builds failed to work in Nexus 6P (despite working on every other device I have tried) and are larger in size because they contain more libraries.

So, there is definitely some more performance hidden if ffmpeg is built correctly for every architecture. In fact, armeabi (armv6) is mostly used by ancient devices so I believe that it should be built at least for arm-v7a.

@Brianvdb
Copy link
Member

Seems like a good idea to test this. I just build FFmpeg with --arch=arm --cpu=armv7-a but still getting: using cpu capabilities: ARMv6 NEON

Any idea which FFmpeg compile parameters I should use?

@tsoumalis
Copy link
Author

Maybe ffmpeg is built for armv7 but libx264 is not? Check the following for example (64 bit): https://stackoverflow.com/questions/31138836/how-to-build-libx264-64bit-library-for-android

But even without libx264 I believe that ffmpeg built for armv7 and v8 will perform faster in other operations like audio processing. The speed difference is mostly visible with the 64 bit static build from the official site.

@Aditya94A
Copy link

Any updates?

@tsoumalis
Copy link
Author

I managed to build FFmpeg with ARMv8 enhancement for 64 bit devices but the performance in video encoding/decoding has not been drastically improved. You can use the executables of my fork of this project here: https://github.com/tsoumalis/FFmpeg-Android

These builds show significant improvement though when it comes to audio processing (aac and libmp3lame encodings) and have been built to be small in size so they might lack some features.

The largest performance boost will come when FFmpeg decide to implement mediacodec hardware acceleration. I hope they do so in the near future. For now I see there is a h264_mediacodec encoder and I built these executables with this option enabled but again no performance boost has been noticed.

For now you can use -preset ultrafast -tune zerolatency -threads 0 to extract the most out of the performance in Android when using libx264 to encode.

@mwshubham
Copy link

I was hoping for a drastic change in terms of performance when using armV8. Let see when we will get the update from this repo. Thanks

@kartik1225
Copy link

any updates on this?

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

No branches or pull requests

5 participants