mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-20 08:07:09 +02:00
feat: optimize ffmpeg (#906)
This commit is contained in:
parent
7acfe42fc6
commit
638dba00cc
@ -115,7 +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 += "-hwaccel mediacodec" //Use hwaccel If Available
|
||||
this += "-y"
|
||||
this += "-threads" to ffmpegOptions.threads.get().toString()
|
||||
}
|
||||
@ -128,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"
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user