iOS Camera app code

What's the underlying code for ios's camera app ? like how does it assign metadata and filename? is it java or something else ? Can another app be created to use the same basic code with added extra features ?

Answered by DTS Engineer in 888423022

Hey @anmac1789,

It sounds like you'd like to make a camera app, so I recommend that you start with AVCam: Building a camera app.

The underlying code for the system's Camera app is not available, and we can't provide details about it, but the sample code project I linked to above can hopefully help you with your camera app development!

-- Greg

Hey @anmac1789,

It sounds like you'd like to make a camera app, so I recommend that you start with AVCam: Building a camera app.

The underlying code for the system's Camera app is not available, and we can't provide details about it, but the sample code project I linked to above can hopefully help you with your camera app development!

-- Greg

Ok, and that AVCam thing, does it use the same ...uhh for lack of better description, quality and metadata description as the original camera app ?

AVCam leverages the AVCapture APIs. In short, these APIs give you a great deal of flexibility to build a high-quality camera app.

With AVCaptureSession, your app can capture photos with 48 MP resolution (on devices that support it). When you are considering capture quality for your app, you should read over the photoQualityPrioritization documentation.

When you capture a photo with AVCapturePhotoOutput, you receive an AVCapturePhoto object, which contains photo metadata.

-- Greg

I want to know if I can make a camera app that stores the initial camera shutter button in memory so that after the picture is saved, the date taken and date modified timestamp is the same. How can I do that ?

Hey @anmac1789,

I'm not sure I'm following what you'd like to do here, can you clarify your goal?

When you capture a photo with AVCapturePhotoOutput, the AVCapturePhoto will automatically have timestamp information embedded in its metadata.

So at what point does AVCapturePhotoOutput assign a photos capture taken timestamp ?

@anmac1789, The timestamp is documented as "The time at which the image was captured."

Depending on your configuration, "the time at which the image was captured" might align with different points in the user's capture process. For example, if you have zeroShutterLag enabled, the system "time travels" to use a capture from before the capture button was actually pressed.

-- Greg

does zero shutter lag compromise on photo quality over speed? whats the difference in timestamp allocation between zeroshutter lag vs. just normal photo taking ?

When zero shutter lag isn't used, does the timestamp get assigned to when the shutter button is pressed, during pressing, after letting go of the shutter button ?

what is the true actual time a photo is taken and saved ? that's the deeper detail im trying to understand

Hey @anmac1789,

does zero shutter lag compromise on photo quality over speed?

I recommend that you watch Create a more responsive camera experience to learn about the relationship between Zero Shutter Lag and capture quality.

whats the difference in timestamp allocation between zeroshutter lag vs. just normal photo taking ?

I can't provide a specific difference here, other than to say that with Zero Shutter Lag the timestamp will be earlier (because it uses a capture taken before the button was pressed).

When zero shutter lag isn't used, does the timestamp get assigned to when the shutter button is pressed, during pressing, after letting go of the shutter button ?

This would depend on how the button UI is implemented. I.e. whether the button UI calls capturePhoto on initial press, during press, or after letting go.

what is the true actual time a photo is taken and saved ? that's the deeper detail im trying to understand

I can't provide any detail more specific than what's documented, which is that the timestamp represents "the time at which the image was captured."

-- Greg

I am relatively new to swift programming Im trying to learn as much as I can, so is there like some animation that shows the timeline of code being executed to when the capture image is generated ?

Hey @anmac1789,

so is there like some animation that shows the timeline of code being executed to when the capture image is generated ?

Not exactly, you could use signposts and Instruments to help you visualize this timeline though. For example, you could "begin" a signpost in your code when you call capturePhoto, and then you can "end" the signpost when you receive that photo in the AVCapturePhotoCaptureDelegate.

See Recording Performance Data for more information about signposts and Instruments.

Alright, I'll just have to try that but, is there a camera app out there that can set custom filename or watermarks but that uses the similar or same camera codes that native ios system camera uses ?

iOS Camera app code
 
 
Q