flutter_native_video_trimmer 1.0.5 copy "flutter_native_video_trimmer: ^1.0.5" to clipboard
flutter_native_video_trimmer: ^1.0.5 copied to clipboard

A lightweight Flutter plugin for video manipulation using pure native code (Media3 for Android and AVFoundation for iOS). Efficiently trim videos, generate thumbnails, and retrieve video information w [...]

Flutter Native Video Trimmer #

pub package License: MIT

A lightweight Flutter plugin for video manipulation that uses pure native implementations (Media3 for Android and AVFoundation for iOS). Efficiently trim videos, generate thumbnails, and retrieve video information without any FFmpeg dependency.

Why choose this plugin? #

  • 🚀 No FFmpeg Dependency: Uses platform-native video processing capabilities instead of heavy FFmpeg libraries
  • ðŸŠķ Lightweight: Smaller app size and faster processing compared to FFmpeg-based solutions
  • ⚡ïļ Native Performance: Direct use of Media3 (Android) and AVFoundation (iOS) for optimal performance
  • ðŸ“ą Memory Efficient: Processes videos without loading entire files into memory
  • 🔒 Privacy Focused: All processing happens locally on the device

âœĻ Features #

  • 📞 Video Loading: Load and process video files from any source
  • ✂ïļ Precise Trimming: Trim videos with millisecond precision
  • 🖞ïļ Thumbnail Generation: Create high-quality thumbnails with customizable size
  • â„đïļ Metadata Extraction: Get comprehensive video information
  • 🛠ïļ Native Implementation: Clean and efficient platform-specific code

ðŸ“Ķ Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_native_video_trimmer: ^1.0.5

Or install via command line:

flutter pub add flutter_native_video_trimmer

Or specify the exact version:

flutter pub add flutter_native_video_trimmer:1.0.2

Minimum Requirements #

  • Flutter: 3.0.0 or higher
  • Dart: 3.0.0 or higher
  • Android: minSdkVersion 21 (Android 5.0)
  • iOS: iOS 12.0 or higher

🚀 Usage #

Import #

import 'package:flutter_native_video_trimmer/flutter_native_video_trimmer.dart';

Initialize #

final videoTrimmer = VideoTrimmer();

Load a Video #

await videoTrimmer.loadVideo('/path/to/video.mp4');

Trim Video #

// Trim the first 5 seconds of the video
final trimmedPath = await videoTrimmer.trimVideo(
  startTimeMs: 0,     // Start time in milliseconds
  endTimeMs: 5000,    // End time in milliseconds (5 seconds)
);

Generate Thumbnail #

// Generate a thumbnail at 1 second mark
final thumbnailPath = await videoTrimmer.getVideoThumbnail(
  positionMs: 1000,   // Position in milliseconds
  quality: 100,       // Quality (0-100)
  width: 640,         // Optional width
  height: 480,        // Optional height
);

Get Video Information #

final videoInfo = await videoTrimmer.getVideoInfo();
print('Duration: ${videoInfo['duration']}');
print('Width: ${videoInfo['width']}');
print('Height: ${videoInfo['height']}');

Example #

Check the example folder for a complete sample app demonstrating all features.

ðŸ“ą Platform Support #

Platform Implementation Minimum Version Status
Android Media3 API 21 (5.0) ✅
iOS AVFoundation iOS 12.0 ✅

🛠ïļ Requirements #

Android #

  • Minimum SDK: API 21 (Android 5.0)
  • Target SDK: API 34
  • Kotlin: 1.9.0
  • AndroidX

iOS #

  • Minimum iOS: 12.0
  • Swift: 5.0
  • Xcode: Latest version

ðŸĪ Contributing #

Contributions are always welcome! Here's how you can help:

  1. 🐛 Report bugs by opening an issue
  2. ðŸ’Ą Suggest new features or improvements
  3. 📝 Improve documentation
  4. 🔧 Submit pull requests

Development Process #

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License #

This project is licensed under the MIT License - see the LICENSE file for details.

📧 Author #

iawtk2302

⭐ Show Your Support #

If you find this plugin helpful, please give it a star on GitHub! It helps others discover the plugin and motivates me to keep improving it.

5
likes
0
points
534
downloads

Publisher

verified publishertuankhoidev.com

Weekly Downloads

A lightweight Flutter plugin for video manipulation using pure native code (Media3 for Android and AVFoundation for iOS). Efficiently trim videos, generate thumbnails, and retrieve video information without FFmpeg dependency.

Repository (GitHub)
View/report issues

Topics

#video #trimmer #thumbnail #media

Funding

Consider supporting this project:

github.com

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_native_video_trimmer