Find all *.mp4 in dir tree which do NOT contain "GPScoordinates" header field?

Started by pstein, June 17, 2024, 01:41:02 AM

Previous topic - Next topic

pstein

How can I list (with exiftool) all *.mp4 (or *.jpg) files in a directory tree with top folder D:\photos\travel\*  which do NOT contain a header field "GPScoordinates" (in group "UserData")?

Phil Harvey

exiftool -ext mp4 -ext jpg -if "not $userdata:gpscoordinates" -r -filepath -s3 D:/photos/travel > filelist.txt

- 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 ($).

pstein

@Phil Harvey:

It works - almost (I did not use your redirection to filelist).

1.) As I found out each found file is output twice in CmdPrompt e.g.

======== D:/photos/travel/20201023_141248.mp4
D:/photos/travel/20201023_141248.mp4

How can I tell exiftool to only show one line per found file?


2.) Sometimes (rarely) I got not only matches like in 1.) but an additional Warning comment like:

======== D:/photos/travel/20201013_111233.mp4
Warning: [Minor] Tag 'userdata:gpscoordinates' not defined - D:/photos/travel/20201013_111233.mp4

When is "Warning: [Minor] Tag 'userdata:gpscoordinates' not defined" prepended and when not?



Phil Harvey

Sorry, I should have added -q to suppress the informational messages.

I don't know why that warning is issued, but warnings are sent to stderr so if you use the redirection as I did (stdout only) then filelist.txt shouldn't contain the warnings.

- 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

One thing to take note of, JPEGs will never have a UserData:GPSCoordinates tag. That is a Quicktime tag and will only appear in videos.

In JPEGs, GPS coordinates are saved as separate Latitude/Longitude and reference directions (four separate tags). For those, you could check for one or the other of those tags or for the Composite:GPSPosition tag.
* 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).

pstein

Quote from: Phil Harvey on June 17, 2024, 09:39:42 AMI don't know why that warning is issued, but warnings are sent to stderr so if you use the redirection as I did (stdout only) then filelist.txt shouldn't contain the warnings.

Meanwhile I found the reason for the additional "Warning: [Minor] Tag 'userdata:gpscoordinates' not defined -"

It is shown whenever the file name contain a german umlaut (like  ä ö ü)

Is exiftool not able to cope with these characters?

StarGeek

Quote from: pstein on June 19, 2024, 09:59:47 AMIs exiftool not able to cope with these characters?

This is FAQ #18, problems with special characters on the Windows command line.

Basically, Windows command line sucks when dealing with these characters (Mac/Linux have no problem). You can try the workarounds there to see if anything works for you. For me, the StackOverflow answer was the only thing that worked. But that answer may alter the fonts of older programs, example here.
* 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).