Skip to content

Compress Bad Quality #53

Description

@devluckman

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions