# Record processed video in React Native

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

> For AI agents: the complete documentation index is at https://nosmai.com/llms/effects.txt

Product: Nosmai Effects
Group: guide
Source: https://nosmai.com/docs/effects/guides/output/record-video/react-native/

## Prerequisites

- A working [React Native quickstart](/docs/effects/quickstart/react-native/)
- A ready `NosmaiCameraView`

## Start recording

```tsx
await NosmaiCameraSdk.startRecording();
```

## Stop and save

```tsx
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.

## 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

| Symptom | Cause | Fix |
| --- | --- | --- |
| Recording does not start | `NosmaiCameraView` is not ready or a session is already active | Wait for camera startup and block duplicate record-button taps |
| `E_RECORDING_AUDIO_MUX` | The optional audio track could not be finalized with the video | Inspect the result and verify native audio permissions and lifecycle |

## Next steps

- [Capture a processed photo in React Native](/docs/effects/guides/output/capture-a-photo/react-native/)
- [Review the React Native platform guide](/docs/effects/platforms/react-native/)

## References

- [Limits and performance](/docs/effects/limits-and-performance/)
- [Troubleshooting](/docs/effects/troubleshooting/)
