Change iPhone Camera Shutter Sound in App - ios

How can I change the sound that plays when an image is captured with an iPhone? I am using AVCapture and I want to capture still images (rather than grabbing frames from video) for image quality sake.
Thanks in advance!

After researching it appears that the standard camera shutter sound is next to impossible to change via SDK.
This answer supports that. You can replace your own sound, but not in an app.
As for AVCapture, it also appears that you can't change the shutter sound as capturing images covertly is against the App Store policy. See this answer.
The only way to take a silent picture is to use a video screen grab, which you said you don't want to do for image quality reasons.
So AFAIK, there is no way to change the shutter sound not using video screen grabs.

Related

Alternative to AVFoundation captureStillImageAsynchronouslyFromConnection

I created an app that uses AVFoundation captureStillImageAsynchronouslyFromConnection to take a picture every 0.2 seconds and analyse the picture. However, I didn't realize that it made the shutter sound every time it took a picture until I had already built the app.
Question: Is there a good alternative to AVFoundation captureStillImageAsynchronouslyFromConnection that doesn't make a shutter sound or is there a legit way to turn the sound off?
Alternative solution to take photo would be AVCapturePhotoCaptureDelegate method capturePhoto(with:delegate:). Check out the documentation for AVCapturePhotoOutput.
But as i can see from your question, you want to mute the shutter speed when taking photos. As per apple documentation API, there is no way you can mute the shutter sound when taking photo. Until unless user turn off the mute hardware button.
As a workaround you can start analysing the camera frame of a continuous video by using AVCaptureVideoDataOutputSampleBufferDelegate. Here is the detailed documentation from apple for How to capture video frames from the camera as images using AV Foundation on iOS. With this method you can still get the images and avoid shutter sound as well.

Prevent recording vertical videos in app

I am creating an iOS app that allows users to take photos and record videos. I would like to block recording "vertical" videos - video recording in portrait orientations. I couldn't find any software libraries that implement this functionality so I guess I will have to implement it myself.
I am using UIImagePickerController and I tried to achieve that using cameraOverlayView, but I don't believe it can be done that way.
So is there any way to solve this?
Thanks
Actually the videos are always recorded in landscape-right regardless of the device orientation b/c that's how the sensor is oriented in the hardware (although you can request rotated buffers in AVFoundation). However there's a flag stored as video metadata that describes the device's orientation during recording and this is used during playback to rotate the content. See AVAssetTrack preferredTransform.
If you don't want your video to be rotated, just discard this information during playback.

Play Video in Background of UIViewcontroller-iOS

I want to play video (.mp4 format) in background continuously(on loop). I tried using the MediaPlayer,AVFoundation but i didn't get the desired result.
I used another method after converting mp4 to gif, .gif worked for me but the quality was low. So please help me find the best method to solve my problem.
For what purpose is this? If you're trying to have a video background for a login screen or something of that sort, its better to stick with lower res GIFs. It will save you memory, infact you can get really high quality GIFs from .mp4 files using photoshop but the resolution and frames will eat up iPhone's memory.
You can create AVPlayer object in AppDelegate.
Then register its "MovieFinished" observer. In that notification, you can restart the video playing.
Hope this helps.

Play the same sound when start/stop recording video with AVCaptureMovieFileOutput that is heard in device's camera app?

I am creating a camera app that uses AVFoundation.
When I take a picture with my AVCaptureStillImageOutput object, it makes the same "shutter" noise that the default camera makes without me needing to tell the AVCaptureStillImageOutput to do so, which is great.
What I am wondering is if it is possible to get AVCaptureMovieFileOutput make the same "ding" noise that is heard when the user starts/stops recording video through the camera app?
If not, I guess I will need to have my own noise in the app's bundle and play it when the user starts/stops recording...
Thanks in advance!
Yes, you can:
AudioServicesPlaySystemSound(1117); // Video start sound
AudioServicesPlaySystemSound(1118); // Video stop sound
A full list of available system sound codes is here: http://iphonedevwiki.net/index.php/AudioServices

Simple way to capture a high quality image with AVCapture

All I need to do is capture an image, and all I can find is complicated code on capturing video or multiple frames. I can't use UIImagePickerController because I do not want to see the camera shutter animation and I have a custom overlay, and my app is landscape only. What is the simplest way to manually capture an image from the front or back live camera view in the correct orientation? I don't want to save it to the camera roll, I want to present it in a view controller for editing.
Take a look to the SquareCam (http://developer.apple.com/library/ios/#samplecode/SquareCam/Introduction/Intro.html) example from Apple. It contains all what you need for high-quality capture of images. I recently copy-pasted the code from this project myself where I solved the same task as you. It works well :)

Resources