Hey all-
I've got an AVI created with a cheap camera. It won't read in a lot of players, for instance.
I use ffmpeg to create an MP4 from it, which works fine. What I want to do is pull the FileModifyDate from the broken AVI and write it into the MP4.
exiftool.exe -TagsFromFile MOVI0006.avi "CreateDate<FileModifyDate" sq11-2021-04-25-MOVI0006.mp4
I get the following error:
Warning: Encountered empty null chunk. Processing aborted - MOVI0006.avi
Error: File not found - CreateDate<FileModifyDate
1 image files updated
1 files weren't updated due to errors
When I just query the AVI, everything is fine:
exiftool\exiftool.exe -FileModifyDate MOVI0006.avi
File Modification Date/Time : 2021:04:25 09:55:20-05:00
Any ideas? Am I misunderstanding the error message?
You're command is incomplete. You need a dash before CreateDate. The hint is the fact that exiftool reports "CreateDate<FileModifyDate" as a File not found, so it's not reading it as copy operation.
Try
exiftool.exe -TagsFromFile MOVI0006.avi "-CreateDate<FileModifyDate" sq11-2021-04-25-MOVI0006.mp4
Oops, deepest apologies. I tried 50 things and grabbed the wrong one. Here's the exact line out of my script:
exiftool -TagsFromFile %AVIFILE% -FileModifyDate "-alldates<FileModifyDate" %OUTPUT_FILE%
Warning: Encountered empty null chunk. Processing aborted - MOVI0006.avi
1 image files updated
I found my error. I was looking at the wrong output file. Sorry for the trouble.
However, I've got a time zone issue now.
C:\files\Dropbox\sq11>c:\tools\exiftool\exiftool.exe -FileModifyDate -alldates sq11-2021-04-25-MOVI0006.mp4
File Modification Date/Time : 2021:04:25 09:55:20-05:00
Date/Time Original : 2021:04:25 09:55:20-05:00
Create Date : 2021:04:25 09:55:20-05:00
Modify Date : 2021:04:25 09:55:20-05:00
C:\files\Dropbox\sq11>c:\tools\exiftool\exiftool.exe -FileModifyDate -alldates MOVI0006.avi
File Modification Date/Time : 2021:04:25 09:55:20-05:00
The AVI is the input, and it shows in Windows explorer as 9:55am, but the MP4 output shows as 4:55am. But when I query above, they both show as -05:00.
See the 3rd paragraph under Quicktime tags (https://exiftool.org/TagNames/QuickTime.html).
The Quicktime:CreateDate and Quicktime:ModifyDate are supposed to be UTC according to the spec. But a lot of older cameras from when the ability to read video was added to exiftool did not follow the spec, mostly because there wasn't an option for time zones. Because of this, exiftool writes the timestamp directly as you set it, in this case, 2021:04:25 09:55:20. But Windows understands the spec and will properly adjust the time, shifting the time back 5 hours.
Add the -api QuickTimeUTC option (https://exiftool.org/ExifTool.html#QuickTimeUTC) to your command and exiftool will adjust the time to UTC when writing.
exiftool -api QuickTimeUTC -TagsFromFile %AVIFILE% -FileModifyDate "-alldates<FileModifyDate" %OUTPUT_FILE%
That worked perfect. Thank you!