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

Cannot merge videos #261

Open
pvnam198 opened this issue Apr 19, 2021 · 0 comments
Open

Cannot merge videos #261

pvnam198 opened this issue Apr 19, 2021 · 0 comments

Comments

@pvnam198
Copy link

  • I am using the below code to merge videos

      val commandList = ArrayList<String>()
    
      val contentFilterComplex = StringBuilder()
    
      inputFiles.forEachIndexed { index, file ->
          commandList.add("-i")
          commandList.add(file.absolutePath)
          contentFilterComplex.append("[$index:v][$index:a]")
      }
      contentFilterComplex.append("concat=n=${inputFiles.size}:v=1:a=1[v][a]")
      commandList.add("-filter_complex")
      commandList.add(contentFilterComplex.toString())
      commandList.add("-map")
      commandList.add("[v]")
      commandList.add("-map")
      commandList.add("[a]")
      commandList.add(outputFile.absolutePath)
    
      val arr = Array(commandList.size) { i -> commandList[i] }
    
      FFmpegCmd.exec(
          arr,
          duration * Util.MICROSECOND,
          object : OnEditorListener {
              override fun onSuccess(): Boolean {
                  onExecCmdListener.onSuccess(outputFile)
                  return false
              }
    
              override fun onFailure() {
                  onExecCmdListener.onFailure()
              }
    
              override fun onProgress(progress: Float) {
                  onExecCmdListener.onProgress(progress)
              }
          })
    
  • Command log: -i input_1.mp4 -i input_2.mp4 -filter_complex [0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a] -map [v] -map [a] my_output.mp4

  • Error: E/AVLOG: Invalid file index 1 in filtergraph description [0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a].

  • Pls help me

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

1 participant