Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ambrosia7177

macrumors 68020
Original poster
Feb 6, 2016
2,049
394
I have some questions about video file timestamps...

First, when I shoot a video on my iPhone - either using the native Camera app or some 3rd-party camera app - how does iOS assign a timestamp to the video file (.MOV)?

Then when I view that video file (.MOV) in Finder on my MacBook Pro, how is the timestamp displayed?


Here is the reason for my questions...

I shoot a million photos and videos each year, and I would like to start renaming my files using a timestamp to make things more easily identifiable.

Having a sequential/incremental counter as a filename isn't a very good design. First, it is meaningless to me, and second I consistently "turn over" the counter and then I get "file collisions" because I have multiple video/photo file with the same name?!

Ideally I would like to use a timestamp of when the video *started*.

So if I started shoot on Sept 5, 2024 at 2:00pm and shot a video that was 30-minutes long, I might have a filename like "iPhone_2024-09-05_140000.mov"

But first I need to understand what timestamps my iPhone is putting in the metadata, and when I view a file like "IMG_2051.mov", I need to be able to find the timestamp that I want (e.g. Sept 5, 2024 at 2:00pm)

Thanks!
 

DanteHicks79

macrumors 6502a
Sep 19, 2019
642
8,199
Silicon Valley
I have some questions about video file timestamps...

First, when I shoot a video on my iPhone - either using the native Camera app or some 3rd-party camera app - how does iOS assign a timestamp to the video file (.MOV)?

Then when I view that video file (.MOV) in Finder on my MacBook Pro, how is the timestamp displayed?


Here is the reason for my questions...

I shoot a million photos and videos each year, and I would like to start renaming my files using a timestamp to make things more easily identifiable.

Having a sequential/incremental counter as a filename isn't a very good design. First, it is meaningless to me, and second I consistently "turn over" the counter and then I get "file collisions" because I have multiple video/photo file with the same name?!

Ideally I would like to use a timestamp of when the video *started*.

So if I started shoot on Sept 5, 2024 at 2:00pm and shot a video that was 30-minutes long, I might have a filename like "iPhone_2024-09-05_140000.mov"

But first I need to understand what timestamps my iPhone is putting in the metadata, and when I view a file like "IMG_2051.mov", I need to be able to find the timestamp that I want (e.g. Sept 5, 2024 at 2:00pm)

Thanks!

Any decent video editing software should be applying SMPTE timecode to the video file when you import it into your editor, by reading the date/time listed in the meta-data of the video file. That's the only real critical timestamp you need in video.
 

Ambrosia7177

macrumors 68020
Original poster
Feb 6, 2016
2,049
394
Any decent video editing software should be applying SMPTE timecode to the video file when you import it into your editor, by reading the date/time listed in the meta-data of the video file. That's the only real critical timestamp you need in video.

Thanks, but I wasn't asking about video-editing, nor about "timecodes"...

I am asking if I shot an iPhone video start at Noon and it lasts for 30 minutes, if the .mov file will have a timestamp of Fri, Sept 6, 2024 @ 12:00:00 or Fri, Sept 6, 2024 @ 12:30:00...

Also, I am asking if macOS and Finder will provide one timestamp, both timestamps, or something else.

If I go and look at a video I shot FOUR YEARS AGO, what would any and all timestamps mean - because I have no clue of the Who/What/When/Where after 4 days let alone 4 years!
 

Slartibart

macrumors 68040
Aug 19, 2020
3,142
2,817
there are several ways to use the date created or EXIF meta data to rename files accordingly. What version of macOS? Here is a thorough explanation and example how to do this from the terminal. Using the terminal this:

for f in *.MOV; do D=$(date -r $(stat -f %B "$f") +%Y-%m-%d-%H-%M-%S); mv "$f" "$D-$f"; done

will rename all .MOV files in the current folder based on their creation date. I recommend testing it in a test folder with a few copied videos to see wether it does what you need.
 
  • Like
Reactions: Ambrosia7177

HobeSoundDarryl

macrumors G5
In my experience, depending on file timestamps for some kind of file management will prove to be frustrating.

While you- OP- don't seem to want to hear it, best option for file management IMO is edit your videos in a video editor and then tag them with dates (ideally along with titles, descriptions, etc). Then the tags will keep them organized like extensive music collections in the Music/iTunes app. With music, it doesn't matter when you ripped the CD (the date of the rip) but you can still easily organize all music together in many ways based upon how it is tagged. If music revolved around date of rip, updates to files (such as a re-rip) would alter dates.

If these are "home movies," I suggest tagging them as TV shows to organize them by year (aka "TV Show SEASON) and then episode numbers to get them in date order (like you seem to want). That way Christmas (video(s)) 2022 will be in season 2022, separate from Christmas 2021 which will be in Season 2021... and so on. While I don't have "millions", I do have hundreds of edited videos from probably thousands to tens of thousands of clips organized like this and I can very quickly get to any video I wish to see.

I store the files in year named folders: 2024, 2023, 2022, 2021 etc and name the final edits with 2 digit year/month/day starting the names like. 231225Christmas.m4v, 221225Christmas.m4v, etc. The folder names are only to make individual files quick to find in Finder... the naming convention is only to make them quick to find within each year folder.

On a device like AppleTV, they are all accessible in the TV Shows tab, by season (year), in episode (tag) order. AppleTV doesn't care if they are all stored in one big folder or by year named folders, nor care that all of the underlying files start with 6 digits of numbers. The names that show in each season are the title names of each edited "show." So I see "Christmas" as a file name in a season on AppleTV but the. underlying file might be named 231225Christmas.m4v in a folder named 2023.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,996
8,887
A sea of green
I suggest making a small test video, then moving it through your transfer pathways to discover how dates are affected. When I did this using an iPad mini camera, I found that connecting the iPad mini to a Mac and using "Image Capture" both showed the creation date and preserved it when imported to the Mac. Your result may vary, depending on exactly how you transfer the file, and possibly the versions of software involved (OS and app).

My test video was only 5 secs, and I didn't note the exact time I started or ended the video. Both the creation date and last-modified date of the original video were identical, so doing an initial rename based on either one would work.

I used the Finder's "Get Info" window to check dates on the file, along with the 'mdls' command in a Terminal window. They both showed the same creation and modified dates. The 'mdls' command was piped to a 'grep' command, because I didn't feel like manually searching the output.
Code:
mdls PATH_TO_VIDEO | grep -i date
This listed all the available Spotlight metadata that has the word "date", using a case-insensitive search.

I don't know whether there are metadata tags for dates, such as EXIF, in the video or not. The Spotlight metadata items with "FS" in their name are definitely from File System dates, and should match what Get Info shows. If there are EXIF tags, then the well-known tool 'exiftool' should show them:
 
  • Like
Reactions: Ambrosia7177

Slartibart

macrumors 68040
Aug 19, 2020
3,142
2,817
If I go and look at a video I shot FOUR YEARS AGO, what would any and all timestamps mean - because I have no clue of the Who/What/When/Where after 4 days let alone 4 years!
I am a bit lost now - so why rename then using time stamps?

iOS/iPadOS (at least >= 17.x)assign a creation date to a file or a folder:

IMG_6816.jpeg


As @chown33 already indicated, macOS keeps the creation date of a copied file as well as the last modified.
As chown33 also indicated: it will probably matter how you transfer the videos to your Mac(or any other computer for that matter). If you record e.g. a HEIV video and “share“ it via some app, it probably will converted to MP4 and it is possible, that the original creation date is not preserved. So - again indicated already - check your transfer/work flow.

Spotlight will be the fastest solution to find all videos taken e.g. 10th of june till 13th of june 2015 on a Mac. Obviously you then can further filter in the Spotlight GUI or you go and use mdfind in the terminal:

mdfind "kMDItemFSName == '*.mov'" AND created:10/06/2015-13/06/2015

CAVEAT: mdfind in the terminal uses the locale date format you have set on your Mac.

there are option to drill down further on modification dates, file sizes, file type, and obviously file names, etc.

@chown33 even if the is no EXIF meta data, you can use exif tool to get the creation and modified dates of files. In fact I was originally thinking to copy&paste one of my small scripts which uses exiftool - but then I guessed that it would be slightly overkill. 😃
 
Last edited:

Ambrosia7177

macrumors 68020
Original poster
Feb 6, 2016
2,049
394
Sorry for the late response - drowning in work!


I am a bit lost now - so why rename then using time stamps?

Because I think in terms of "time".

"Photo of pretty leaves in Vermont.jpg" doesn't mean as much to me as "IMG_2024-09-10_Vermont Leaves.jpg" does.

Same for my videos - especially because I am doing interviews and by nature they are sequential and time-based.

Timestamp are also UNIQUE.


As @chown33 already indicated, macOS keeps the creation date of a copied file as well as the last modified.
As chown33 also indicated: it will probably matter how you transfer the videos to your Mac(or any other computer for that matter). If you record e.g. a HEIV video and “share“ it via some app, it probably will converted to MP4 and it is possible, that the original creation date is not preserved. So - again indicated already - check your transfer/work flow.

Spotlight will be the fastest solution to find all videos taken e.g. 10th of june till 13th of june 2015 on a Mac. Obviously you then can further filter in the Spotlight GUI or you go and use mdfind in the terminal:

mdfind "kMDItemFSName == '*.mov'" AND created:10/06/2015-13/06/2015

CAVEAT: mdfind in the terminal uses the locale date format you have set on your Mac.

there are option to drill down further on modification dates, file sizes, file type, and obviously file names, etc.

@chown33 even if the is no EXIF meta data, you can use exif tool to get the creation and modified dates of files. In fact I was originally thinking to copy&paste one of my small scripts which uses exiftool - but then I guessed that it would be slightly overkill. 😃

I copy video/photos from my iPhone to my MBP using iMazing.

Unlike "Image Capture" - which SUCKS - iMazing doesn't drop files and as far as I know, it doesn't screw with the original timestamps.

But back to my original question...

I simply wanted to know if there is a timestamp associated with my iPhone videos that is the START TIME (and DATE) of the video and not the end time - which is how I think iOS works.
 

Slartibart

macrumors 68040
Aug 19, 2020
3,142
2,817
I simply wanted to know if there is a timestamp associated with my iPhone videos that is the START TIME (and DATE) of the video and not the end time - which is how I think iOS works.
no. or better: that might depend on the camera app you are using. iOS and iPadOS will save the date and time stamp when you start recording with e.g. Apple’s Camera. this date will - as long you do not convert - persist and you will find these file for example with spotlight when you look for “date created”.

In case you really want to rename - which seems IMHO redundant because you still would use Spotlight to find these files - try this from the terminal:

cp /folderpath/to/your/movie.mp4 ~/Documents/$(date +%Y-%m-%d -r movie.mp4)movie.mp4

that should create a copy of movie.mp4 in your Documents folder renamed with the last modification date. If you adjust the date parameter to your liking, replace cp with mv to move the movie instead. A simple loop can be used to iterate this then over some folder(s).
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.