veo

A Dart package to simplify video processing tasks, offering convenient abstractions for common video operations. This package aims to streamline video manipulation within your Dart applications.

Installation

To use veo in your Dart project, add it as a dependency using dart pub add: bash dart pub add veo

Usage

Here are some examples of how to use the veo package:

1. Getting Video Metadata: dart import 'package:veo/veo.dart';

void main() async { try { final videoPath = 'path/to/your/video.mp4'; // Replace with your video file path final metadata = await VideoProcessor.getMetadata(videoPath);

print('Duration: ${metadata.duration}');
print('Width: ${metadata.width}');
print('Height: ${metadata.height}');
print('Frame Rate: ${metadata.frameRate}');

} catch (e) { print('Error getting metadata: $e'); } }

2. Extracting Frames from a Video: dart import 'package:veo/veo.dart'; import 'dart:io';

void main() async { try { final videoPath = 'path/to/your/video.mp4'; // Replace with your video file path final outputDirectory = 'path/to/output/directory'; // Replace with your desired output directory

// Ensure the output directory exists
Directory(outputDirectory).createSync(recursive: true);

await VideoProcessor.extractFrames(
  videoPath,
  outputDirectory,
  frameRate: 1, // Extract one frame per second
);

print('Frames extracted successfully to $outputDirectory');

} catch (e) { print('Error extracting frames: $e'); } }

3. Converting Video Format: dart import 'package:veo/veo.dart';

void main() async { try { final inputPath = 'path/to/your/video.mp4'; // Replace with your input video file path final outputPath = 'path/to/your/output/video.avi'; // Replace with your desired output video file path

await VideoProcessor.convertFormat(inputPath, outputPath, format: 'avi');

print('Video converted successfully to AVI format at $outputPath');

} catch (e) { print('Error converting video: $e'); } }

4. Generating a Thumbnail: dart import 'package:veo/veo.dart'; import 'dart:io';

void main() async { try { final videoPath = 'path/to/your/video.mp4'; // Replace with your video file path final thumbnailPath = 'path/to/your/thumbnail.jpg'; // Replace with your desired thumbnail file path

await VideoProcessor.generateThumbnail(videoPath, thumbnailPath, time: Duration(seconds: 5));

print('Thumbnail generated successfully at $thumbnailPath');

} catch (e) { print('Error generating thumbnail: $e'); } }

5. Resizing a Video: dart import 'package:veo/veo.dart';

void main() async { try { final inputPath = 'path/to/your/video.mp4'; // Replace with your input video file path final outputPath = 'path/to/your/resized_video.mp4'; // Replace with your desired output video file path

await VideoProcessor.resize(inputPath, outputPath, width: 640, height: 480);

print('Video resized successfully and saved at $outputPath');

} catch (e) { print('Error resizing video: $e'); } }

Features

  • Metadata Extraction: Retrieve comprehensive video metadata such as duration, dimensions, and frame rate.
  • Frame Extraction: Extract individual frames from a video at a specified frame rate.
  • Video Conversion: Convert videos between various formats (e.g., MP4, AVI, MOV).
  • Thumbnail Generation: Create thumbnails from videos at a specific timestamp.
  • Video Resizing: Resize videos to different resolutions.
  • Error Handling: Provides robust error handling for common video processing issues.

License

MIT

This package is part of the veo ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/video/veo/

Libraries

veo