Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compress Bad Quality #53

Open
devluckman opened this issue Jun 21, 2023 · 1 comment
Open

Compress Bad Quality #53

devluckman opened this issue Jun 21, 2023 · 1 comment

Comments

@devluckman
Copy link

devluckman commented Jun 21, 2023

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

@mnawaf
Copy link

mnawaf commented Mar 5, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants