ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: camner on April 19, 2017, 06:45:46 PM

Title: TagsFromFile for whole folder with paralleled named files
Post by: camner on April 19, 2017, 06:45:46 PM
I have a folder full of files in two version, one original and one edited.  Each pair has the same file name but different extension.  Is there a way I can specify an exiftool command that would invoke the TagsFromFile command so that that the tags from the original video in each pair would be copied to the corresponding edited video in each pair?  It is tedious to have to do each pair by hand!

Thanks.
Title: Re: TagsFromFile for whole folder with paralleled named files
Post by: StarGeek on April 19, 2017, 11:03:32 PM
Try something like this
exiftool -tagsfromfile /path/to/source/files/%f.MP4 -ext MKV TargetDirectory

This example assumes that the source files are MP4s and the targets are MKVs.  Change as needed.  Also, double check to make sure that exiftool can actually copy the tags, as not all video tags can be copied.
Title: Re: TagsFromFile for whole folder with paralleled named files
Post by: camner on May 04, 2017, 01:00:48 AM
Thank you.  This worked wonderfully!

For me, typically the source directory and target directory will be the same.  I thought that perhaps I could leave off TargetDirectory, but that didn't work.  Is there a shorter version of the command if the source and target directories are the same?
Title: Re: TagsFromFile for whole folder with paralleled named files
Post by: StarGeek on May 04, 2017, 03:41:16 AM
Quote from: camner on May 04, 2017, 01:00:48 AM
I thought that perhaps I could leave off TargetDirectory, but that didn't work.

Nope, need a source and a target.

QuoteIs there a shorter version of the command if the source and target directories are the same?

Try
exiftool -tagsfromfile %d%f.MP4 -ext MKV TargetDirectory
Title: Re: TagsFromFile for whole folder with paralleled named files
Post by: Phil Harvey on May 04, 2017, 08:24:35 AM
Quote from: StarGeek on May 04, 2017, 03:41:16 AM
exiftool -tagsfromfile %d%f.MP4 -ext MKV TargetDirectory

Either that, or:

cd TargetDirectory
exiftool -tagsfromfile %f.MP4 -ext MKV .


- Phil