ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: SRPilot on November 26, 2023, 01:35:43 PM

Title: Save and restore existing metadata?
Post by: SRPilot on November 26, 2023, 01:35:43 PM
I intend to use exiftool to change the creation date and modified date on a number of video files.  Imay need to revert to the original data if the results are not what I expect.  The video files are quite large, so creating a copy of the files will consume a large amount of disk space.

Is there a command line that will create a file that contains the filename and existing metadata... and a paired command that would restore the data using that file?  Or do I need to write a python script to do this type of work?
Title: Re: Save and restore existing metadata?
Post by: StarGeek on November 26, 2023, 08:27:43 PM
The only option would be to not use the -overwrite_original option (https://exiftool.org/exiftool_pod.html#overwrite_original).  By default, exiftool will rename the original file by adding _original to the end.  You could then use the -restore_original option (https://exiftool.org/exiftool_pod.html#delete_original) to remove the new copy and restore the original.  Or simply remove it manually.

Otherwise, no. While there are ways of saving the metadata to a file, exiftool always rewrites the entire file, so there wouldn't be any reduction in the amount of time to revert if done that way.
Title: Re: Save and restore existing metadata?
Post by: SRPilot on November 26, 2023, 10:41:12 PM
Quote from: StarGeek on November 26, 2023, 08:27:43 PMThe only option would be to not use the -overwrite_original option (https://exiftool.org/exiftool_pod.html#overwrite_original).  By default, exiftool will rename the original file by adding _original to the end.  You could then use the -restore_original option (https://exiftool.org/exiftool_pod.html#delete_original) to remove the new copy and restore the original.  Or simply remove it manually.

Otherwise, no. While there are ways of saving the metadata to a file, exiftool always rewrites the entire file, so there wouldn't be any reduction in the amount of time to revert if done that way.

Thank you for the clarification.  This explains the performance when dealing with large files and emphasises why multiple operations should be done in the same command line rather than sequentially.
Title: Re: Save and restore existing metadata?
Post by: StarGeek on November 27, 2023, 10:18:56 PM
Totally forgot that this is covered in FAQ #31 (https://exiftool.org/faq.html#Q31).