grok_video_generator 1768.377.239
grok_video_generator: ^1768.377.239 copied to clipboard
High-quality AI video generation library
grok-video-generator #
A Dart package designed to simplify the creation of AI-driven videos. This library provides tools for composing video elements, integrating media assets, and generating video content programmatically.
Installation #
To use grok-video-generator in your Dart project, add it as a dependency in your pubspec.yaml file:
yaml
dependencies:
grok_video_generator: ^1.0.0 # Replace with the latest version
Then, run dart pub get to install the package.
Usage #
Here are some examples of how to use grok-video-generator:
1. Basic Video Creation: dart import 'package:grok_video_generator/grok_video_generator.dart';
void main() async { final video = VideoGenerator();
// Add a title slide video.addTitleSlide(title: "My AI Video", subtitle: "Generated with Dart");
// Add a video clip video.addVideoClip(filePath: 'path/to/your/video.mp4');
// Add an image with a caption video.addImageSlide(imagePath: 'path/to/your/image.jpg', caption: "Amazing Image");
// Generate the video await video.generateVideo(outputPath: 'output/my_video.mp4');
print('Video generated successfully!'); }
2. Adding Audio and Transitions: dart import 'package:grok_video_generator/grok_video_generator.dart';
void main() async { final video = VideoGenerator();
// Add a video clip with audio video.addVideoClip(filePath: 'path/to/your/video.mp4', audioPath: 'path/to/your/audio.mp3');
// Add a transition between clips video.addTransition(type: TransitionType.fade);
// Add another video clip video.addVideoClip(filePath: 'path/to/another/video.mp4');
// Generate the video await video.generateVideo(outputPath: 'output/my_video_with_audio.mp4');
print('Video generated successfully with audio and transitions!'); }
3. Customizing Video Properties: dart import 'package:grok_video_generator/grok_video_generator.dart';
void main() async { final video = VideoGenerator( width: 1280, height: 720, frameRate: 30, );
// Add a series of images for (int i = 0; i < 5; i++) { video.addImageSlide(imagePath: 'path/to/image_$i.jpg', duration: 2); // Show each image for 2 seconds }
// Generate the video await video.generateVideo(outputPath: 'output/custom_video.mp4');
print('Custom video generated successfully!'); }
4. Using Text-to-Speech: dart import 'package:grok_video_generator/grok_video_generator.dart';
void main() async { final video = VideoGenerator();
// Add a slide with text-to-speech narration video.addTextSlide( text: "This is a narrated slide generated using text-to-speech.", ttsOptions: TextToSpeechOptions(voice: 'en-US-Wavenet-D'), // Example voice );
// Generate the video await video.generateVideo(outputPath: 'output/tts_video.mp4');
print('Video with text-to-speech generated successfully!'); }
Feature Summary #
- Composition: Easily assemble video segments, images, and text.
- Media Integration: Seamlessly incorporate video and audio files.
- Transitions: Add professional-looking transitions between clips.
- Customization: Control video dimensions, frame rate, and other properties.
- Text-to-Speech: Integrate narrated content using text-to-speech services (requires external API integration, not included in core package).
- Extensible: Designed for easy integration with other Dart packages and services.
License #
MIT License
This package is part of the grok-video-generator ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/blog/grok-ai-video-generator-the-ultimate-guide-to-creating-ai-videos-2025/