Camera SDK

Professional camera integration with advanced filters, real-time effects, and cross-platform compatibility

Advanced Camera Technology

Cutting-edge camera SDK with professional-grade controls, real-time processing, and optimized performance for mobile applications.

Rich Filter Library

Access hundreds of professionally crafted filters and effects with weekly updates through our dynamic asset store.

Cross-Platform Support

Seamless integration across iOS, Android, Flutter, and React Native with consistent APIs and platform-specific optimizations.

Easy Integration

Developer-friendly APIs with comprehensive documentation, sample code, and quick setup to get you started in minutes.

500+
Filters & Effects
4
Platforms Supported
Weekly
Asset Updates
99.9%
Uptime

Comprehensive Feature Set

Extensive Filters & Effects Library

Choose from hundreds of beautifully crafted filters and effects, updated weekly through our dynamic asset store. Includes vibrant color filters, cinematic effects, glitch styles, vintage looks, and more — perfect for every style and mood.

Real-Time Overlays & Morphing

Apply interactive overlays and real-time face morphing effects that adapt dynamically to user expressions and movements. Create unforgettable experiences with custom masks, animated objects, and morphing that reshapes facial features naturally.

Advanced Beauty Effects

Enhance selfies and videos with a comprehensive suite of beauty filters including skin smoothing, tone correction, eye brightening, and subtle contouring. All effects run smoothly with high performance optimized for mobile devices.

Cross-Platform Compatibility & Integration

Fully supports Android, iOS, Flutter, and React Native, with web support coming soon. Designed with developers in mind — integration is simple and well-documented, helping you get started in minutes.

Weekly Asset Store Updates

Access our asset store packed with fresh filters, overlays, and effects delivered weekly to keep your app content fresh and engaging. Easily add or remove assets as needed without requiring app updates.

Huge Product Roadmap Ahead

Upcoming releases include Shopping AR Experiences, Background Segmentation for virtual backgrounds, and Selfie and Hair Segmentation for detailed personalizations and virtual try-ons.

Platform Integrations

SDK Overview

Nosmai is a powerful iOS framework for real-time video filtering and effects processing. It provides an easy-to-use interface for applying filters, beauty effects, and cloud-based effects to camera input.

Platform Requirements

  • iOS: 11.0 or higher
  • Xcode: 12.0 or higher
  • Swift: 5.0+ (for Swift projects)
  • Objective-C: Compatible
  • Valid Nosmai License Key: Contact Nosmai team for licensing
  • Device: iPhone or iPad with camera support

Installation

Multiple installation methods available for the Nosmai framework.

Method 1: CocoaPods

Add this to your Podfile:

platform :ios, '11.0'

target 'YourApp' do
  use_frameworks!
  
  pod 'Nosmai', '~> 1.0'
end

Then run:

pod install

Method 2: Manual Installation

  1. Download the nosmai.framework
  2. Drag it into your Xcode project
  3. Add to "Embedded Binaries" in project settings
  4. Add required permissions to Info.plist

Quick Start Guide

1. Import the Framework

#import <nosmai/Nosmai.h>

2. Initialize with License

static NSString * const kNosmaiAPIKey = @"YOUR_NOSMAI_LICENSE_KEY";

// Initialize with license validation
NosmaiSDK *sdk = [NosmaiSDK initWithLicense:kNosmaiAPIKey];
if (!sdk) {
    NSLog(@"Failed to initialize Nosmai SDK - check license key");
    // Handle license validation failure
    return;
}

NSLog(@"Nosmai SDK initialized successfully");

3. Setup Camera and Preview

// Configure camera
[sdk configureCameraWithPosition:NosmaiCameraPositionFront 
                   sessionPreset:AVCaptureSessionPresetHigh];

// Set preview view
[sdk setPreviewView:self.previewView];

// Start processing
[sdk startProcessing];

Required Permissions (Info.plist)

<key>NSCameraUsageDescription</key>
<string>This app needs camera access to apply filters</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for video recording</string>

Filter Management

Apply local filters and download cloud-based effects:

Local Filters

// Get available filters
NSArray *filters = [sdk getFilters];

// Apply a filter
NSString *filterPath = @"path/to/filter.nosmai";
[sdk applyEffect:filterPath completion:^(BOOL success, NSError *error) {
    if (success) {
        NSLog(@"Filter applied successfully");
    }
}];

Cloud Filters

// Get cloud filters
NSArray *cloudFilters = [sdk getCloudFilters];

// Download a cloud filter
[sdk downloadCloudFilter:@"filter_id" 
                progress:^(float progress) {
                    NSLog(@"Download progress: %.1f%%", progress * 100);
                } 
              completion:^(BOOL success, NSString *localPath, NSError *error) {
                  if (success) {
                      [sdk applyEffect:localPath completion:nil];
                  }
              }];

Filter Selection UI Pattern

// Display filter thumbnails
NSArray *filters = [sdk getFilters];
for (NSDictionary *filter in filters) {
    NSString *path = filter[@"path"];
    UIImage *preview = [sdk loadPreviewImageForFilter:path];
    // Add to UI
}

Beauty Effects & Enhancements

Apply comprehensive beauty effects and face enhancements:

Basic Beauty Filter

[sdk setBeautyFaceFilterEnabled:YES];
[sdk setBeautySmoothLevel:0.5f];    // 0.0-1.0
[sdk setBeautyWhitenLevel:0.3f];    // 0.0-1.0
[sdk setBeautySharpenLevel:0.2f];   // 0.0-1.0

Face Enhancement

// Face slimming
[sdk setFaceSlimFilterEnabled:YES];
[sdk setFaceSlimLevel:0.4f];        // 0.0-1.0

// Eye enlargement
[sdk setEyeZoomFilterEnabled:YES];
[sdk setEyeZoomLevel:0.1f];         // 0.0-0.15

// Blusher
[sdk setBlusherFilterEnabled:YES];
[sdk setBlusherIntensity:0.3f];     // 0.0-1.0

// Lipstick
[sdk setLipstickFilterEnabled:YES];
[sdk setLipstickIntensity:0.5f];    // 0.0-1.0

Color Adjustments

// Brightness
[sdk setBrightnessFilterEnabled:YES];
[sdk setBrightnessAdjustment:0.2f]; // -1.0 to 1.0

// Contrast
[sdk setContrastFilterEnabled:YES];
[sdk setContrastAdjustment:1.5f];   // 0.0-4.0

// RGB
[sdk setRGBFilterEnabled:YES];
[sdk setRGBRedAdjustment:1.2f];     // 0.0-2.0
[sdk setRGBGreenAdjustment:1.0f];   // 0.0-2.0
[sdk setRGBBlueAdjustment:0.8f];    // 0.0-2.0

Artistic Effects

[sdk setSketchFilterEnabled:YES];
[sdk setSmoothToonFilterEnabled:YES];
[sdk setCrosshatchFilterEnabled:YES];

Camera Control & Recording

Control camera functionality and access video frames:

Switch Camera

BOOL success = [sdk switchCamera];

Video Recording

// Set recording callback
[sdk setRecordingCallback:^(const uint8_t* data, int width, int height, double timestamp) {
    // Process video frame data
}];

// Enable recording
[sdk setRecordingEnabled:YES];

Recording Integration Pattern

- (void)startRecording {
    [sdk setRecordingEnabled:YES];
    [sdk setRecordingCallback:^(const uint8_t* data, int width, int height, double timestamp) {
        // Write to video file
    }];
}

- (void)stopRecording {
    [sdk setRecordingEnabled:NO];
    [sdk setRecordingCallback:nil];
}

Frame Access

[sdk setCVPixelBufferCallback:^(CVPixelBufferRef pixelBuffer, double timestamp) {
    // Access raw pixel buffer
}];

Advanced Features & Parameters

Access advanced effect parameters and memory management:

Effect Parameters

// Get available parameters for current effect
NSArray *parameters = [sdk getEffectParameters];

// Set parameter value
[sdk setEffectParameter:@"intensity" value:0.8f];

// Get parameter value
float value = [sdk getEffectParameterValue:@"intensity"];

Memory Management

// Clear filter caches
[sdk clearFiltersCache];

// Force memory cleanup
[sdk forceMemoryCleanup];

// Cleanup when done
[sdk cleanup];

Error Handling & Best Practices

Implement proper error handling and follow recommended practices:

Error Handling

[sdk applyEffect:filterPath completion:^(BOOL success, NSError *error) {
    if (!success && error) {
        switch (error.code) {
            case NosmaiErrorCodeLicenseInvalid:
                NSLog(@"Invalid license");
                break;
            case NosmaiErrorCodeEffectLoadFailed:
                NSLog(@"Failed to load effect");
                break;
            default:
                NSLog(@"Error: %@", error.localizedDescription);
        }
    }
}];

Best Practices

  • Initialize once: Create SDK instance only once in your app lifecycle
  • License validation: Always check initialization success
  • Memory management: Call cleanup when done
  • Background handling: Stop processing when app goes to background
  • Filter combinations: Remove existing filters before applying new ones

Troubleshooting

  • Black screen: Check camera permissions and preview view setup
  • Filters not loading: Verify .nosmai files are in app bundle
  • Memory issues: Use forceMemoryCleanup and clearFiltersCache
  • Performance: Reduce filter complexity or image resolution

License Validation & Security

Ensure secure implementation and proper license handling:

License Validation States

// Monitor license validation states
typedef NS_ENUM(NSInteger, NosmaiLicenseState) {
    NosmaiLicenseStateUnknown,
    NosmaiLicenseStateValidating,
    NosmaiLicenseStateValid,
    NosmaiLicenseStateInvalid,
    NosmaiLicenseStateExpired,
    NosmaiLicenseStateNetworkError
};

// Handle license validation callbacks
[sdk setLicenseValidationHandler:^(NosmaiLicenseState state, NSError *error) {
    switch (state) {
        case NosmaiLicenseStateValid:
            NSLog(@"License validated successfully");
            break;
        case NosmaiLicenseStateInvalid:
            NSLog(@"Invalid license key");
            break;
        case NosmaiLicenseStateExpired:
            NSLog(@"License expired");
            break;
        default:
            NSLog(@"License validation error: %@", error.localizedDescription);
    }
}];

Security Recommendations

  • License Storage: Store license keys securely using Keychain Services
  • Network Security: Ensure HTTPS connections for license validation
  • Data Privacy: Handle user data according to privacy regulations
  • App Transport Security: Configure ATS settings appropriately

Android SDK Installation

Add the Camera SDK to your Android project using Gradle.

Gradle (Module-level)

dependencies {
    implementation 'com.nosmai:camera-sdk:1.0.0'
    implementation 'androidx.camera:camera-core:1.3.0'
    implementation 'androidx.camera:camera-camera2:1.3.0'
    implementation 'androidx.camera:camera-lifecycle:1.3.0'
    implementation 'androidx.camera:camera-view:1.3.0'
}

Gradle (Project-level)

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://maven.nosmai.com' }
    }
}

Configuration

Initialize the SDK in your Application class:

import com.nosmai.camerasdk.CameraSDK

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        CameraSDK.initialize(this, "YOUR_API_KEY")
    }
}

Basic Usage

Implement camera functionality in your Activity or Fragment:

import com.nosmai.camerasdk.CameraManager
import com.nosmai.camerasdk.CameraConfiguration
import com.nosmai.camerasdk.CameraCallback

class CameraActivity : AppCompatActivity() {
    private lateinit var cameraManager: CameraManager
    private lateinit var previewView: PreviewView
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_camera)
        
        previewView = findViewById(R.id.previewView)
        setupCamera()
    }
    
    private fun setupCamera() {
        cameraManager = CameraManager(this)
        
        val config = CameraConfiguration.Builder()
            .setResolution(CameraConfiguration.RESOLUTION_1080P)
            .setFrameRate(30)
            .setFlashMode(CameraConfiguration.FLASH_AUTO)
            .build()
        
        cameraManager.configure(config)
        cameraManager.startPreview(previewView)
    }
    
    private fun capturePhoto() {
        cameraManager.capturePhoto(object : CameraCallback<String> {
            override fun onSuccess(result: String) {
                // Handle captured photo path
                Log.d("Camera", "Photo saved to: $result")
            }
            
            override fun onError(error: Exception) {
                Log.e("Camera", "Capture failed", error)
            }
        })
    }
    
    override fun onDestroy() {
        super.onDestroy()
        cameraManager.release()
    }
}

Permissions

Add the following permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" />

Prerequisites

Before integrating the Nosmai Flutter SDK, ensure you have:

  • Flutter 3.0+
  • iOS 12.0+
  • Valid Nosmai license key
  • Camera and microphone permissions

Installation

Add the Nosmai Flutter plugin to your project.

pubspec.yaml

dependencies:
  nosmai_flutter: ^1.0.0
  permission_handler: ^11.0.0  # For camera permissions

Install Dependencies

flutter pub get

Basic Setup & Initialization

Initialize the SDK with proper permission handling:

import 'package:nosmai_flutter/nosmai_flutter.dart';
import 'package:permission_handler/permission_handler.dart';

class CameraScreen extends StatefulWidget {
  @override
  _CameraScreenState createState() => _CameraScreenState();
}

class _CameraScreenState extends State<CameraScreen> {
  final NosmaiFlutter _nosmai = NosmaiFlutter.instance;
  bool _isInitialized = false;
  bool _isReady = false;

  @override
  void initState() {
    super.initState();
    _initializeSDK();
  }

  Future<void> _initializeSDK() async {
    // Request camera permission
    final status = await Permission.camera.request();
    if (status != PermissionStatus.granted) {
      print('Camera permission denied');
      return;
    }

    try {
      // Initialize with your license key
      final success = await _nosmai.initWithLicense(
        'YOUR_NOSMAI_LICENSE_KEY_HERE',
      );

      setState(() {
        _isInitialized = success;
      });

      if (success) {
        await _setupCamera();
      }
    } catch (e) {
      print('SDK initialization error: $e');
    }
  }

  Future<void> _setupCamera() async {
    try {
      await _nosmai.configureCamera(
        position: NosmaiCameraPosition.front,
      );

      setState(() {
        _isReady = true;
      });
    } catch (e) {
      print('Camera setup error: $e');
    }
  }
}

Camera Preview

Add the camera preview widget to your UI:

@override
Widget build(BuildContext context) {
  return Scaffold(
    backgroundColor: Colors.black,
    body: _isReady
        ? Stack(
            children: [
              // Camera preview
              const Positioned.fill(
                child: NosmaiCameraPreview(
                  width: double.infinity,
                  height: double.infinity,
                ),
              ),
              
              // Controls overlay
              _buildControlsOverlay(),
            ],
          )
        : _buildLoadingScreen(),
  );
}

Widget _buildLoadingScreen() {
  return const Center(
    child: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        CircularProgressIndicator(),
        SizedBox(height: 20),
        Text(
          'Initializing camera...',
          style: TextStyle(color: Colors.white),
        ),
      ],
    ),
  );
}

Applying Filters

Load and apply filters with support for both local and cloud filters:

List<dynamic> _filters = [];
int _selectedFilterIndex = -1;

Future<void> _loadFilters() async {
  try {
    final filters = await _nosmai.getFilters();
    setState(() {
      _filters = filters;
    });
    
    print('Loaded ${filters.length} filters');
    for (int i = 0; i < filters.length; i++) {
      final filter = filters[i];
      if (filter is NosmaiLocalFilter) {
        print('Local: ${filter.displayName}');
      } else if (filter is NosmaiCloudFilter) {
        print('Cloud: ${filter.displayName} (downloaded: ${filter.isDownloaded})');
      }
    }
  } catch (e) {
    print('Error loading filters: $e');
  }
}

Future<void> _applyFilter(int index) async {
  if (index < 0 || index >= _filters.length) return;

  try {
    final filter = _filters[index];

    if (filter is NosmaiLocalFilter) {
      // Apply local filter
      await _nosmai.applyEffect(filter.path);
      setState(() => _selectedFilterIndex = index);
      
    } else if (filter is NosmaiCloudFilter) {
      if (!filter.isDownloaded) {
        // Download cloud filter first
        await _downloadAndApplyCloudFilter(filter, index);
      } else {
        // Apply downloaded filter
        await _nosmai.applyEffect(filter.localPath!);
        setState(() => _selectedFilterIndex = index);
      }
    }
  } catch (e) {
    print('Error applying filter: $e');
  }
}

Video Recording & Photo Capture

Implement recording and photo capture functionality:

bool _isRecording = false;

Future<void> _toggleRecording() async {
  try {
    if (_isRecording) {
      final result = await _nosmai.stopRecording();
      
      setState(() => _isRecording = false);
      
      if (result.success && result.videoPath != null) {
        _showVideoSuccessDialog(result.videoPath!);
      }
    } else {
      final success = await _nosmai.startRecording();
      
      if (success) {
        setState(() => _isRecording = true);
      }
    }
  } catch (e) {
    print('Recording error: $e');
    setState(() => _isRecording = false);
  }
}

Future<void> _capturePhoto() async {
  try {
    final result = await _nosmai.capturePhoto();
    
    if (result.success) {
      _showPhotoSuccessDialog(result);
    } else {
      print('Photo capture failed: ${result.error}');
    }
  } catch (e) {
    print('Photo capture error: $e');
  }
}

Platform Configuration

iOS (ios/Runner/Info.plist)

<key>NSCameraUsageDescription</key>
<string>This app needs camera access to apply filters</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for video recording</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app needs photo library access to save photos and videos</string>

Android (android/app/src/main/AndroidManifest.xml)

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" />

Advanced Features

Additional camera controls and filter management:

// Switch between front/back camera
Future<void> _switchCamera() async {
  try {
    await _nosmai.switchCamera();
  } catch (e) {
    print('Camera switch error: $e');
  }
}

// Remove all applied filters
Future<void> _removeAllFilters() async {
  try {
    await _nosmai.removeAllFilters();
    setState(() => _selectedFilterIndex = -1);
  } catch (e) {
    print('Error removing filters: $e');
  }
}

// Lifecycle management
@override
void dispose() {
  // Always cleanup when disposing
  _nosmai.dispose();
  super.dispose();
}

Error Handling & Best Practices

Implement comprehensive error handling and lifecycle management:

class NosmaiErrorHandler {
  static void handleError(dynamic error, String context) {
    print('Nosmai Error in $context: $error');
    
    // Show user-friendly message
    if (error.toString().contains('license')) {
      _showError('License validation failed. Please check your license key.');
    } else if (error.toString().contains('permission')) {
      _showError('Camera permission is required to use filters.');
    } else if (error.toString().contains('network')) {
      _showError('Network error. Please check your connection.');
    } else {
      _showError('An unexpected error occurred. Please try again.');
    }
  }
  
  static void _showError(String message) {
    print('User Error: $message');
  }
}

// Handle app lifecycle changes
class _CameraScreenState extends State<CameraScreen> 
    with WidgetsBindingObserver {
  
  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);
    _initializeSDK();
  }
  
  @override
  void dispose() {
    WidgetsBinding.instance.removeObserver(this);
    _nosmai.dispose();
    super.dispose();
  }
  
  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    switch (state) {
      case AppLifecycleState.paused:
        if (_isRecording) {
          _toggleRecording(); // Stop recording
        }
        break;
      case AppLifecycleState.resumed:
        // App came to foreground
        break;
      default:
        break;
    }
  }
}

Support & Resources

Sample Projects

Download complete sample projects for iOS, Android, and Flutter implementations.

Get Samples →

Support

Get technical support from our team for integration and implementation questions.

Contact Support →