How to Use FFMPEG Library | Merge Audio and Video in Android Studio Using FFMPEG Library | CODECTRON

Опубликовано: 04 Март 2026
на канале: CODECTRON
10,400
91

Hello Guys
Here Some Code Link
implementation 'com.arthenica:mobile-ffmpeg-full:4.4'

Code


package com.example.ffmpeg;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;

import com.arthenica.mobileffmpeg.ExecuteCallback;
import com.arthenica.mobileffmpeg.FFmpeg;
import com.arthenica.mobileffmpeg.FFmpegExecution;

public class MainActivity extends AppCompatActivity {
FFmpeg fFmpeg;
@Override
protected void onCreate( Bundle savedInstanceState ) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void Merge( View view ) {
String[] c = {"-i", Environment.getExternalStorageDirectory().getPath()
"/Download/Mp4.mp4"
, "-i", Environment.getExternalStorageDirectory().getPath()
"/Download/Download unavailable-480p.m4a"
, "-c:v", "copy", "-c:a", "aac", "-map", "0:v:0", "-map", "1:a:0", "-shortest",
Environment.getExternalStorageDirectory().getPath()
"/Download/2Merge Video.mp4" };
MergeVideo(c);
}

private void MergeVideo(String[] co){
FFmpeg.executeAsync(co, new ExecuteCallback() {
@Override
public void apply( long executionId, int returnCode ) {
Log.d("hello" , "return " + returnCode);
Log.d("hello" , "executionID " + executionId);
Log.d("hello" , "FFMPEG " + new FFmpegExecution(executionId,co));

}
});
}
}


In this Video I going to show you how to use FFMPEG Library to merge
Audio and Video File In Android studio.

IF this video is helpful for you then please "SUBSCRIBE" My Channel
for get awesome videos.


Thanks For Wathing.


Ignore these tags
ffmpeg in android studio
video editor in android studio
ffmpeg library in android
biblioteca ffmpeg en android
android studio,integrate ffmpeg in android,video processing in android
ffmpeg library
biblioteca ffmpeg
ffmpeg tutorial
data structure
مكتبة ffmpeg في الروبوت,مكتبة ffmpeg
coding
algorithms