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

pixelmac

macrumors newbie
Original poster
Aug 28, 2006
5
0
Hello,

How can I batch convert videos and preserve creation dates.
I have a big collection of family video that I want to convert, but preserving the dates is crucial for sorting by date after.

Any ideas if the creation date can be transfered to the video EXIF of similar ?

Sincerely

Pixelmac
 
Hello,

How can I batch convert videos and preserve creation dates.
I have a big collection of family video that I want to convert, but preserving the dates is crucial for sorting by date after.

Any ideas if the creation date can be transfered to the video EXIF of similar ?

Sincerely

Pixelmac

If you plan to use HandBrake and can compile its sources yourself, you'll want to read https://reviews.handbrake.fr/r/55/diff/1/ .. Unfortunately, there still isn't a "preserve original filedate" checkbox in the current HB version.

Also, for other tools, take a look at http://superuser.com/questions/4828...keeping-the-original-time-stamp-creatuib-date . I haven't myself checked out BulkFileChanger there - hope it knows what you need.
 
You can use the touch command from the Terminal to modify the creation date. The format of the command is:
Code:
touch -mt [[CC]YY]MMDDhhmm[.SS]]

So to set the creation date of the file to Jan. 24th, 1984 at 5:30PM, you'd use:
Code:
touch -mt 198401241730
Be careful, though—you can only set creation dates backwards, not forwards, so if you accidentally set them too early you won't be able to change them (without making a new copy of the file, anyway).

As for how to do it in batch? Well, you could write a shell script to do it. You might also have some luck with Automator. The exact method kind of depends on how you're naming your files as you convert them. Basically, you want to be able to match up the old files to the new files, then read the dates off the old files and apply them to the new files using touch.
 
If you want to preserve creation dates you might want to take a look at the -r option of the touch command.

From the touch man page :

NAME
touch -- change file access and modification times

SYNOPSIS
touch [-acfm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...

DESCRIPTION
The touch utility sets the modification and access times of files to the
current time of day. If the file doesn't exist, it is created with
default permissions.

The following options are available:

-r Use the access and modifications times from the specified file
instead of the current time of day.
Info : Applescript for matching creation date on two files
 
Last edited:
If you plan to use HandBrake and can compile its sources yourself, you'll want to read https://reviews.handbrake.fr/r/55/diff/1/ .. Unfortunately, there still isn't a "preserve original filedate" checkbox in the current HB version.

Also, for other tools, take a look at http://superuser.com/questions/4828...keeping-the-original-time-stamp-creatuib-date . I haven't myself checked out BulkFileChanger there - hope it knows what you need.

I've just found a much easier way of this:

1, get HandBrakeBatch from http://www.osomac.com/apps/osx/handbrake-batch/

2, go to Preferences and enable the "Keep original file creation and modification dates" checkbox in the default "General" tab:

hbb-origfiledate.png


3, drag-and-drop your source files to the list

4, start converting.
 
Is there any alternative to this now that HandBrakeBatch is not longer supported? I am trying to convert a bunch of old family videos that have codecs not supported by Photos and need to convert them, but manually resetting the dates would be nearly impossible for so many files.
 
A bit too late to the party but this might help other people... when you are converting/compressing .mov files to .mp4 with handbrake, indeed the creation date will be as of now. It also won't preserve apparently, some of the metadata like GPS coordinates. This script, executed in bash, will do both.

Just make sure you have the original .mov and .mp4 named the same, in the same folder. You can excerpt the commands from here anyway. The script will do multiple files if present.

Bash:
# if you want to keep exif data , GPS location etc:
brew install exiftool

# in the current folder, check all files named *.mov

for f in *.mov; do
export originalfile=$(echo ${f} | sed 's/\.mov//g')

echo
echo $originalfile

# copy metadata from mov file to mp4 file
exiftool -TagsFromFile $originalfile.mov -all:all $originalfile.mp4

# copy creation date from mov file to mp4 file
touch -r $originalfile.mov $originalfile.mp4

# optional (remove comment) remove original file and backup from exiftool
# rm $originalfile.mov $originalfile.mp4_original

done
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.