current stand: trying to improve concatenation of file

This commit is contained in:
Myzel394 2023-11-29 19:02:32 +01:00
parent 1be3912812
commit 0d618380fa
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B
3 changed files with 6 additions and 4 deletions

View File

@ -119,7 +119,7 @@ dependencies {
annotationProcessor 'com.google.dagger:hilt-compiler:2.46.1'
implementation "androidx.hilt:hilt-navigation-compose:1.1.0"
implementation 'com.arthenica:ffmpeg-kit-min-gpl:5.1'
implementation 'com.arthenica:ffmpeg-kit-full-gpl:5.1'
implementation "androidx.datastore:datastore-preferences:1.0.0"

View File

@ -7,6 +7,7 @@ import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import com.arthenica.ffmpegkit.FFmpegKitConfig
import android.os.ParcelFileDescriptor
import android.util.Log
import kotlinx.coroutines.CompletableDeferred
import java.io.FileDescriptor
import kotlin.reflect.KFunction3
@ -129,6 +130,7 @@ abstract class BatchesFolder(
val filePaths = getBatchesForFFmpeg()
for (parameter in ffmpegParameters) {
Log.i("Concatenation", "Trying parameter $parameter")
onNextParameterTry(parameter)
try {

View File

@ -49,9 +49,9 @@ class MediaConverter {
}
private fun createTempFile(content: String): File {
val name = UUID.randomUUID().toString()
val id = UUID.randomUUID().toString()
return File.createTempFile("temp-$name", ".txt").apply {
return File.createTempFile(".temp-ffmpeg-files-$id", ".txt").apply {
writeText(content)
}
}
@ -63,7 +63,7 @@ class MediaConverter {
): CompletableDeferred<Unit> {
val completer = CompletableDeferred<Unit>()
val listFile = createTempFile(inputFiles.joinToString("\n", prefix = "file "))
val listFile = createTempFile(inputFiles.joinToString("\n") { "file '$it'" })
val command =
" -f concat" +