SimformSolutionsPvtLtd / SSffmpegVideoOperation

This is a library of FFmpeg for android... 📸 🎞 🚑
Apache License 2.0
354 stars 85 forks source link

Run multiple commands #58

Open MohammadRezaei92 opened 5 months ago

MohammadRezaei92 commented 5 months ago

I want to run multiple command with 1 execute command. Here is my code:

val queries = arrayListOf<String>()
        imagePaths.forEachIndexed { index, path ->
            val query: Array<String> = FFmpegQueryExtension().mergeImageAndAudio(
                path,
                audioPaths[index],
                outputs[index]
            )
            queries.addAll(query)
        }

        CallBackOfQuery().callQuery(queries.toTypedArray(), object : FFmpegCallBack {
            override fun statisticsProcess(statistics: Statistics) {}
            override fun process(logMessage: LogMessage) {}
            override fun success() {
                onSuccess(outputs)
            }

            override fun cancel() {}
            override fun failed() {
                onError()
            }
        })

And here is the queries output:

-y
-loop
1
-i
IMAGE#1PATH
-i
AUDIO#1PATH
-shortest
-c:a
copy
-preset
ultrafast
VIDEO#1PATH
-y
-loop
1
-i
IMAGE#2PATH
-i
AUDIO#2PATH
-shortest
-c:a
copy
-preset
ultrafast
VIDEO#2PATH
-y
-loop
1
-i
IMAGE#3PATH
-i
AUDIO#3PATH
-shortest
-c:a
copy
-preset
ultrafast
VIDEO#3PATH

I got 3 videos as output but they are the same as each other (all 3 videos got image#1 and audio#1 paths)