lovoj_video_editor 0.9.2
lovoj_video_editor: ^0.9.2 copied to clipboard
Custom short video recording & editing SDK for Flutter — Camera2/MediaCodec (Android) + AVFoundation (iOS).
lovoj_video_editor #
Custom Flutter SDK for short video recording and editing. 100% apna native engine — kisi third-party video SDK ki zaroorat nahi.
Install #
dependencies:
lovoj_video_editor: ^0.9.2
flutter pub get
Quick start #
import 'package:lovoj_video_editor/lovoj_video_editor.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await VideoEditorSdk.initialize();
runApp(MyApp());
}
Features (v0.9.2) #
Recording #
| Feature | API |
|---|---|
| Countdown timer | RecordingConfig(countdownSec: 3) |
| Real-time filters | RecordingConfig(activeFilter: VideoFilter(type: FilterType.warm)) |
| AR face stickers | RecordingConfig(arEffect: ArEffect(type: ArEffectType.glasses)) |
| Music during recording | Music picker in RecordingScreen |
| Multi-clip + auto merge | autoMergeClips: true + Next clip button |
| Max clip duration | maxClipDurationSec: 60 |
Editing #
| Feature | API |
|---|---|
| Trim | session.trimClip(0, startMs: 0, endMs: 30000) |
| Speed | session.setClipSpeed(0, 2.0) |
| Background music / SFX | session.addAudioTrack(...) |
| Text overlays | Font (6 families), size, color, background, 7 positions |
| Voice-over | session.startVoiceOver() / stopVoiceOver() |
| AR on export | session.setArEffect(ArEffect(type: ArEffectType.catEars)) |
Text overlay fonts #
TextOverlayFonts.all → Sans, Serif, Monospace, Bold, Script, Display
AR effects #
ArEffectType → none, catEars, bunnyEars, dogEars, glasses, crown, mustache
Live preview (face-tracked) + baked into exported video.
Ready-made screens #
// Recording
Navigator.push(context, MaterialPageRoute(
builder: (_) => RecordingScreen(
config: RecordingConfig(countdownSec: 3, autoMergeClips: true),
onRecordingComplete: (path) => print(path),
),
));
// Editing
Navigator.push(context, MaterialPageRoute(
builder: (_) => EditorScreen(videoPath: path),
));
Programmatic API #
final session = VideoEditorSdk.instance.editVideo('/path/to/video.mp4');
session.trimClip(0, startMs: 1000, endMs: 25000);
session.setClipSpeed(0, 0.5);
session.addTextOverlay(TextOverlay(
id: '1', text: 'Hello',
startMs: 0, endMs: 5000,
fontFamily: TextOverlayFonts.display,
fontSize: 32, color: Colors.white,
backgroundColor: Colors.black54,
position: TextOverlayPosition.bottomCenter,
));
session.setArEffect(const ArEffect(type: ArEffectType.glasses));
final exported = await session.export(
settings: ExportSettings.preset(ExportQuality.high),
onProgress: (p) => print('${(p * 100).round()}%'),
);
Native stack #
| Platform | Recording | Processing | AR |
|---|---|---|---|
| Android | Camera2 + MediaRecorder | MediaCodec + MediaMuxer | Camera2 hardware face detect + android.media.FaceDetector |
| iOS | AVFoundation | AVFoundation + CoreImage | Apple Vision framework |
Performance: Streaming MediaCodec decode, adaptive FPS for long videos, single-pass export (text + AR + encode combined).
Permissions #
Add camera/microphone permissions to your app's AndroidManifest.xml and Info.plist. See INTEGRATION.md.
Example #
cd example && flutter run
License #
MIT — see LICENSE.