Transfer Exif-Data and Maker-Notes to video files

Started by Silent Runner, December 30, 2023, 03:47:16 AM

Previous topic - Next topic

Silent Runner

When editing video files (MP4 and MOV) in Davinci Resolve, the contained meta data is lost.

Is there a way to transfer the metadata (Exif and Maker are sufficient) from the original video file to the edited one?  If some entries can lead to problems, can only selected data be copied? A batch file for drag-and-drop would be nice, but I would have to specify the source and target file somehow.

wywh

Try something like this. Copy all tags from one movie to another and set file dates (all Track*Date, Media*Date, Keys might not be updated if they do not exist in the source):

exiftool -m -overwrite_original -api QuickTimeUTC=1 -api LargeFileSupport=1 -tagsFromFile source.mp4 -All:All '-FileCreateDate<QuickTime:CreateDate' '-FileModifyDate<QuickTime:CreateDate' destination.mp4
Or as a batch from .mov to a same name .m4v in the same folder:

exiftool -m -overwrite_original -api QuickTimeUTC=1 -api LargeFileSupport=1 -tagsFromFile '%-.0f.mov' -All:All '-FileCreateDate<QuickTime:CreateDate' '-FileModifyDate<QuickTime:CreateDate' *.m4v
Or copy some 'Keys' from .mov to a same name .m4v in the same folder:

exiftool -m -P -overwrite_original -api LargeFileSupport=1 -tagsFromFile '%-.0f.mov' -Keys:GPSCoordinates -Keys:Make -Keys:Model -Keys:Software *.m4v
- Matti

Silent Runner

Thanks Matti for the answer. I have tried the second method with no success. Maybe I need to adjust the parameters. Unfortunately, I hardly remember how to use the command line and parameters. It must be over 25 years since I last worked with it.

What I have done:
- Created a text file in a folder on the Windows 10 desktop (Copy exif.bat)
- Copied the second code into it
- Entered the path before exiftool
- Entered pause in a new line
- copied a file A.mov (with meta data) and an edited A.m4v into the same folder as exiftool.exe (A.m4v was actually B.mov and I had renamed it).
- Dragged-and-dropped A.mov to the Copy exif.bat

Message in the command line: "The system cannot find the specified file."

What does '%-.0f.mov' stand for?
Normally I have a file B with the same extension after editing. B contains the original name with additional abbreviations for the type of editing (e.g.: A_Dstab_cut.mov). Is it possible to process two files via drag-and-drop with one batch file?

wywh

#3
Try first to get the 1st command with different source.mp4 and destination.mp4 filenames to work until you get the desired output. In Windows you must use double quotes " instead single quotes ' that Mac and Linux use.

Then proceed to make a similar batch. If the source and destination filename and suffix are the same, have them in different folders:

exiftool -m -overwrite_original -api QuickTimeUTC=1 -api LargeFileSupport=1 -TagsFromFile /path/to/sourcefiles/%f.%e -All:All /path/to/editedfiles/
Or copy tags from the original movie.mp4 to the re-encoded movie_converted.mp4 in the same folder. Number "10" must match the length of the used "_converted" suffix (%f is a token for the FileName and %e for the extension without the leading dot):

exiftool -m -overwrite_original -api QuickTimeUTC=1 -api LargeFileSupport=1 -tagsFromFile '%-.10f.mp4' -All:All -tagsFromFile '%-.10f.mp4' -All:All *_converted*
Change the quotes to " on Windows. '-api QuickTimeUTC=1' might not be needed here but I use that as placeholder so I do not forget it. StarGeek might chime in for more details.

- Matti

StarGeek

Quote from: Silent Runner on December 30, 2023, 03:47:16 AMIs there a way to transfer the metadata (Exif and Maker are sufficient) from the original video file to the edited one?

No. EXIF and MakerNotes are non-standard in a video file and every camera company forces them into the file in different ways.  As such they cannot be copied directly into another video.

wywh posts show how to copy all the standard video data from one file to another, but the EXIF/MakerNotes still can't be copied.

Your best option would be to copy the EXIF data into the XMP-exif tags (see below for details). You would still have the original EXIF values, but in a different place. One problem would be there aren't that many programs that support reading XMP data in videos, though I believe that Adobe programs will do so.

There really aren't any video tags that match the MakerNotes tags, so to keep that, you would have to specifically copy the data into other tags that you repurpose to hold the data.

To copy the EXIF data into XMP, you first need to grab the exif2xmp.args file from Github. There is a download raw file link in the upper right just above the code listing. Save that into the same directory as exiftool.

You would then use wywh's commands, except you would add exiftool -@ exif2xmp.args directly after -All:All with a space between them.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

wywh

Quote from: Silent Runner on December 30, 2023, 03:47:16 AMIs there a way to transfer the metadata (Exif and Maker are sufficient) from the original video file to the edited one?

I skipped those tags in my reply because I have never paid much attention to those in movies (except when they introduce some erroneous info I want to ignore anyway -- wrong EXIF inside an embedded ThumbnailImage in some Canon movies, for example. And none of my apps read XMP in movies -- are there any such apps except maybe at Adobe??).

Is there some important "Exif and Maker" info you want to preserve in a re-encoded movie? Then use that in the tagsFromFile command.

p.s. thanks to StarGeek for confirming I am on about the right track with this. Sorry for introducing so many confusing options to do basically the same thing. Do some tests and ask if you get stuck.