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

Merge audio and video #32

Open
choijuho78 opened this issue Sep 6, 2018 · 4 comments
Open

Merge audio and video #32

choijuho78 opened this issue Sep 6, 2018 · 4 comments

Comments

@choijuho78
Copy link

String[] cmd = new String[]{"-i",videoFile.getAbsolutePath(),"-i",audioFile.getAbsolutePath(),"-strict","experimental","-c","copy","-map","0:v","-map","1:a",file.getAbsolutePath()};
Controller.getInstance().run(cmd);

Then app terminated.
Help me please.

@rishirane
Copy link

If by merging you mean removing video-audio and adding new audio then try

String[] cmd = new String[]{"-i",videoFile.getAbsolutePath(),"-i",audioFile.getAbsolutePath(),"-strict","experimental","-c:v","copy","-c:a","aac","-map","0:v","-map","1:a",file.getAbsolutePath()};

Above command will re-encode audio; If above not working then try to re-encode video too.

String[] cmd = new String[]{"-i",videoFile.getAbsolutePath(),"-i",audioFile.getAbsolutePath(),"-strict","experimental","-c:v","libx264","-c:a","aac","-map","0:v","-map","1:a",file.getAbsolutePath()};

If both commands are not working then post some logs. It will help to identify issue.

@choijuho78
Copy link
Author

Both not working. And when I try to changing video codec app crashed

@rishirane
Copy link

Please post some logs. It will help to identify problems. Following are some of my guesses.

  1. It could be that ffmpeg lib is not installed properly.
  2. Files are not in specified path.
  3. Code needs to run in background process.

Logs would help to identify problem.

@choijuho78
Copy link
Author

choijuho78 commented Sep 8, 2018 via email

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