Difference "@ -r" vs. "%d%f.%e"

Started by kana, September 07, 2020, 09:53:52 AM

Previous topic - Next topic

kana

Being a newbie, I'm pretty overwhelmed by the power, but also the complexity of the command line.
I have dived in some details, but what I don't seem to grasp yet is the difference between two ways to address files in batch processing.

Consider this example that copies all tags from the src directory to all mp4 files of otherwise same name in the dest directory:

exiftool -tagsfromfile ./src/%f.mov -ext mp4 ./dest

During my investigations for this command, I ran several times over an alternative implementation similar (!) to this

exiftool -tagsfromfile @ -r -ext mp4 ./dest  -sourcefile ./src/%f.mov.   # watch out, this command doesn't work

I'v got two questions here:
When would the one or the other way be chosen? I don't get the conceptual difference behind each of the two alternatives.

And as I get errors with the second one ("Warning: No writable tags set from ./dest/1.mp4"), what is happening here, and what would be correct version that accomplishes the same as above? I don't seem to be able to sort this question out.




Phil Harvey

-tagsfromfile @

is equivalent to

-tagsfromfile %d%f.%e

and copies tags from the source file into itself.

Neither is what you want if you are copying from MOV to MP4 files.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Quote from: kana on September 07, 2020, 09:53:52 AM
exiftool -tagsfromfile @ -r -ext mp4 ./dest  -sourcefile ./src/%f.mov.   # watch out, this command doesn't work

Two main problems with this.  First, there is no sourcefile option.  What you're probably looking for is the -srcfile option.

Second, this looks for a file with an extension of mov(Dot), a four character extension.

-TagsFromFile @ and -srcfile are conflicting sources.
* 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).

kana

Quote from: Phil Harvey on September 07, 2020, 10:47:21 AM
-tagsfromfile @
...
copies tags from the source file into itself.
That's the point I was missing, got it!

Quote from: StarGeek on September 07, 2020, 12:57:41 PM
Two main problems with this.  First, there is no sourcefile option.  What you're probably looking for is the -srcfile option.
Second, this looks for a file with an extension of mov(Dot), a four character extension.
-TagsFromFile @ and -srcfile are conflicting sources.
You are right, I screwed the scrfile parameter and the additional dot up when I was modifying it manually for the forum.
As for the conflicting source, I thought that the scrfile parameter is used to replace the @.
This line
exiftool -tagsfromfile @  -r -ext mp4 ./dest -srcfile ./src/%f.mov
works now without warning, for whatever reason, however, as Phil pointed out, it modifies the source files rather than the files in ./dest.

In any event, the issue is solved, thanks for you help!