cropsly / ffmpeg-android-java

Android java library for FFmpeg binary compiled using https://github.com/writingminds/ffmpeg-android
http://writingminds.github.io/ffmpeg-android-java
GNU General Public License v3.0
3.33k stars 829 forks source link

command for adding audio(mp3) to mp4 #378

Open mayursancheti opened 2 years ago

mayursancheti commented 2 years ago

i tried below code but not works for adding audio.

`progressbarfilter.setVisibility(View.VISIBLE); String inputis = sharedPreferences.getString("actuallinkis", ""); String inputaudiois = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + Environment.DIRECTORY_MUSIC +"audio.mp3"; motion_destinationpath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + Environment.DIRECTORY_MOVIES + "/" + "textoutput.mp4";

            command = new String[]{"-y", "-i", inputis, "-i", inputaudiois, "-c", "copy","-shortest", motion_destinationpath};
            execFFmpegBinary(command);`

please help someone.