将元数据从一个文件批量复制到另一个文件(EXIFTOOL) [英] Batch copy metadata from one file to another (EXIFTOOL)

查看:100
本文介绍了将元数据从一个文件批量复制到另一个文件(EXIFTOOL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在终端/cmd中使用诸如exiftool -FileModifyDate(<)datetimeoriginal等之类的标签...

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

我从icloud切换,元数据中的日期是exif(意思是finder和Windows资源管理器只看到它们的下载日期).

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

它可以正常工作,但是对于M4V的任何sloMo视频,它们都不会改变..我有确实有正确日期的原件,并且想知道是否有一种匹配文件名的方法(123.mp4 = 123.m4v)并将元数据复制到...,但我也想分批处理. (因为每个月以来,我都会每个月左右卸下iphone)谢谢!

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!

推荐答案

这将取决于您的目录结构,但是您的命令应如下所示:
exiftool -TagsFromFile %d%f.mp4 "-FileModifyDate<datetimeoriginal" -ext m4v DIR

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

这假定m4v文件与mp4文件位于同一目录中.如果不是,请将%d更改为mp4文件的目录路径.

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.

故障:
-TagsFromFile:指示exiftool将标签从一个文件复制到另一个文件. %d%f.mp4:这是副本的源文件. %d是用于正在处理的当前m4v文件目录的exiftool变量. %f是当前正在处理的m4v文件的文件名,不包括扩展名.要记住的是,您正在处理DIR中的m4v文件,并且此参数告诉exiftool如何找到标签副本的源mp4文件.一个常见的错误是认为exiftool进行反向操作时,exiftool正在查找要复制到目标文件(m4v)的源文件(在这种情况下为mp4).
"-FileModifyDate<datetimeoriginal":您要执行的标签复制操作.将文件中的DateTimeOriginal标记复制到系统FileModifyDate.
-ext m4v:仅处理m4v文件.

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.

用要处理的文件名/目录路径替换DIR.添加-r以递归到子目录中.如果此命令在Unix/Mac上运行,请对任何双引号/单引号进行反向处理,以避免bash解释.

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.

这篇关于将元数据从一个文件批量复制到另一个文件(EXIFTOOL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆