Video Conversion Workflow with Date Retention

Started by adampratt, June 18, 2020, 10:32:09 PM

Previous topic - Next topic

adampratt

I have a variety of digital video files in a variety of formats (AVI, 3GP, MOV, AVCHD, etc.) that I want to convert to a more universal cross-platform format such as MP4 with high-quality H.264 encoding. I can handle the conversion easily with something like Adobe Media Encoder.

The problem is that when I convert a video file captured in the year 2000, the capture date of the resulting MP4 file is 2020. I've tried many apps (Adobe Media Encoder, Wundershare UniConverter, Handbrake, Kyno, Telestream, and more), but none of them can retain the original digital capture date in the converted MP4 file.

This is a problem because I use Adobe Lightroom Classic to import, organize, and rename, the converted MP4 files based on their (hopefully retained) capture date.

I think the easiest solution would be to "transport" the capture dates between two sets of files (input in a variety of formats and output files in MP4). For example, if there's a file named clip01.avi in the input folder, copy the capture date of that file and inject it into the corresponding file named clip01.MP4 in the output folder.

I don't have the technical skills to solve this on my own, but I'm open to hiring an expert to build a repeatable solution (script? app?) I can use on Mac OS. Has this problem been solved already? Does somebody want to help me solve it for a fair price?

StarGeek

I'm not familiar with what time stamps might be embedded in some of those, but as a start, I'd suggest copying the file system time stamps to see that works.  The basic command would be
exiftool -TagsFromFile /path/to/original.avi -FileCreateDate -FileModifyDate /path/to/new.mp4

This can be done in batch with some more details on where the originals are located (same/different directory), if the base file names are the same, etc.  Exiftool has some variables that could represent the directories and filenames if they are similar (see -w (textout) option).

If that doesn't work, then you may have to copy some embedded time stamps.  I'm not sure what those might be for AVI, 3GP, and AVCHD files but you would check to see the tag names and values with
exiftool -time:all -g1 -a -s /path/to/files/
In this case you would have to post the output of the above command to see where to go next.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

adampratt

Thanks for your comments StarGeek. Unfortunately, I don't have the technical skills to put your suggestions into practice. I don't know the etiquette of this forum, but is there anybody in this forum available for hire to contract with me to solve this problem? I can supply sample files and specs on what I want to happen, but I'd like to hire somebody to build me a repeatable solution that would run on my Mac.

wywh

#3
You could try GraphicConverter. It uses exiftool internally so you could use it to check which date tags the movies have. Old movies might have the dates in different tags so it might be a good idea to process them (AVI, 3GP, MOV, AVCHD) separately.

I have for a long time had a habit to have the date in the filename in YYYY-MMDD-hhmm-ss format for images and movies.

If there are not many movies, you could rename them manually one by one with "2020-06-25 22.10.32.mp4" format i.e. YYYY-MM-DD hh.mm.ss which is GraphicConverter's default date format.

But if there are hundreds of movies, you could try to rename them via GraphicConverter's Browser:

1. Copy date to filename. In GraphicConverter Browser: File > Rename... > Name : Change Filename [blank if you don't want to preserve the original filename, otherwise Add text before] > Date: Add date to filename [here you could check the rename preview how Creation date, Modification date or Exif date behave and choose the best] with the default YYYY-MM-DD hh.mm.ss. If this fails, rename the files manually. Or dig deeper into the metadata to check what other dates tags there might be and use exiftool via the command line to use them.

2. Export all files to H.264 while preserving the filename from step #1. My personal favorite is MPEG Streamclip but sadly it is no longer supported in Catalina (a year ago I converted all old incompatible movies from old cell phones to H.264 in Mojave by using MPEG Streamclip's iTunes Apple TV SD preset as a starting point and then deselected interlaced scaling for these progressive movies, and maybe modified the resolution and bitrate as desired. I also rotated some movies at this step).

3. Copy filename to Creation & Modification date and QuickTime tags. In GraphicConverter Browser's EXIF menu: Set Exif Date from Filename... > YYYY-MM-DD hh.mm.ss, Set movie dates, Use UTC, Set the file date identical to the Exif date. (Notice that currently the QuickTime tags are -+1h off if the movie date Daylight Savings Time differs from the current DST. If this bothers you, a workaround is to change the computer's DST the same as the movies or use exiftool from the command line which has more options).

Make a backup before testing this!

- Matti

adampratt

Thank you Matti! I've been trying for years to solve this problem, and your idea to use GraphicConverter to "transpose" the filename into EXIF date fields was the step in the workflow that had me stuck. I almost hired a developer on Fiverr to create something with FFMPEG, but this is the missing link. Thank you so much. I just converted 337 videos to MP4 and retained all the original capture date. Perfect!

wywh

I am glad to hear that it solved your problem.

So as a minor issue GraphicConverter 11.2.1 "Set Exif Date from Filename..." currently has that problem with DST even when the UTC option is used. I.e. when now in summer you modify a winter movie, the QuickTime time is -1h off, and in winter in a summer movie it is +1h off (file creation & modification times are correct). A clumsy workaround is to disconnect from the Internet (so the clock isn't automatically set to the correct time) and set the Mac's clock to the same DST season as the movies when editing.

I have reported this to the developer but if someone knows which might cause this kind of behaviour, please chime in!

If that bothers you, you can use this similar exiftool command which handles DST correctly:

exiftool -api QuickTimeUTC=1 '-CreateDate<filename' '-ModifyDate<filename' '-Track*Date<filename' '-Media*Date<filename' -execute '-FileCreateDate<filename' '-FileModifyDate<filename' -execute '-Keys:CreationDate<FileModifyDate' '-UserData:DateTimeOriginal<FileModifyDate' -common_args -m -P -overwrite_original_in_place -wm w movies.*

I recently fixed all my old movie dates with that command so they now sort correctly with images.

https://exiftool.org/forum/index.php?topic=11184.0;all

Using exiftool via the command line is not so difficult as it sounds. Just download the MacOS Package .dmg from exiftool main page and install it via ctrl-click > Open (to bypass the security check for applications that haven't a certificate). Then, for example, put copies of the movies you want to process on the Desktop to a folder named "movies" (don't put anything else there). Then open Applications > Utilities > Terminal.app, type "cd " (notice the space) and drag that "movies" folder to the Terminal window and press Return to change to that folder (or type "cd Desktop/movies" followed by Return). Then copy & paste the previous long command without the trailing "movies.*" to the Terminal and type the filename you want to process and hit Return (if the folder is full of movies from 2001-2020, you can press "2" (maybe followed by tab) and "*" and all those are processed when you hit Return). That was a rather clumsy instruction but I guess you get the idea.

- Matti