This project demonstrates how to capture ultra slow-motion photo using Swift and the AVFoundation framework on an iPhone. It supports frame rates up to 240 fps, depending on the capabilities of the device.
- Capture ultra slow-motion video frames at high frame rates.
- Display camera output using
AVCaptureVideoPreviewLayer
. - Save captured video frames as a video file in the Photos library.
- iOS 14.0+
- Xcode 12.0+
- Swift 5.0+
- An iPhone capable of capturing high frame rate photo (e.g., iPhone 13 Pro)
-
Clone the repository:
git clone https://github.com/AbdulKareemios/iOS-240-FPS-Capturing-Photos cd iOS-240-FPS-Capturing-Photos
-
Open the project in Xcode:
open UltraSlowMoCapture.xcodeproj
-
Configure Info.plist:
Add the following keys to
Info.plist
:<key>NSCameraUsageDescription</key> <string>We need access to your camera for ultra slow-motion video capture.</string> <key>NSPhotoLibraryAddUsageDescription</key> <string>We need access to your photo library to save captured Photos.</string>
-
Build and run the project on a compatible iPhone:
- Connect your iPhone.
- Select your device as the build target.
- Click the Run button in Xcode.
-
Start capturing photo:
- The camera preview will be displayed on the screen.
- Press the Start Recording button to begin capturing Photo frames.
-
Stop capturing Photos:
- Press the Stop Recording button to stop capturing.
- The captured photos will be saved to the Photos library.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request.