ExifTool Forum

ExifTool => Newbies => Topic started by: Rerol on March 01, 2020, 04:20:56 PM

Title: subfolder processing does not work
Post by: Rerol on March 01, 2020, 04:20:56 PM
subfolder processing does not work,
what am I doing wrong?

exiftool -recurse "-FileCreateDate>CreateDate" -overwrite_original * .mp4

where is the mistake?
Title: Re: subfolder processing does not work
Post by: StarGeek on March 01, 2020, 04:25:32 PM
See Common Mistake #2 (https://exiftool.org/mistakes.html#M2) and read the docs on the -r (recurse) option (https://exiftool.org/exiftool_pod.html#r-.--recurse).

Using the -r option is only meaningful if you are processing a directory.  By using the asterisk, you are passing file names.  Change * to a dot . and recurse will work.
Title: Re: subfolder processing does not work
Post by: Rerol on March 02, 2020, 01:40:21 PM
Quote from: StarGeek on March 01, 2020, 04:25:32 PM
Using the -r option is only meaningful if you are processing a directory.  By using the asterisk, you are passing file names.  Change * to a dot . and recurse will work.

I tried the new code, but it does not work on subfolders.
exiftool -r. "-FileCreateDate>CreateDate" -overwrite_original *.mp4
Title: Re: subfolder processing does not work
Post by: Rerol on March 02, 2020, 01:56:53 PM
I managed,
exiftool -r. * "-FileCreateDate> CreateDate" -overwrite_original * .mp4

It is right?

but a lot of errors, it starts to process all files, not just * .mp4, but also others. How to fix it ?
Title: Re: subfolder processing does not work
Post by: sevy on March 02, 2020, 02:53:13 PM
did you try to change *.mp4 by "-ext mp4"  ?
Title: Re: subfolder processing does not work
Post by: Hayo Baan on March 02, 2020, 03:05:26 PM
Quote from: sevy on March 02, 2020, 02:53:13 PM
did you try to change *.mp4 by "-ext mp4"  ?

While -ext mp4 is in fact the best solution (see FAQ for the various reasons why), the problem was the space after the * in the command used (it read * [space] .mp4 instead of *.mp4. The former matches everything and a file called .mp4 (which probably doesn't exist) while the latter will only match files ending in *.mp4.

Enjoy,
Hayo
Title: Re: subfolder processing does not work
Post by: Rerol on March 02, 2020, 04:04:47 PM
Quote from: sevy on March 02, 2020, 02:53:13 PM
did you try to change *.mp4 by "-ext mp4"  ?

yes, now everything works!
thanks

how to combine two code commands?
exiftool -r. * "-FileCreateDate>CreateDate" -overwrite_original -ext mp4
and
exiftool -r. * "-CreateDate-=0:0:0 3:0:0" -overwrite_original -ext mp4
Title: Re: subfolder processing does not work
Post by: StarGeek on March 02, 2020, 04:58:04 PM
The dot, which represents the current directory, needs to have a space between it and the -r.  Or event place it separately at the end of the line.  Or list the entire directory path.

The asterisk should be removed completely, as mentioned in the links in my first post.