ai_video_editor

A CapCut-style video editor for Flutter, built for TikTok, Instagram Reels and YouTube Shorts. Edit on a multi-track timeline, or just say what you want and let AI Edit cut, style, caption and score the video.

All the AI runs on the phone, for free: no account, no API key, no paid service. Rendering and export go through FFmpeg.

Features

AI Edit: edit by voice or text

  • "Make it a trending reel, keep only the talking and add captions"
  • "Make a 30 second short of the best parts" (AI Shorts)
  • "Remove the filters, add vintage at the start and make the music quieter"
  • Or one tap on a style: Viral Reel, Talking Vlog, Cinematic, Hype, Aesthetic.

AI Edit then writes a post caption with hashtags, ready to copy or share.

Free on-device AI

Feature How it works
Smart AI Qwen 2.5 0.5B (Apache 2.0) runs on the phone's CPU via MediaPipe. It downloads once (~550 MB, optional) and understands requests in any language. Without it, built-in keyword rules do the same jobs.
AI Shorts Transcribes the speech and keeps only the strongest moments
Keep only the talking Cuts silent pauses automatically (jump cuts)
Auto captions Whisper speech-to-text, 12 languages, model downloaded once (~40 MB)
Noise cancellation Reduce noise / Studio voice, applied inside the render so it stays in sync
Person cut-out / green screen ML Kit selfie segmentation; chroma key on the measured backdrop colour
Auto reframe, beat sync Face detection keeps the subject centred; cuts on the music's beat
AI music, voiceover Offline music synthesis; the phone's text-to-speech

A full editor

  • Timeline with a centre playhead, pinch zoom, filmstrips, waveforms and lanes for audio, text, stickers and effects.
  • Trim (with live frame preview), cut out, split, duplicate, speed 0.25x–4x, volume.
  • Crop by pinching the video, fit / fill, ratios 9:16, 16:9, 1:1, 4:5.
  • 10 transitions: Fade, Flash, four slides, Zoom, Spin, Glitch, plus a "Mix" that varies them per cut.
  • 10 colour looks, timed effects, styled text, emoji and image stickers, music tracks.
  • Lip-sync kept across any number of cuts.
  • An instant live preview plus a fast incremental render.
  • Export up to 4K / 60 fps with Android hardware encoding; save to the gallery or share.
  • Drafts, undo / redo (50 steps), black-and-white UI with blue for AI.

Installation

dependencies:
  ai_video_editor: ^1.0.0

Android

In android/app/build.gradle.kts, set minSdk = 26.

Add to AndroidManifest.xml:

<manifest ...>
  <!-- One-time model downloads (Whisper, Smart AI) -->
  <uses-permission android:name="android.permission.INTERNET"/>
  <!-- Spoken AI Edit requests -->
  <uses-permission android:name="android.permission.RECORD_AUDIO"/>
  <!-- Saving to the gallery on Android 9 and older -->
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
      android:maxSdkVersion="29"/>

  <queries>
    <intent><action android:name="android.intent.action.TTS_SERVICE"/></intent>
    <intent><action android:name="android.speech.RecognitionService"/></intent>
  </queries>

  <application ...>
    <!-- Recommended: some MediaTek GPUs crash in Impeller when drawing video -->
    <meta-data android:name="io.flutter.embedding.android.EnableImpeller"
        android:value="false"/>
  </application>
</manifest>

iOS

Add these keys to Info.plist: NSPhotoLibraryUsageDescription, NSPhotoLibraryAddUsageDescription, NSCameraUsageDescription, NSMicrophoneUsageDescription and NSSpeechRecognitionUsageDescription.

Usage

Open the editor:

import 'package:ai_video_editor/ai_video_editor.dart';

Navigator.push(
  context,
  MaterialPageRoute(builder: (_) => const VideoEditorScreen()),
);

Keep your own controller, for example to read the project afterwards:

final controller = VideoEditorController();

Navigator.push(
  context,
  MaterialPageRoute(
    builder: (_) => VideoEditorScreen(existingController: controller),
  ),
);

// later
controller.dispose();

Other screens: ProjectsScreen (saved drafts), VideoEntryScreen, OpenCutEditorScreen and FinalResultPlayer.

Run an AI edit from code:

final plan = EditCommandParser.parse(
  'make it a trending reel, keep only the talking and add captions',
);
final report = await AutoEditor(controller).run(plan);
print(report.done);      // what was done
print(report.postText);  // caption + hashtags

In widget tests, create the controller with VideoEditorController(initializeAi: false), because ML Kit can't start there.

Platform support

Platform Support
Android Full
iOS Full
Web, Windows, macOS, Linux UI only: FFmpeg, ML Kit, Whisper, speech and Smart AI need a phone

Notes

  • App size: FFmpeg (full-gpl), ML Kit and MediaPipe add native libraries.
  • Downloads: Whisper (~40 MB) and Smart AI (~550 MB) download only when first used. Smart AI is optional.
  • Licences: this package is MIT. FFmpeg is used through ffmpeg_kit_flutter_new's GPL build; check that this suits your app before you ship it.

Example

The example/ folder has a complete app.

License

MIT. See LICENSE.

Libraries

ai_video_editor
A CapCut-style video editor for Flutter with free, on-device AI: voice / text AI Edit, AI Shorts, captions, noise cancellation, cut-out, transitions and FFmpeg export.
controllers/auto_editor
controllers/sub_controllers/ai_controller
controllers/sub_controllers/audio_controller
controllers/sub_controllers/clip_controller
controllers/sub_controllers/effect_controller
controllers/sub_controllers/export_controller
controllers/sub_controllers/text_controller
controllers/video_editor_controller
models/auto_caption_cue
models/export_models
models/project_models
models/types/text_overlay_style
models/types/video_aspect_ratio
models/types/video_editor_effects
models/types/video_fill_mode
models/types/video_track_types
models/video_editor_audio_track
models/video_editor_clip
models/video_editor_models
models/video_effect_overlay
models/video_text_overlay
services/ai/agent/edit_agent
services/ai/agent/smart_ai_model
services/ai/edit_command_parser
services/ai/keying_graphs
services/ai/music_synthesizer
services/ai/smart_cut_service
services/ai/video_ai_audio
services/ai/video_ai_cutout
services/ai/video_ai_service
services/ai/video_ai_service_base
services/ai/video_ai_utilities
services/ai/video_ai_video
services/media_probe_service
services/preview_renderer
services/project_storage
services/render_filter_builder
services/render_graph_builder
services/video_render_service
services/waveform_service
theme/video_editor_theme
utils/video_editor_utils
video_editor
views/draft_saved_screen
views/export_complete_screen
views/export_progress_screen
views/export_settings_screen
views/fullscreen_player_screen
views/open_cut_editor_screen
views/projects_screen
views/video_editor_screen
views/video_entry_screen
widgets/bottom_tools
widgets/dialogs/ai_auto_captions_dialog
widgets/dialogs/ai_auto_edit_sheet
widgets/dialogs/ai_background_removal_dialog
widgets/dialogs/ai_dialog_widgets
widgets/dialogs/ai_dialogs
widgets/dialogs/ai_edit_result_sheet
widgets/dialogs/ai_music_generation_dialog
widgets/dialogs/ai_style_transfer_dialog
widgets/dialogs/ai_voice_generation_dialog
widgets/dialogs/clip_crop_sheet
widgets/dialogs/clip_trim_sheet
widgets/dialogs/save_draft_sheet
widgets/dialogs/smart_ai_card
widgets/dialogs/sticker_sheet
widgets/dialogs/text_editor_sheet
widgets/dialogs/video_edit_dialogs
widgets/draggable_text_overlay
widgets/editor/ai_magic_bar
widgets/editor/canvas_sheet
widgets/editor/contextual_toolbar
widgets/editor/editor_actions
widgets/editor/editor_ai_actions
widgets/editor/editor_feedback
widgets/editor/editor_sheets
widgets/editor/effect_preview
widgets/editor/playback_bar
widgets/editor/preview_canvas
widgets/editor/transition_sheet
widgets/editor_body
widgets/export/share_destinations_sheet
widgets/export_overlay
widgets/final_result_player
widgets/fullscreen_preview
widgets/gradient_button
widgets/landing_page
widgets/player/app_scrubber
widgets/player/media_badges
widgets/player/player_controls
widgets/project_preview
widgets/projects/project_card
widgets/text/text_overlay_view
widgets/timeline/timeline_items
widgets/timeline/timeline_widgets
widgets/video_preview