Skip to content

Commit

Permalink
feat: ffmpeg hardware acceleration (#899)
Browse files Browse the repository at this point in the history
* Bump threads to 4 (20-30% CPU Increase)
+ Add -hwaccel auto flag
  • Loading branch information
VendorAttestation authored Apr 14, 2024
1 parent 55d76d2 commit 7af0e1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 7af0e1e

Please sign in to comment.