slowmo_video_recorder 0.0.4
slowmo_video_recorder: ^0.0.4 copied to clipboard
Pure-Dart API for high-frame-rate (slow-motion) video recording on iOS.
πΉ slowmo_video_recorder #
Slow-motion video recording made easy for Flutter apps ( iOS-only ).
The plugin provides a thin wrapper around AVFoundation allowing you to record 120 fps or 240 fps clips at 720p / 1080p with a single method call.
| Platform | iOS |
|---|---|
| Minimum OS | 12.0 |
β¨ Features #
β’ Live camera preview widget (SlowmoCameraPreview).
β’ Start / stop high-frame-rate recordings.
β’ Choose frame-rate (fps) and resolution ("720p", "1080p").
β’ Optional audio recording (can record video-only).
β’ Proper resource cleanup to prevent camera indicator staying on.
β’ Returns the absolute file path (.mov) on completion.
Android or web support is not planned. You can still import the package on these platforms; calls will throw
UnsupportedError.
π Quick start #
Add to pubspec.yaml:
dependencies:
slowmo_video_recorder: ^0.0.3
iOS setup #
- Update your Info.plist:
<key>NSCameraUsageDescription</key>
<string>This app requires camera access to record slow-motion videos.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app records audio while capturing videos.</string>
- (Xcode 15+) Verify
PrivacyInfo.xcprivacyis bundled (already included in the pod). Edit if you need to declare additional data usage.
Code sample #
final recorder = SlowmoVideoRecorder();
// Start recording at 240 fps / 1080p with audio
await recorder.startRecording(
fps: 240,
resolution: '1080p',
includeAudio: true, // Optional: defaults to true
);
// β¦wait or display UIβ¦
final path = await recorder.stopRecording();
print('Video saved to: $path');
// Important: Clean up resources when done
await recorder.dispose();
Video-only recording (no audio) #
// Record without audio
await recorder.startRecording(
fps: 120,
resolution: '720p',
includeAudio: false, // Exclude audio from recording
);
Using with preview widget #
class RecordingPage extends StatefulWidget {
@override
_RecordingPageState createState() => _RecordingPageState();
}
class _RecordingPageState extends State<RecordingPage> {
final recorder = SlowmoVideoRecorder();
@override
void dispose() {
// Clean up resources when leaving the page
recorder.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: SlowmoCameraPreview(aspectRatio: 16 / 9),
// ... rest of your UI
);
}
}
π§ API reference #
| Method | Description |
|---|---|
startRecording({int fps = 120, String resolution = '720p', bool includeAudio = true}) |
Begins a session with optional audio. |
stopRecording() β Future<String?> |
Stops and returns file path. |
dispose() β Future<void> |
Cleans up camera resources. Important: Call this to turn off camera indicator. |
getPlatformVersion() |
Diagnostic helper. |
π License #
Released under the MIT license. See LICENSE for details.