Effects React Native
Effects / Guides / Video recording / React Native

Record AR-filtered video in React Native with Nosmai Effects

Updated August 19, 2026

Record a processed MP4 from the Fabric camera view and optionally copy the finalized file to the media library.

Prerequisites

Recording configuration

startRecording() takes no configuration argument in this React Native API. There is no public JavaScript recording setter for quality, bitrate, FPS, audio enablement, output size, destination, or maximum duration. The native recorder chooses defaults and creates a temporary MP4.

Do not infer file resolution from React view dimensions or assume RTC publishing settings configure local recording. Android can reduce recording size on measured lower-tier devices while keeping preview dimensions intact. For independent encoding or audio mixing, use a native output adapter or the provider's recording facilities; the low-rate JavaScript analysis-frame stream is not a real-time recording transport.

An app-owned duration limit must use the same serialized stop flow as the record button. Verify the output's audio and permissions on each native platform rather than assuming a live-call microphone track is included.

Start recording

await NosmaiCameraSdk.startRecording();

Stop and save

const recording = await NosmaiCameraSdk.stopRecording();

console.log(recording.durationSeconds, recording.hasAudio);

await NosmaiCameraSdk.saveVideoToGallery(
  recording.uri,
  'nosmai-video'
);

The stop result contains a temporary local MP4 URI, duration, size, MIME type, and whether the finalized file includes audio.

fileSizeBytes is bytes and durationSeconds is seconds. Starting and stopping can reject; a successful start is not a guarantee that finalization will succeed. Gallery saving is a separate operation with its own result and permissions. Copy or export temporary files before the application removes temporary data.

Observe recording progress

const progressSubscription = NosmaiCameraSdk.addRecordingProgressListener(progress => {
  console.log('Recording seconds:', progress.durationSeconds);
});
const recordingActive = await NosmaiCameraSdk.isRecording();
const elapsedSeconds = await NosmaiCameraSdk.getCurrentRecordingDuration();

Replace the log with a guarded UI update. Progress and elapsed-time queries are not completion signals; use stopRecording() for the finalized file. Remove the subscription when its owner leaves:

progressSubscription.remove();

Lifecycle rule

Stop recording before camera switch, app pause, navigation, or cleanup. If an optional package-audio track cannot be muxed, inspect E_RECORDING_AUDIO_MUX and verify the finalized result instead of assuming the video was lost.

Verify it worked

Record a short clip with a visible effect, wait for stopRecording, and play the returned URI. Confirm its duration, audio, orientation, and effect output.

Common errors

SymptomCauseFix
Recording does not startNosmaiCameraView is not ready or a session is already activeWait for camera startup and block duplicate record-button taps
E_RECORDING_AUDIO_MUXThe optional audio track could not be finalized with the videoInspect the result and verify native audio permissions and lifecycle

Next steps

References

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