Nosmai  Effects Nosmai  Moderation Nosmai Try-ons coming soon
Docs menu Flutter
How-to guide

Record processed video in Flutter

Start and stop processed recording from Dart, then optionally save the finalized video to the device gallery.

Platform Flutter SDK version 1.0.2 Updated Aug 22, 2026 Time 5 min

Prerequisites

Start recording

final nosmai = NosmaiFlutter.instance;
final started = await nosmai.startRecording();

if (!started) {
  throw StateError('Recording did not start');
}

Stop and save

final recording = await nosmai.stopRecording();

if (!recording.success || recording.videoPath == null) {
  throw StateError(recording.error ?? 'Recording failed');
}

await nosmai.saveVideoToGallery(
  recording.videoPath!,
  name: 'nosmai-video',
);

stopRecording returns only after the video has been finalized.

Lifecycle rule

Stop recording before switching the camera, navigating away, or disposing the preview. Guard the record button so a second start or stop cannot overlap the first operation.

Verify it worked

Record a short clip with a visible effect, wait for stopRecording, and play the returned file. Confirm the gallery copy only after saving reports success.

Common errors

SymptomCauseFix
startRecording returns falseThe preview is not ready or recording is already activeWait for processing and guard duplicate record-button taps
videoPath is nullNative finalization failedRead recording.error and keep the screen alive until stop completes

Next steps

References

Was this page helpful?

Your response helps us prioritize documentation improvements.

Nosmai

An AR and AI company. Founded on the idea that the next decade of software will be visual, and that the tools for it should be within reach of anyone building.

Newsletter

Product updates and release notes. No spam.

© 2026 nosmai, inc · all rights reserved