feat: ffmpeg hardware acceleration (#899)

* Bump threads to 4 (20-30% CPU Increase)
+ Add -hwaccel auto flag
This commit is contained in:
TheVisual 2024-04-14 08:54:58 -05:00 committed by GitHub
parent 55d76d23a6
commit 7af0e1e558
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -115,6 +115,7 @@ class FFMpegProcessor(
// load ffmpeg native sync to avoid native crash
synchronized(this) { FFmpegKit.listSessions() }
val globalArguments = ArgumentList().apply {
this += "-hwaccel auto" //Use hwaccel If Available
this += "-y"
this += "-threads" to ffmpegOptions.threads.get().toString()
}

View File

@ -6,7 +6,7 @@ import me.rhunk.snapenhance.common.config.FeatureNotice
class DownloaderConfig : ConfigContainer() {
inner class FFMpegOptions : ConfigContainer() {
val threads = integer("threads", 1)
val threads = integer("threads", 4) // Bump Default Value to 4 Tested on Pixel 5 (Qualcomm Snapdragon 765G) Had no lag
val preset = unique("preset", "ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow") {
addFlags(ConfigFlag.NO_TRANSLATE)
}