Hi all
Yes I am a total newbie on this sight so relegate me to the Newbie section if need be. But I've search the site and only found one relevant topic which wasn't resolved and that was back in 2016.
I want to embed mainly GPS data and Keywords but if possible Title and Author to all my movie files so that the apps I use to view, such as Aperture and Apple Photos recognises and displays in the info field. I have three main devices for video, my iPhone, Panasonic Lumix camera and a GoPro. The latter two give me .mp4 files. Whilst the iPhone .Mov. Most of the time the iPhone includes GPS info which shows in the location pane in the Photos app. But sometimes it's missing.
Can someone give me a idiots guide to add this to the files if it is possible. I'm thinking it must be possible as Apple adds it the .Mov file.
I'm also aware that .Mp4 and .Mov have different fields so I'm assuming there would be a different terminal line for each. And also different for GPS and for Keywords.
For photos I use the Exif Editor app and this works well for my for my basic requirements but it doesn't work on video files and there doesn't seem to an app that does.
Many thanks
The ability for exiftool to write to MP4/Mov files is still relatively new, but the basic procedure is the same as any of the examples you'll find throughout the site,
exiftool -TAG1=DATA -TAG2=DATA ... <FileOrDir>
The thing is that we can't tell you exactly how to add the data, as we may not have access to the programs you use. For example, I'm on Windows and use mostly free programs, so I can't figure out what data Apature and Apple Photos is reading.
Luckily, the data you're talking about appears to have the same tag name as the tag description, which isn't always the case. I'd suggest trying a command along these lines and check to see if it works:
exiftool -Quicktime:Keywords='Keyword 1' -Quicktime:Keywords='Keyword 2' -Quicktime:Author='Author Name' -Quicktime:Title=Title <File>
If that doesn't work, then you'll have to find a file that already works and follow the instructions in FAQ #3 (https://exiftool.org/faq.html#Q3) to figure out the correct tag name for that data you want to add.
In regards to GPS coordinates, I'd suggest waiting until the next version of exiftool comes out, which should be soon. There's a currently a problem with the way exiftool writes the coordinates and Apple Photos doesn't read them.
Thanks for your reply!
Ok so it may be the version of exiftool, which could explain other issues.
At the moment I'm talking with the creator of Setexifdata who's app is the closest tool I've found to achieve this. Currently the app writes the coordinates into the file. But it doesn't show. I thought it was the section the coordinates were in, currently being populated in the XMP section. But when you look at iPhone file the coordinates are in the Composite section. I thought it something as simple as just changing the location.
I'll send a link of this thread to him to see if this may shed a better light on this.
Many thanks
The Composite section is likely generating GPSLatitude/GPSLongitude tags from the QuickTime GPSCoordinates (probably stored in the Keys group if this is an Apple device).
BTW, ExifTool 11.66 is now available, and fixes a format problem when writing QuickTime GPSCoordinates.
- Phil
Hi all, back again
So I thought I'd have a play using your example above. As said I'm a total newbie but I like a challenge. My understanding was you could drag in any file you would like to edit which I have done in below example, I also typed in file name but nothing is working. Any pointers would be very much appreciated.
thanks
You need to put a SPACE in the command before you drag and drop the file.
So type this in a Terminal window:
exiftool -quicktime:keywords='Egypt'
then press the SPACE bar.
then drag and drop the file.
then press RETURN.
- Phil
Thanks Phil
That worked which is the good news. The bad is it created new file. That wouldn't be to bad except the creation and modify date on this file are totally out of sync. The original file was turned into a document which I managed to change back by deleting the 'original' at the end of the file.
The "_original" file is for backup purposes. You can add -P to the command to preserve the file modify date, but if you want to preserve the creation date the only option on Mac is -overwrite_original_in_place, but then no backup is saved.
- Phil
Ok I'll try that on an old file I'm not worried about. Would this be placed at the end of the code?
With regards to the keywords command do I have to repeat code for each keyword as above or can I group words?
I'll leave you alone now and will have a play myself.
Many thanks
Quote from: Gusman on September 30, 2019, 02:04:25 PM
Ok I'll try that on an old file I'm not worried about. Would this be placed at the end of the code?
That would be easiest, but for the most part, it can go anywhere except between an option that requires a second parameter.
QuoteWith regards to the keywords command do I have to repeat code for each keyword as above or can I group words?
Upon further checking, I may be wrong with regards to keywords, as doesn't appear to be a list type tag as keywords are in image files. I'm not sure how your programs handle them.
Hi all
Thanks for you help so far.
I've had a good play around and got some positive results. At the bottom in red is the last test I did and results are mixed but good in general.
For GPS my viewing apps, iPhoto/Aperture picked up the location and displayed. Unfortunately Photos didn't, but you did highlight this previously. It was also picked up on another third party app so I'm reasonably happy this result is good and its Apple Photos that is the issue.
Keywords also worked but the issue reversed. Apple Photos picked up the keywords but iPhoto/Aperture didn't. I prefer this result as Photos will be my main viewer and Keywords will be my main search option.
However is there a keywords option in another section such as EXIF or XMP? Is there a definitive list to useable fields I could refer to rather than testing in a command line and waiting to see if it works?
Phil, I did come across some issues which quite possibly is me but thought I'd highlight anyway.
While testing GPS, if I tried to input in the degrees/min/sec format it would change the 51 to 57 is this a bug? I only tried one set of coordinates so can't comment further as it was easier in decimal for me anyway.
For the commands in green, this issue is strange because it would never execute on the first input, I would have to input again for it to work? Should this happen or is it me?
The command in blue but also above in green. The keyword part of the command would include the file path as a keyword also. I tried more spaces and closing the keywords with a comma but nothing worked. It only worked in the last example in red.
Lastly I couldn't get the 'overwrite_original_in_place' to work as you can see in my last command, your guidance would be most appreciated :)
Last login: Tue Oct 1 00:02:02 on ttys000
Waynes-iMac:~ wayneegee$ exiftool -Quicktime:GPSCoordinates=51.634597,0.606939 -Quicktime:Keywords='Egypt' /Users/wayneegee/Desktop/Exiftool\ test/P1220568.MP4
> exiftool -Quicktime:GPSCoordinates=51.634597,0.606939 -Quicktime:Keywords='Egypt' /Users/wayneegee/Desktop/Exiftool\ test/P1220568.MP4
1 image files updated
Waynes-iMac:~ wayneegee$ exiftool -Quicktime:Keywords='Egypt' /Users/wayneegee/Desktop/Exiftool\ test/P1220567.MP4
> exiftool -Quicktime:Keywords='Egypt' /Users/wayneegee/Desktop/Exiftool\ test/P1220567.MP4
1 image files updated
Waynes-iMac:~ wayneegee$ exiftool -Quicktime:Keywords='House,Movie, /Users/wayneegee/Desktop/Exiftool\ test/P1220566.MP4
> exiftool -Quicktime:Keywords='House,Movie, /Users/wayneegee/Desktop/Exiftool\ test/P1220566.MP4
1 image files updated
Waynes-iMac:~ wayneegee$ exiftool -Quicktime:GPSCoordinates=51.634597,0.606939 -Quicktime:Keywords='House, Movie, Test overwrite_original_in_place /Users/wayneegee/Desktop/Exiftool\ test/P1220568.MP4
Error: File not found - Movie,
Error: File not found - Test
Error: File not found - overwrite_original_in_place
1 image files updated
3 files weren't updated due to errors
Waynes-iMac:~ wayneegee$ exiftool -Quicktime:GPSCoordinates=51.634597,0.606939 -Quicktime:Keywords=House,Movie,Test overwrite_original_in_place /Users/wayneegee/Desktop/Exiftool\ test/P1220567.MP4
Error: File not found - overwrite_original_in_place
1 image files updated
1 files weren't updated due to errors
Waynes-iMac:~ wayneegee$
Quote from: Gusman on October 01, 2019, 07:20:11 AM
While testing GPS, if I tried to input in the degrees/min/sec format it would change the 51 to 57 is this a bug? I only tried one set of coordinates so can't comment further as it was easier in decimal for me anyway.
Works for me (Note I had to remove the seconds double-quote because it would interfere with the overall quoting):
> exiftool -gpscoordinates="3 deg 30' 0.00sec, 5 deg 36' 0.00sec" a.mov
1 image files updated
> exiftool -gpscoordinates -gpscoordinates# a.mov
GPS Coordinates : 3 deg 30' 0.00" N, 5 deg 36' 0.00" E
GPS Coordinates : 3.5 5.6
As for the other problems, your quotes are funny and will cause problems. Make sure you use plain single quotes ('), not funny slanted quotes as you used (eg. 'Egypt').
- Phil
I've only got one quote button on my keyboard? ' or " with shift. 'Test' :-\
What are your thoughts on the overwrite issue?
Actually as to my last test line I didn't use any quote and all worked ok except the overwrite command. Excuse my ignorance but what function do the quotes perform?
The quotes are only necessary if the argument contains special characters such as SPACE, >, < or other quotes.
This stack exchange topic (https://apple.stackexchange.com/questions/136402/how-to-disable-smart-quotes) explains about your quote problem.
Your problem with the overwrite is that you forgot the dash before the option: -overwrite_original_in_place
- Phil
Absolutely superb!!
Quote mark issue sorted which fixed issue with not being able to put more than one word in title & description.
Overwrite sorted and working!
Unfortunately neither iPhoto/Aperture or Photos is picking up the title or description. I've tried in both Quicktime & XMP. I also tried in both but it didn't allow. Is that how it should work one or the other?
I wanted to do the same for keywords to try and cover all possible fields the different apps would use. Are there any hidden sections that might be used?
Thanks very much for your help!
I've now got a very labour intensive solution to embedding data onto movies files but its more than I had. Maybe I should look next to making my own app ;D
Did you implement FAQ 3 (https://exiftool.org/faq.html#Q3) to determine the tag to use for the title/description as StarGeek suggested?
- Phil
I did look at it but the only files with the info embedded is the iPhone .mov files. And they only have GPS data. Keywords,description, titles etc has no embedded info to glean from.
That is why I was asking if there a list of possible options? If there was I could at least eliminate by trial and error.
Out of curiosity, on the list produced using this feature. would you use the code in brackets i.e Track4,Keys,Composite to change that field? The reason I asked is that on a iPhone .mov file I see Quicktime as an option in brackets but the GPS data isn't in any of the Quicktime fields, its in "[Keys]-GPSCoordinates"
But did you try adding the title/description with iPhoto or Aperture to see where it goes?
- Phil
Iphoto/Aperture doesn't write to the file it just writes its own file and links it to the image
I can get it to embed to a photo file by 'exporting' the file with the data, but it won't do it to video files.
OK.
To answer your other question, you specify the location like this: -keys:gpscoordinates="some value"
- Phil
Quote from: Gusman on October 01, 2019, 11:59:45 AM
That is why I was asking if there a list of possible options? If there was I could at least eliminate by trial and error.
Take a look at the Quicktime Tags page (https://exiftool.org/TagNames/QuickTime.html). The column marked "Tag Name" would be the name to use, though it might need a group name as well if there's a similarly named XMP tag. You want to try tags that have an entry other than "no" in the writable column. The most promising groups would be the
ItemList,
UserData, and
Keys groups.
Yes I would have input as that, I was just wondering whether the bracketed text was viable for the instruction.
So I tested with the below and even better result. Both iPhoto/Aperture and Photos now show location. 8) :)
exiftool -Keys:GPSCoordinates=51.634597,0.606939 -Quicktime:GPSCoordinates=51.634597,0.606939 -overwrite_original_in_place
On a roll!! ;D
thanks Stargeek.
Hi Stargeek
got another query for as I noticed a note in your footnotes.
I am trying to the below location to read West but it continues to read East whether I make it negative or not.
-Keys:GPSCoordinates=51.393165,-0.422098
Phil, this appears to be something to look at, as an earlier version writes the E/W coordinate correctly.
C:\>exiftool -P -overwrite_original -quicktime:GPSCoordinates="51.393165, -0.422098" "Y:\!temp\Test1.mp4"
1 image files updated
C:\>exiftool -g1 -a -s -gpscoordinates "Y:\!temp\Test1.mp4"
---- UserData ----
GPSCoordinates : 51 deg 23' 35.39" N, 0 deg 25' 19.55" E
---- Keys ----
GPSCoordinates : 51 deg 23' 35.39" N, 0 deg 25' 19.55" E
C:\>exiftool_11.60 -P -overwrite_original -MetadataDate=now -quicktime:GPSCoordinates="51.393165, -0.422098" "Y:\!temp\Test1.mp4"
1 image files updated
C:\>exiftool -g1 -a -s -gpscoordinates "Y:\!temp\Test1.mp4"
---- UserData ----
GPSCoordinates : 51 deg 23' 35.39" N, 0 deg 25' 19.55" W
---- Keys ----
GPSCoordinates : 51 deg 23' 35.39" N, 0 deg 25' 19.55" W
I'll take a look at this when I get a chance, but generally I would say that if you want to write signed numerical values you should write GPSCoordinates# (and use only a space as a separator), not GPSCoordinates.
- Phil
Hi Phil
I think there is some bug. As said before I got a different value on one input earlier. I just re-tested and got the same result.
For this input i got the below. It change the 51 to 57.
exiftool -Quicktime:GPSCoordinates='51 deg 38'4.39"N,0 deg 36'24.98"E /Users/wayneegee/Desktop/Exiftool\ test/P1220568.MP4
[Composite] AvgBitrate : 27.2 Mbps
[Composite] GPSLatitude : 57 deg 24' 23.40" N
[Composite] GPSLongitude : 0 deg 36' 24.98" E
[Composite] Rotation : 0
[Composite] CircleOfConfusion : 0.010 mm
[Composite] FOV : 65.5 deg
[Composite] FocalLength35efl : 9.1 mm (35 mm equivalent: 28.0 mm)
[Composite] GPSPosition : 57 deg 24' 23.40" N, 0 deg 36' 24.98" E
[Composite] HyperfocalDistance : 3.04 m
[Composite] LightValue : 6.3
Waynes-iMac:~ wayneegee$
As I said before, you need to watch your quotes. The minutes indicator is a single quote, which messes up your quoting.
What you did was this:
'51 deg 38'4.39"N,0 deg 36'24.98"E
'---------' "----------------" <-- this is how the shell sees the quoting
Which gets interpreted by the shell as
51 deg 384.39N,0 deg 36'24.98E
And 384 minutes is a bit more than 6 degrees, which gets added to the 51 and you get 57.
- Phil
@StarGeek: I see the problem. This affects only coordinates between -1 and 0. I was using a signed integer print statement to pad with leading zeros, so the negative sign was lost since zero degrees is always positive.
I'll fix this in the next release.
- Phil
11.69 is now available, and should solve the problem of the sign begin lost when writing GPSCoordinates with values between -1 and 0.
- Phil
Ah, that makes sense now, thanks
with regards to the below quote, this I didn't understand. I know its probably me but as I understood the below is saying taking out the comma separator and just have a space, but I get error when I tried, even putting quotes in
exiftool -Quicktime:GPSCoordinates=51.634597 0.606939
exiftool -Quicktime:GPSCoordinates='51.634597 0.606939'
Quotebut generally I would say that if you want to write signed numerical values you should write GPSCoordinates# (and use only a space as a separator), not GPSCoordinates.Quote
Sorry you must get frustrated with numpty newbies like me :-[
And it probably won't matter if the new release fixes the original issue.
You forgot the hashtag
-Quicktime:GPSCoordinates#='51.634597 0.606939'
Its always something simple! :)
I thought that # was just a shortcut way of saying 'GPSCoordinates number' as an explanation!! ???
So in my mind it seems like two different ways to skin the same cat. And in my simplistic mindset this way necessitates an extra two more key strokes (if typing) which leaves more room for error, (if typing, and more so after the issues I've had with quotes)
Is there a overriding reason why this is a better way of writing the code?
ExifTool gives you lots of ways to do things. You are free to choose the one that suits you best.
For more information about this specifically, you can read here (https://exiftool.org/under.html#conversions) about the various conversions that Exiftool applies to the values. Adding a '#' as a suffix to the tag name accesses the "ValueConv", or "numerical" value of a tag ("numerical" --> hence the "#" suffix and the "-n" option name).
- Phil
I'd just like to say a big thank you, not just to you Phil but Stargeek also. Your explanations and patience have been outstanding.
Just let you know what you helped me achieve.
I have now been able to do what many apps have claimed to do and failed. Which is embed Location,Keywords, Description, Author, Copyright and Creator Contact into my video files. As said before I've been able to do this with photo files but not video up until now.
The hardest issue was getting the info I required, (which was mainly Keywords, but Location and description as a 'nice to have') to show up in the information pane of the viewer I use which is Apple Photos.
Previous apps I'd used had manage to embed some of the info in the file but it wasn't read by Photos. No app managed to embed keywords!
I know there is probably a better way! But utilising my current knowledge I have put the code into an excel S/s. I copy and paste the info I need, 'location, keywords & description' into their corresponding cell and concatenate a script line which I copy and paste into terminal, then drag in the file to be changed.
The whole process is pretty quick, and to be honest I don't think it would be any quicker using any of the previously mention apps if they worked, as I would just be copy/pasting the same info into their GUI much the same as my S/s.
So all in all I'm quite chuffed at what I've achieved! But I couldn't have done it without your help.
Another plus is my son has taken an interest and now thinks he can make a basic GUI to maybe make it that bit quicker and better looking. He's been playing with various coding platforms at school and this has given him a goal to utilise what he has learned, once he saw what was needed and the end result.
Many thanks
Wayne
Just to point out an option, you could save the excel spreadsheet as a CSV file and then use exiftool's -csv option (https://exiftool.org/exiftool_pod.html#csv-CSVFILE) to write the data to the file. You could also do it in batch, create the spreadsheet will all the data and then write it all with a single exiftool command. See also FAQ #26 (https://exiftool.org/faq.html#Q26).
It requires the spreadsheet to be in a specific format, but not that hard to create. You could use exiftool to create a blank version, load it up in Excel, fill in the data, and then write it out. See FAQ #12 (https://exiftool.org/faq.html#Q12) for info on exporting to a csv file.
@Stargeek: Good suggestion.
@Gusman: It may be helpful to others if you could post a short summary of which ExifTool tags correspond to what information displayed by Apple Photos.
- Phil