-
Notifications
You must be signed in to change notification settings - Fork 117
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
FFMPEG with hardware acceleration #854
Comments
Definitely possible with a flag most likely the more of the issue would be determining if your CPU supports it. We could make it a option tho. |
Build and test this #899 |
I tried building it, but couldn't figure it out because I just kept encountering errors first with the Android SDK missing, and then "Task :native:configureCMakeDebug[arm64-v8a] FAILED". Is it possible that I use the artifacts from an actions run on your pull request? Sorry, I'm not the most experienced with coding. |
Hi, I tested the snapenhance-armv8-debug artifact from the actions build, and unfortunately it doesn't seem to do anything on my Snapdragon 865 5G. Over multiple trials, the results were within margin of error when compared to the build without the -hwaccel flag. I also tried both libx264 and libx265 before and after, again, the results for both were within margin of error. I'm not exactly sure how FFMPEG's -hwaccel flag works, but I doubt that by default it would be able to detect Snapdragon or Exynos hardware acceleration capabilities. |
I tested multiple times on a less powerful CPU and saw 10-30 FPS increase |
How'd you get the debug stats to show up there? |
I don't know if it depends on how you build but i went to a public profile and clicked download all segements |
Hmm, I can't seem to get the stats to show up, no matter where I download from. Also, I don't have the option to "Download all segments", I just have "Download media". I've been doing the testing by downloading a snap that is saved in chat, it's about 4 seconds long, and has many overlays like text and a few gifs. And even just measuring by hand, starting a timer as soon as I click download, with and without the -hwaccel flag, it was within half a second of difference. |
If you didn't change the number of threads to 4 before also adding the -hwaccel flag, then your fps increase may be due to the additional 3 threads that are used. In my tests I always manually put the threads to 8. |
-hwaccel auto defaults to media codec aka androids Also snapdragon 865 is 4 years old don't expect superior performance even with the 5G slapped on it If your worried about speed i recommend buying a new phone sir OnePlus 12 No HW Accel + 1 Thread Your phone is old don't expect it to pump a file out instantly sir |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I have upgraded to FFMPEG 6 (Full support for media codec) this is as new as you can get with media codec after this there's not many more improvements possible and I'm not being rude just a 4 year old chip can't pump 170+ FPS unfortunately it just how it is. |
Well thank you very much for the latest build. File size down from 137mb to 22mb with h264_mediacodec in the same quality |
Glad to help 👍 |
Description
Most devices would be using relatively recent Qualcomm chips, which have support for hardware accelerated AVC and HEVC video encoding and decoding, via Qualcomm PDF download.
Encoding overlay merged videos with libx265 is super slow (like a whole 60 seconds slow), and libx264 is also quite slow unless you drop the quality to ultrafast and ~30 CRF, at which point the quality of the video and the file size is super unoptimised.
I'm not sure if it would be possible to achieve this, since I've only found one reference of someone else trying to do this via Reddit. But if it is possible, then it would provide a huge boost to the speed and quality, and maybe even Exynos processor hardware acceleration could be implemented, however I'm on a Qualcomm 865.
Agreement
The text was updated successfully, but these errors were encountered: