video_compress_native 1.1.26
video_compress_native: ^1.1.26 copied to clipboard
Flutter plugin for video compression, trimming, and re-encoding with cross-platform support.
video_compress_native #
Flutter plugin for video compression, trimming, and re-encoding with cross-platform support.
Features #
- Video Compression & Trimming: Compress video with custom resolution and trim to specific time range
- Video Trimming Only: Trim video without compression
- Video Re-encoding: Re-encode video with standard codec for compatibility ✨ NEW in v1.1.22
- Progress Monitoring: Real-time progress updates during processing
- Cross-platform: Supports both Android and iOS
- High Performance: Native implementation using Media3 (Android) and AVFoundation (iOS)
Usage #
import 'package:video_compress_native/video_compress_native.dart';
// Compress and trim video
String? result = await VideoCompressNative.compressAndTrim(
path: '/path/to/video.mp4',
startTime: 10.0,
endTime: 60.0,
resolutionHeight: 720,
);
// Trim video only
String? result = await VideoCompressNative.trimVideo(
path: '/path/to/video.mp4',
startTime: 5.0,
endTime: 30.0,
);
// Compress/re-encode video only (NEW)
String? result = await VideoCompressNative.compressVideo(
path: '/path/to/video.mp4',
);
// Monitor progress
VideoCompressNative.getProgressStream().listen((progress) {
print('Progress: ${(progress * 100).toInt()}%');
});
Requirements #
- Android: API level 21+ (Android 5.0+)
- iOS: iOS 11.0+
- Flutter: 3.3.0+