The FfmpegKit Extension is here to bring powerful media processing capabilities to your MIT App Inventor projects. Designed for ease of use and packed with advanced features, this free and open-source extension allows you to integrate FFmpeg into your apps effortlessly.
Whether you want to handle video compression, audio processing, media conversion, or work with advanced FFmpeg commands, this extension has you covered!
Latest Version: 1
Key Features
-
SAF Uri Conversion: Effortlessly read and write files using SAF paths.
GetSafParameterForRead
: Convert SAF Uri into a readable path.GetSafParameterForWrite
: Convert SAF Uri into a writable path.GetSafParameter
: Flexible conversion with custom open modes.
-
Media Processing Commands:
Execute
: Run FFmpeg commands synchronously.ExecuteAsync
: Execute commands asynchronously with progress monitoring.
-
Native Library Support:
LoadLibraries
: Load native FFmpeg libraries from assets, files, or URLs.
-
FFmpeg Version Info: Access the FFmpeg version via the
FFmpegVersion
property. -
Event Handlers for Asynchronous Execution:
GotNewLog
: Captures logs during async execution.GotNewStatistics
: Provides live statistics for ongoing processes.CommandSuccess
,CommandFailed
, andCommandCancelled
for command status updates.LibrariesLoaded
: Confirms successful library loading.
-
Comprehensive Error Handling: Receive detailed error messages when issues occur.
Blocks
Documentation
Methods and Properties
Hereβs a detailed list of available methods and properties:
Methods
-
GetSafParameterForRead(safUri: text): text
β Convert SAF Uri to a readable path. -
GetSafParameterForWrite(safUri: text): text
β Convert SAF Uri to a writable path. -
GetSafParameter(safUri: text, openMode: text): text
β Convert SAF Uri for read/write. -
LoadLibraries(zipPath: text)
β Load native libraries from a zip file. -
ExecuteMpeg(command: text)
β Execute an FFmpeg command. -
ExecuteMpegAsync(command: text)
β Execute an FFmpeg command asynchronously. -
ExecuteProbe(command: text)
β Execute an FFprobe command. -
ExecuteProbeAsync(command: text)
β Execute an FFprobe command asynchronously.
Properties
FFmpegVersion (read-only)
β Retrieve the current FFmpeg version.
Events
-
GotNewLog(sessionId: number, message: text)
β Triggered on new log entry during async execution. -
GotNewStatistics(sessionId: number, statistics: text)
β Provides statistics during async execution. -
CommandSuccess(async: boolean, isProbe: boolean, isMediaInformation: boolean, output: text)
β Triggered on successful command execution. -
CommandCancelled(async: boolean, output: text)
β Triggered when a command is canceled. -
CommandFailed(async: boolean, output: text)
β Triggered on command failure. -
ErrorOccurred(errorMsg: text)
β Triggered when an error occurs. -
LibrariesLoaded()
β Triggered when native libraries are loaded successfully.
Usage Examples
First load native libraries from assets, file path or url.
Sample url: https://exp.sunnythedeveloper.in/ffmpeg.zip
(It doesn't contain binaries for all archs)
Only then you'll be able to use extension blocks.
Once libraries have been loaded, you can execute mpeg and probe commands synchronously as well as asynchronously.
Please refer to ffmpeg documentation to learn more about commands.
Source code and Aix
Download Aix:
com.sunny.ffmpeg.aix (110.0 KB)
This extension is open source! Explore the code or contribute at Github repo.
You will find aix there as well.
If you find this extension useful and want to support its development, consider donating. Your contributions help me continue creating free and open-source extensions.
PayPal: PayPal.Me
Buy me a coffee: https://buymeacoffee.com/vknow360
UPI: vknow360@apl
Important Notice
This extension uses FFmpegKit, which is distributed under its own license terms. It is the user's responsibility to ensure compliance with the FFmpegKit license when using this extension in their projects.
If you are using this extension in a private project, there is no need to worry about licensing. However, for public or commercial use, please review and adhere to the FFmpeg licensing terms and FFmpegKit licensing terms.