diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/download/FFMpegProcessor.kt b/app/src/main/kotlin/me/rhunk/snapenhance/download/FFMpegProcessor.kt index 7e76870ec..104dec7bd 100644 --- a/app/src/main/kotlin/me/rhunk/snapenhance/download/FFMpegProcessor.kt +++ b/app/src/main/kotlin/me/rhunk/snapenhance/download/FFMpegProcessor.kt @@ -115,6 +115,7 @@ class FFMpegProcessor( // load ffmpeg native sync to avoid native crash synchronized(this) { FFmpegKit.listSessions() } val globalArguments = ArgumentList().apply { + this += "-hwaccel mediacodec" //Use hwaccel If Available this += "-y" this += "-threads" to ffmpegOptions.threads.get().toString() } @@ -127,7 +128,7 @@ class FFMpegProcessor( val outputArguments = ArgumentList().apply { this += "-preset" to (ffmpegOptions.preset.getNullable() ?: "ultrafast") - this += "-c:v" to (ffmpegOptions.customVideoCodec.get().takeIf { it.isNotEmpty() } ?: "libx264") + this += "-c:v" to (ffmpegOptions.customVideoCodec.get().takeIf { it.isNotEmpty() } ?: "h264_mediacodec") this += "-c:a" to (ffmpegOptions.customAudioCodec.get().takeIf { it.isNotEmpty() } ?: "copy") this += "-crf" to ffmpegOptions.constantRateFactor.get().let { "\"$it\"" } this += "-b:v" to ffmpegOptions.videoBitrate.get().toString() + "K" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d21b87ddd..8666115e8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,7 +18,7 @@ recyclerview = "1.3.2" compose-bom = "2024.02.01" bcprov-jdk18on = "1.77" dexlib2 = "3.0.5" -ffmpeg-kit = "5.1.LTS" # DO NOT UPDATE FFMPEG-KIT TO "5.1" it breaks stuff :3 +ffmpeg-kit = "6.0-2.LTS" gson = "2.10.1" junit = "5.10.2" material3 = "1.2.0" @@ -61,4 +61,4 @@ androidLibrary = { id = "com.android.library", version.ref = "agp" } kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -[bundles] +[bundles] \ No newline at end of file