ffmpegandroidlibrary
ffmpegandroidlibrary copied to clipboard
Merge audio and video
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.
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.
Both not working. And when I try to changing video codec app crashed
Please post some logs. It will help to identify problems. Following are some of my guesses.
- It could be that ffmpeg lib is not installed properly.
- Files are not in specified path.
- Code needs to run in background process.
Logs would help to identify problem.
It is library problem. Library does not support libx264 correctly.
2018년 9월 8일 (토) 오후 12:20, rishirane [email protected]님이 작성:
Please post some logs. It will help to identify problems. Following are some of my guesses.
- It could be that ffmpeg lib is not installed properly.
- Files are not in specified path.
- Code needs to run in background process.
Logs would help to identify problem.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/madhavanmalolan/ffmpegandroidlibrary/issues/32#issuecomment-419608820, or mute the thread https://github.com/notifications/unsubscribe-auth/AMeda2hkc0MLvw_3iPF0qw_FywlufSsvks5uYzeGgaJpZM4Wcq9e .