flutter_ffmpeg_utils 1.0.3
flutter_ffmpeg_utils: ^1.0.3 copied to clipboard
A Flutter plugin to execute FFmpeg commands on Android and iOS.
flutter_ffmpeg_utils #
A Flutter plugin to execute raw FFmpeg commands on Android and iOS.
π Features #
- Run raw FFmpeg commands directly on Android and iOS.
- Supports complex media operations such as trimming, merging, and transcoding.
π¦ Installation #
Add the following to your pubspec.yaml
:
dependencies:
ffmpeg_utils: ^1.0.0
Run:
flutter pub get
β‘οΈ Usage #
import 'package:ffmpeg_utils/ffmpeg_utils.dart';
final ffmpegUtils = FfmpegUtils();
// Run a raw FFmpeg command
await ffmpegUtils.executeFFmpeg(['-i', 'input.mp4', '-vf', 'scale=640:480', 'output.mp4']);
π Examples #
1. Compress a Video #
await ffmpegUtils.executeFFmpeg(['-i', 'input.mp4', '-vcodec', 'libx264', '-crf', '28', 'output.mp4']);
2. Trim a Video #
await ffmpegUtils.executeFFmpeg(['-i', 'input.mp4', '-ss', '00:00:10', '-to', '00:00:20', '-c', 'copy', 'output.mp4']);
3. Extract Audio from Video #
await ffmpegUtils.executeFFmpeg(['-i', 'input.mp4', '-vn', '-acodec', 'libmp3lame', 'output.mp3']);
π― Supported Platforms #
- β Android
- β iOS
π License #
MIT License. See LICENSE
for details.