Merge MP4 videos while appending EXIF metadata

Started by GISSimplified, July 26, 2024, 05:30:54 AM

Previous topic - Next topic

GISSimplified

How to merge multiple MP4 videos while appending EXIF metadata in merged video.

Phil Harvey

You can use ffmpeg to merge the videos.  ExifTool can write static metadata to the resulting video (not EXIF because videos don't support EXIF metadata, instead use QuickTime or XMP tags).  But nothing I know of can write timed metadata (eg. GPS track) if that is what you want.

- 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 ($).

GISSimplified

I am having multiple MP4 videos with coordinates stored in Quicktime tag. I have already merged video but want to combine metadata (including GPS coordinates with date and time) and apply to merged video.

Phil Harvey

Try this command:

exiftool -tagsfromfile ORIGINAL_FILE "-all:all<quicktime:all" MERGED_FILE

- 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

You can also use the exif2xmp.args file to copy any EXIF tags into the corresponding XMP tags.
"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

GISSimplified

Quote from: Phil Harvey on July 26, 2024, 04:19:32 PMTry this command:

exiftool -tagsfromfile ORIGINAL_FILE "-all:all<quicktime:all" MERGED_FILE

- Phil

I tried this command but it is not copying all quicktime metadata from source to destination MP4 file. Even multiple MP4 files having same Quicktime tag like Track1:GPSLatitude, Track1:GPSLongitude etc. How they will be copied into merged file. I want all of them to be retained rather than overwrite due to same tag name.

Phil Harvey

ExifTool creates only top-level tags in QuickTime-format files.  It won't write to Track1.   Also, see the QuickTime tags documentation to see which tags are writable (GPSLatitude/GPSLongitude aren't -- you need to use GPSCoordinates).

- 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 ($).