Hello everyone, I am new here and Im just trying to understand ios photos app.
I understand that ios uses a DCIF specification for media files. How do I make the photos app more meaningful for photos and videos? For example, i know that for both photos and videos the filenaming is IMG_XXXX which is a bit odd..considering videos are different from photos
instead of IMG_xxxx how do i change it to...IMG_YYYYMMDD_HHMMSS to make sense more OR VID_YYYYMMDD_HHMMSS?
Thanks for the question. A few clarifications first:
- The naming convention you're describing (
IMG_XXXX, files in aDCIMfolder) comes from the DCF specification — Design rule for Camera File system, established by JEITA. Most digital cameras, including iOS devices, follow it for interoperability with computers and other devices. The system Camera app uses DCF naming, and that behavior isn't user-configurable. You can't change how the built-in Camera app names the files it creates. - However, you can build your own camera app that uses any naming convention you like — including
IMG_YYYYMMDD_HHMMSSfor photos andVID_YYYYMMDD_HHMMSSfor videos. The same public frameworks the Camera app uses are available to every developer. - One thing to keep in mind: even after you give a captured file a custom filename, the Photos app displays photos by date in its main UI rather than by filename. Filenames are visible in the asset's info panel, not the main grid view. So a custom filename helps when you export or share files, or view them in the Files app, but it doesn't change the grid display in the Photos app.
Documentation for camera related APIs:
- AVFoundation — the framework for camera capture itself. You'd use
AVCaptureSession,AVCaptureDevice,AVCapturePhotoOutput, andAVCaptureMovieFileOutputto configure the camera and capture photos or video. At capture time, you write the file to a path on disk with whatever name you choose (for example,IMG_20260519_143215.jpgbased on the current date and time). - PhotoKit — the framework for saving to the photo library. Use
PHAssetCreationRequestwithaddResource(with:fileURL:options:)to add your captured file.PHAssetCreationRequestpreserves the filename you provided as the asset'soriginalFilename(accessible later viaPHAssetResource.originalFilename), even though the system assigns its own internal asset identifier. - Image I/O — the lower-level framework for reading and writing image metadata directly (EXIF, IPTC, GPS, and so on). You'd use
CGImageDestinationif you need finer control over metadata than what AVFoundation and PhotoKit provide.
A good starting point is the AVCam: Building a camera app sample code — it's a complete working camera app built on AVFoundation. Reading and running it is the fastest way to understand how the capture, naming, and library-save pieces fit together. From there, customizing the filename is a small change in how you write the captured file.
If your goal is to change how the system Camera app names files (rather than building your own), there isn't a developer API for that — the DCF naming is system behavior, applied uniformly across iOS.