Skip to content

Instantly share code, notes, and snippets.

@isfaaghyth
Created March 4, 2019 09:04
Show Gist options
  • Save isfaaghyth/b7210ec2af76562975ac0524fb05fb08 to your computer and use it in GitHub Desktop.
Save isfaaghyth/b7210ec2af76562975ac0524fb05fb08 to your computer and use it in GitHub Desktop.
fun ffmegCommand(cropSize: Int?, sourceFile: String, resultFile: String): Array<String> {
return arrayOf(
"-i",
sourceFile,
"-filter:v",
"crop=$cropSize:$cropSize",
"-codec:v",
"libx264",
"-profile:v",
"high",
"-threads",
"5",
"-preset",
"ultrafast",
"-strict",
"-2",
"-c:a",
"copy",
resultFile
)
}
//val resultFile = FileUtils.videoPath(FileUtils.RESULT_DIR).absolutePath
//val query = VideoUtils.ffmegCommand(
// cropSize = cameraView.videoSize?.width,
// sourceFile = result.file.absolutePath,
// resultFile = resultFile
//)
//var dialog: ProgressDialog?= null //testing purpose
//VideoUtils.convertToSquare(ffmeg, query, {
// dialog = indeterminateProgressDialog(
// message = "Please wait a bit…") //testing purpose
//}, { success -> if (success) {
// dialog?.dismiss() //testing purpose
// videoCallback.onVideoTaken(resultFile)
// } else {
// dialog?.dismiss()
// }
//})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment