Renamer doesn't seem to take proper date from MP4

Started by rozsko, July 22, 2023, 08:03:12 PM

Previous topic - Next topic

rozsko

Hi There,
Just got back from holiday and trying to to rename all the photos and videos we took from across 5 different devices and one of the first things I wanted to do is to rename all the files to a single format, based on original date time (which is in the UTC+3 timezone).
Looks like renamer will work fine for the photos, but not for the videos.
As you can see on the screenshot attached, the metadata panel shows the dates properly, but renamer doesn't seem to consider the timezone specification.
Can yo let me know if I am doing something wrong or is this an actual bug?
Thanks,
Béla

Mario

See How IMatch uses Date and Time Information for the basics.
See

You are using a custom variable based on the original timestamp stored in the file which formats a date and time but does not include a time-zone. This does not "apply" a time-zone formatting and neither does it calculate a new time by adding or removing a time zone offset. It looks like the variable does exactly what it should.

What outcome would you expect?
Maybe File.DateTime.TZO or File.DateTime.LocalFile / DateTime.Local.TZO may be better suited?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rozsko

Thanks Mario for the reply.
So for the example in my screenshot, {file.datetime.original|format:YYYY-MM.DD hh-mm-ss} shold be 2023.07.13 16:56::48
This is exactly what you see on the metadata panel, under XMP exif - date time original (and all other date/time fields in there).
I don't want the timezone designation be part of the file name, so I did not include that in the formatting.

On the other hand, in the renamer preview, you can see the time shown as UTC.
local time would be UTC+2 as I am based in Hungary.

Also, as I mentioned, this works perfectly for photos and I see this as a problem for MP4 videos only.
I actually used timewiz to add the timezone shift information to all the date fields I could find in the metadata panel, as I thought that will fix the problem, but it did not.

Mario

What do the variables

{File.DateTime.Original}
{File.DateTime.Original.TZO}

return in the VarToy?

I also need a sample MP4 video which exhibits this problem.
You can send it to support email address (include a link to this topic, I get lots of emails per day) or upload to your cloud space ands send me a link.
Since MP4 usually don't include EXIF data, IMatch checks for a variety of QuickTime and other tags to determine the values for File.DateTime and DateTimeOriginal. Vidoe metadata is an even bigger mess than image metadata.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rozsko

#4
Hi Mario,

Attached is the screenshot from VarToy for the video I sent you the link for in email.
Also attached is what is shown in the metadata panel.
What is strange though is that after metadata write back, the date fields in the metadata panel loos the time zone shift portion. Before the metadata writeback it was showing properly.
Thanks,
Béla

Mario

Thanks for sending the image.
It contains the following time stamps:

[QuickTime]     Create Date                     : 2023:07:11 13:36:10
[QuickTime]     Modify Date                     : 2023:07:11 13:36:10
[Track1]        Track Create Date               : 2023:07:11 13:36:10
[Track1]        Track Modify Date               : 2023:07:11 13:36:10
[Track1]        Media Create Date               : 2023:07:11 13:36:10
[Track1]        Media Modify Date               : 2023:07:11 13:36:10
...
[XMP-exif]      Date/Time Original              : 2023:07:11 13:36:10+03:00
[XMP-photoshop] Date Created                    : 2023:07:11 13:36:10+03:00
[XMP-xmp]       Create Date                     : 2023:07:11 13:36:10+03:00
[XMP-xmp]       Metadata Date                   : 2023:07:24 22:39:56+02:00
[XMP-xmp]       Modify Date                     : 2023:07:24 22:39:56+02:00

IMatch imports the time stamps with the time zone of +03:00, since XMP overrides native metadata.

Image1.jpg

When I use these variables in VarToy:

U {File.DateTime.UTC}
O {File.DateTime.Original}
O {File.DateTime.Original.TZO}
OF {File.DateTime.Original|format:YYYY.MM.DD hh-mm-ss}

L {File.DateTime.Local}
L {File.DateTime.Local.TZO}


I get

U 11.07.2023 10:36:10
O 11.07.2023 13:36:10
O 11.07.2023 13:36:10+03:00
OF 2023.07.11 13-36-10

L 11.07.2023 12:36:10
L 11.07.2023 12:36:10+02:00

which means IMatch is correct, as far as I can tell.
Renamer also emits 13:16:10 as the original date:

Image2.jpg

Am I missing something?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rozsko

Thank you Mario.

Actually your results are different then mine for the same file.

This is what I get in VarToy:
U 7/11/2023 10:36:10
O 7/11/2023 10:36:10
O 7/11/2023 10:36:10Z
OF 2023.07.11 10-36-10

L 7/11/2023 12:36:10
L 7/11/2023 12:36:10+02:00

Yet, in the metadata tab, the original datetime shows 2023:07:11 13:36:10+03:00 which is correct.
And the renamer shows the same incorrect value as in VarToy.
Any suggestions how I could overwrite the value for {File.DateTime.Original}? TimeWiz doesn't seem to do trick (or I am updating the wrong tag? XMP::photoshop\DateCreated\DateCreated\0).
Thanks,
Béla

Mario

IMatch calculates the value of File.DateTimeOriginal from the UTC timestamp in File.DateTime by adding the UTC offset calculated while ingesting the file.

{File.DateTime.UTC}
{File.DateTime.UTCOffset} <=

File.DateTime (UTC) is 11.07.2023 10:36:10 with an offset of +03:00 for the MP4 file provided.

The "original" timestamp hence is "11.07.2023 13:36:10" or "11.07.2023 13:36:10+03:00"
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rozsko

Quote from: Mario on July 27, 2023, 02:04:35 PMIMatch calculates the value of File.DateTimeOriginal from the UTC timestamp in File.DateTime by adding the UTC offset calculated while ingesting the file.

{File.DateTime.UTC}
{File.DateTime.UTCOffset} <=

File.DateTime (UTC) is 11.07.2023 10:36:10 with an offset of +03:00 for the MP4 file provided.

The "original" timestamp hence is "11.07.2023 13:36:10" or "11.07.2023 13:36:10+03:00"
That is exactly what I am expecting.
However if you look at the code section of my last reply, you can see that the original time is shown the same as the UTC (10:36) and we are talking about the same file that both of us has, yet iMatch behaves differently.
For you, the original time is shown correctly, for me it show the UTC time.
Yet, in the metadata panel, the original time is shown correctly, but the renamer shows the value of 10:36 from the original date time variable.

Mario

I get for the file you provided:

Image1.jpg

Image2.jpg

so what's the difference that causes this difference?

Which mapping File.DateTime Mapping Mode do you use under Edit > Preferences > Metadata 2:
What is your local time zone offset?
What happens if you force a rescan of the metadata by selecting the file in a FW, pressing Shift+Ctrl+F5 and then use Reload Metadata?

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook