Batch copy metadata from one file to another (EXIFTOOL)

旧城冷巷雨未停 提交于 2020-02-25 04:35:08

问题


Im currently using tags such as exiftool -FileModifyDate(<)datetimeoriginal, etc. in terminal/cmd...

Im switching from icloud and the dates in the metadata are exif (meaning finder and windows explorer just see the date they were downloaded)..

It's working but for any sloMo videos that are M4V, they dont change.. I have the originals which do have the right dates and was wondering if there is a way to match file names (123.mp4 = 123.m4v) and copy the metadata over... But I also want to do it in batches. (since every month I will be offloading my iphone every month or so) Thanks!


回答1:


It will depend upon your directory structure, but your command should be something like this:
exiftool -TagsFromFile %d%f.mp4 "-FileModifyDate<datetimeoriginal" -ext m4v DIR

This assumes the m4v files are in the same directory as the mp4 files. If not, change the %d to the directory path to the mp4 files.

Breakdown:
-TagsFromFile: Instructs exiftool that it will be copying tags from one file to another.
%d%f.mp4: This is the source file for the copy. %d is a exiftool variable for the directory of the current m4v file being processed. %f is the filename of the current m4v file being processed, not including the extension. The thing to remember is that you are processing m4v files that are in DIR and this arguments tells exiftool how to find the source mp4 file for the tag copy. A common mistake is to think that exiftool is finding the source files (mp4 in this case) to copy to the target files (m4v) when exiftool is doing the reverse.
"-FileModifyDate<datetimeoriginal": The tag copy operation you want to do. Copies the DateTimeOriginal tag in the file to the system FileModifyDate.
-ext m4v: Process only m4v files.

Replace DIR with the filenames/directory paths you want to process. Add -r to recurse into sub-directories. If this command is run under Unix/Mac, reverse any double/single quotes to avoid bash interpretation.



来源:https://stackoverflow.com/questions/51353428/batch-copy-metadata-from-one-file-to-another-exiftool

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!