ffmpegandroidlibrary icon indicating copy to clipboard operation
ffmpegandroidlibrary copied to clipboard

Merge audio and video

Open choijuho78 opened this issue 6 years ago • 4 comments

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.

choijuho78 avatar Sep 06 '18 10:09 choijuho78

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.

rishirane avatar Sep 07 '18 07:09 rishirane

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

choijuho78 avatar Sep 08 '18 02:09 choijuho78

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.

rishirane avatar Sep 08 '18 03:09 rishirane

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.

  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.

— 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 .

choijuho78 avatar Sep 08 '18 04:09 choijuho78