This repository has been archived by the owner on Jan 6, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 820
Android
Taner Sener edited this page Sep 5, 2018
·
26 revisions
-
Add MobileFFmpeg dependency from
jcenter()
dependencies {` implementation 'com.arthenica:mobile-ffmpeg-full:2.1' }
-
Execute commands.
import com.arthenica.mobileffmpeg.FFmpeg; int rc = FFmpeg.execute("-i file1.mp4 -c:v mpeg4 file2.mp4"); if (rc == RETURN_CODE_SUCCESS) { Log.i(Config.TAG, "Command execution completed successfully."); } else if (rc == RETURN_CODE_CANCEL) { Log.i(Config.TAG, "Command execution cancelled by user."); } else { Log.i(Config.TAG, String.format("Command execution failed with rc=%d.", rc)); }
-
Stop an ongoing operation.
FFmpeg.cancel();
-
Enable log callback.
Config.enableLogCallback(new LogCallback() { public void apply(LogMessage message) { Log.d(Config.TAG, message.getText()); } });
-
Enable statistics callback.
Config.enableStatisticsCallback(new StatisticsCallback() { public void apply(Statistics newStatistics) { Log.d(Config.TAG, String.format("frame: %d, time: %d", newStatistics.getVideoFrameNumber(), newStatistics.getTime())); } });
-
Set log level.
Config.setLogLevel(Level.AV_LOG_FATAL);
-
Register custom fonts directory.
Config.setFontDirectory(this, "fonts", Collections.EMPTY_MAP);
Copyright (c) 2018-2021 MobileFFmpeg