FfmpegKit: Free and open-source extension for using FFmpeg

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, and CommandCancelled for command status updates.
    • LibrariesLoaded: Confirms successful library loading.
  • Comprehensive Error Handling: Receive detailed error messages when issues occur.

Blocks

image

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.

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 :warning:

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.

4 Likes

Really i don’t believe that ffmpeg extension free and open source, that is so cool br0 keep on :smiling_face_with_three_hearts::heart:

This link not work, any way i downloaded it from github link: https://github.com/vknow360/FfmpegKit/raw/refs/heads/master/out/com.sunny.ffmpeg.aix

Can you please post ffmpeg.zip file her because this link not working for me: https://sunnythedeveloper.in/ffmpeg.zip

Check GitHub repository.

1 Like