Quote from: gnorf on December 05, 2021, 05:41:11 AM
it tried this:
exiftool . -r -ext mp4 -ext mov -ext jpg "-CreateDate<FileName" -if "$CreateDate le '1900'"
But it wont work because the .00_England.MP4 irritates the exiftool.
In what way does it "irritate" exiftool? It works correctly here
C:\>exiftool -P -overwrite_original "-CreateDate<Filename" Y:\!temp\aa\bbb\20200821_153211.00_England.MP4
1 image files updated
C:\>exiftool -g1 -a -s -CreateDate Y:\!temp\aa\bbb\20200821_153211.00_England.MP4
---- QuickTime ----
CreateDate : 2020:08:21 15:32:11
---- XMP-xmp ----
CreateDate : 2020:08:21 15:32:11
Quote
I tried to modify the filter an it seems to work fine. But i didn't understand the filter and i suppose it is not really poor modified an can make problems in the future
Now it seems to work. But i think it is not perfect.
now i tested this command(s):
exiftool . *.mp4 "-alldates<filename" -api "filter=s/^(\d{6})00/${1}01/;s/(.{18}).*/$1/;$_"
exiftool . *.mp4 "-fileCreateDate<createDate" "-fileModifyDate<createDate"
For the filename example you give, that filter doesn't do much. The first substitution
s/^(\d{6})00/${1}01/ doesn't do anything and the second one
s/(.{18}).*/$1/ removes anything after the first 18 characters. You can test it by using that filter to display the filename with that filter
C:\>exiftool -filename -api "filter=s/^(\d{6})00/${1}01/;s/(.{18}).*/$1/;$_" Y:\!temp\aa\bbb\20200829_184557.12_England.MP4
File Name : 20200829_184557.12
All it does is keep the numbers, including the sub-seconds. But the part that is removed shouldn't affect copying the filename into the date anyway, see FAQ #5 (https://exiftool.org/faq.html#Q5), third paragraph.
Quotethe second command seems to work. but i have an offset of two hours:
======== ./20200829_184557.12_England.mov
File Creation Date/Time : 2020:08:29 18:45:57+02:00
File Modification Date/Time : 2020:08:29 18:45:57+02:00
File Name : 20200829_184557.12_England.mov
Date/Time Original : 2020:08:29 18:45:57.12
Create Date : 2020:08:29 18:45:57.12
Modify Date : 2020:08:29 18:45:57.12
1 directories scanned
7 image files read
How can i modify the actual Date with the correct timezone?
The timezone part of the
FileCreateDate/
FileModifyDate dates are set by the location that your computer has been set to. On that date, in
your computer's location, the time zone was +02:00. This cannot be changed, nor should it. If the location where the video was taken was not in a +02:00 timezone, then that needs to be accounted for when writing the data and that will require a more complex command. Your computer will automatically adjust that time stamp to your current time zone.
I'm guessing that you are in CET timezone (CEST at the time of the video) and the video was taken in WET (WEST at the time of the video)?
As an additional problem, the timestamps in video files are supposed to be set to UTC and Windows/Mac will automatically adjust the time zone when you look at the properties. See the fourth paragraph on the Quicktime tags page (https://exiftool.org/TagNames/QuickTime.html). So these tags also need to be adjusted in order to be correct. This can be done using the
-api QuickTimeUTC option (https://exiftool.org/ExifTool.html#QuickTimeUTC).
I would suggest this as the command to use, assuming video was taken in a +01:00 time zone
exiftool -api QuickTimeUTC "-AllDates<${Filename;m/^(\d+_\d+)/;$_=$1} +01:00" "-FileCreateDate<${Filename;m/^(\d+_\d+)/;$_=$1} +01:00" "-FileModifyDate<${Filename;m/^(\d+_\d+)/;$_=$1} +01:00" /path/to/files/For files taken in non-Summertime time zones, you would need to adjust the time zone appropriately.
Quote from: gnorf on December 05, 2021, 04:18:29 PM
exiftool "-filename" -api "filter=s/^(\d{8}\d{6})/${1}/;s/(.{15}).*/$1/;$_" d:\exiftool\20200824_165453.00_England.MP4
QuoteI need only a filter with cut of the part with starts with the point to removes .00_England.MP4 from 20200824_165453.00_England.MP4
-api "filter=s/\..*//" will remove the "." and everything after it.
Quoteexiftool "-filename" -api "filter=s/^(\d{8}.\d{6})/${1}/;s/(.{15}).*/$1/;$_" d:\exiftool\20200824_165453.00_England.MP4 seems to do the Job but i do not understand why.
s/(.{15}).*/$1/ removes everything after the first 15 characters.
Quotethe first part may matches 8 numbers followed by any char followed by 6 numbers.
i don't know with does the ${1}
$1 (or
${1}) represents everything that matched in the first set of brackets. So
s/^(\d{8}.\d{6})/${1}/ is replacing the first 8 digits + 1 character + 6 digits with the same string. ie) it is doing nothing.
- Phil
Quote from: Phil Harvey on December 06, 2021, 08:53:18 AM
-api "filter=s/\..*//" will remove the "." and everything after it.
thanks, for the support. It does a perfect job :)
The other solution with
s/(.{15}).*/$1/ won't work. I dont know why