Copy all *ModifyDate EXIF tags from MOV to MP4 video fails

Started by pstein, July 16, 2024, 06:00:02 AM

Previous topic - Next topic

pstein

I want to copy ALL EXIF header tags in a MOV video file which contain the pattern "ModifyDate" to the Exif header of a existing MP4 video file. According to some previous answers and recommendations here in the forum  I entered the command:

exiftool -tagsfromfile "D:\test\foo bar\test.MOV" -"all:*ModifyDate" -P "D:\test\foo bar\target.mp4"
...and got the following response:

The system cannot find the drive specified.
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - D:\test\foo bar\test.MOV
    1 image files updated

The tag "System: FileModifyDate" in target MP4 is not updated

Its the same result when I omit the "-P" flag

Whats wrong?



Phil Harvey

System:FileModifyDate is marked as unsafe so it isn't copied when you use wildcards.  (See the Extra tags.)  You must copy it explicitly.

- 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

Ok, the command seems to work now. System:FileModifyDate is copied now with:

exiftool -tagsfromfile "D:\test\foo bar\test.MOV" -"all:*ModifyDate" "System:FileModifyDate"-P "D:\test\foo bar\target.mp4"
However the warning is still shown.
Maybe its because of the -"all:*ModifyDate" flag.
I kept this to copy all remaining non-"System" dates.

the warning confuses me.
How can I prevent it?

Phil Harvey

I assume you mean the "The system cannot find the drive specified" and not the ExtractEmbedded warning?  You forgot the dash before "System:FileModifyDate".  Also, there is a missing space after this.

- 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

Also, you can drop the -P (-preserve) option because you are explicitly setting the FileModifyDate so there's no need to preserve the it.
* 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).

Phil Harvey

I thought the -P may be useful since it should preserve the FileCreateDate.

- 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

Quote from: Phil Harvey on July 17, 2024, 01:09:32 PMI thought the -P may be useful since it should preserve the FileCreateDate.

Has there been a change to the -P option?

QuoteNote that some filesystems store a creation date (ie. FileCreateDate on Windows and Mac systems) which is not affected by this option.
* 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).

Phil Harvey

#7
Hi StarGeek,

I can't run Windows right now to test this, but at one point the -P preserved FileModifyDate on Windows:

Dec. 29, 2012 - Version 9.10
  - Changed -P option to also preserve FileCreateDate on Windows (requires
    Win32API::File::Time)


But the documentation you referenced indicates that FileModifyDate is always preserved in Windows.  I had forgotten this.

- Phil

Edit: The documentation you referenced was updated to state this in version 10.47, but I can find no corresponding code change in this version.  Curious.
...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

The FileCreateDate is preserved on Windows without the -P option. FileModifyDate is not preserved without the -P option.

Example ("SysTime" is my shortcut for file system time stamps)
C:\>exiftool -G1 -a -s -Systime y:\!temp\Test4.jpg
[System]        FileCreateDate                  : 2023:12:15 07:53:23-08:00
[System]        FileModifyDate                  : 2024:07:08 09:40:01-07:00

C:\>exiftool -overwrite_original -all= -description=test y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -Systime y:\!temp\Test4.jpg
[System]        FileCreateDate                  : 2023:12:15 07:53:23-08:00
[System]        FileModifyDate                  : 2024:07:17 14:35:36-07:00
* 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).

Phil Harvey

Thanks for the verification.  Good to know the docs are correct.

I'll try to remember for next time. ;)

- 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

Quote from: Phil Harvey on July 17, 2024, 07:42:54 AMYou forgot the dash before "System:FileModifyDate".  Also, there is a missing space after this.

Sorry for these typos.
I entered the correct command:

exiftool -tagsfromfile "D:\test\foo bar\test.MOV" -"all:*ModifyDate" -"System:FileModifyDate" -P "D:\test\foo bar\target.mp4"
But I still got as answer with warnings:

The system cannot find the drive specified.
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - D:\test\foo bar\test.MOV
    1 image files updated

So my question is still answered:
How do I get rid of the warnings?

Phil Harvey

You'll have to do some investigating to see why the system is giving the "cannot find the drive" message, but the ExifTool Warning may be avoided by adding either the -ee (to extract embedded tags) or the -m option (to ignore minor warnings).

Try these commands to see what happens:

dir "D:\test\foo bar\test.MOV"

dir "D:\test\foo bar\target.mp4"

Also try the exiftool command with files in the current directory without specifying the file path.

- 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

I copy/pasted your command, only changing the file paths, and ran it in both CMD and Powershell with no errors at all.
C:\>exiftool -tagsfromfile "Y:\!temp\Test4.mp4" -"all:*ModifyDate" -"System:FileModifyDate" -P "Y:\!temp\Test5.mp4"
    1 image files updated

The Warning: [minor] The ExtractEmbedded option shouldn't be showing up in an editing command.

Just to verify, you are using these command directly on the command line, not through a batch file or some other script?
* 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

Thank you for suggestions. Here are insights:

The Warning: [minor] The ExtractEmbedded option may find more tags in the media data
is not a warning its only an Information that the wildcard parameter may change multiple tags values at once.
It should be named "Information" and not "Warning".

The suggested flag -m helps to suppress it.

Now regarding the "The system cannot find the drive specified." output.

The statement of Stargeek about command line and batch script was interesting.
Yes, I executed the command originally from batch script.
Any yes, if I execute the same command from Command Prompt then the error message is NOT shown.
This is strange. I have never seen such a difference before

Any idea from where this does come from?

I can imagine that exiftool uses some batch script command cache. And a file lock is not released correctly.

However the values of all specified tags are correctly changed. Even with the error from batch script.

So the script works but this crazy error notification will confuse me presumably oftentimes for a second in the future.
I would appreciate to get rid of it.

StarGeek

Quote from: pstein on July 19, 2024, 04:55:43 AMThe statement of Stargeek about command line and batch script was interesting.
Yes, I executed the command originally from batch script.
Any yes, if I execute the same command from Command Prompt then the error message is NOT shown.
This is strange. I have never seen such a difference before

Any idea from where this does come from?

Not a clue. I cannot replicate this in a BAT file.

QuoteI can imagine that exiftool uses some batch script command cache. And a file lock is not released correctly.

It does not. There is no difference to exiftool as to if it is run on the command line or in a script.

Now that you have told us it is part of a BAT file, I suspect that is where the problem lies, as the "system cannot find the drive specified" error isn't an exiftool error. Maybe this SuperUser post will help.

* 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).