SSffmpegVideoOperation
SSffmpegVideoOperation copied to clipboard
Compress Bad Quality
I followed the sample project for query compress video, but the video result is bad, I want to change the query setup so that the video can be better, but I don't understand the query setup, is there any documentation for the query or example of query setup so that the video is better
I used the query from the sample project in Class FFmpegQueryExtension
fun compressor(inputVideo: String, width: Int?, height: Int?, outputVideo: String): Array<String> {
Common.getFrameRate(inputVideo)
val inputs: ArrayList<String> = ArrayList()
inputs.apply {
add("-y")
add("-i")
add(inputVideo)
add("-s")
add("${width}x${height}")
add("-r")
add("${if (FRAME_RATE >= 10) FRAME_RATE - 5 else FRAME_RATE}")
add("-vcodec")
add("mpeg4")
add("-b:v")
add("150k")
add("-b:a")
add("48000")
add("-ac")
add("2")
add("-ar")
add("22050")
add("-preset")
add("ultrafast")
add(outputVideo)
}
return inputs.toArray(arrayOfNulls<String>(inputs.size))
}
Thanks
@devluckman you can find everything in the real library documenttion they have used: https://github.com/tanersener/mobile-ffmpeg/blob/7a9c62f5563bff68da43d07e3286b5d8db50d53f/src/kvazaar/README.md?plain=1#L67