I have used exiftool to copy metadata from the originals to the re-encoded images and movies. For example:
Copy all metadata from one image to another and set file dates:
exiftool -m -overwrite_original -tagsFromFile source.cr3 -All '-FileCreateDate<ExifIFD:DateTimeOriginal' '-FileModifyDate<ExifIFD:DateTimeOriginal' destination.jpg
Copy all metadata from .cr3 to same name .jpg in the same folder and set file dates in batch mode:
exiftool -m -overwrite_original -tagsFromFile %-.0f.cr3 -All '-FileCreateDate<ExifIFD:DateTimeOriginal' '-FileModifyDate<ExifIFD:DateTimeOriginal' *.jpg
Copy all metadata from one movie to another and set file dates:
exiftool -m -overwrite_original -api QuickTimeUTC=1 -tagsFromFile source.mov -All:All '-Track*Date<QuickTime:CreateDate' '-Media*Date<QuickTime:CreateDate' '-FileCreateDate<QuickTime:CreateDate' '-FileModifyDate<QuickTime:CreateDate' destination.mp4
Copy all metadata from .mov to same name .mp4 in the same folder and set file dates in batch mode:
exiftool -m -overwrite_original -api QuickTimeUTC=1 -tagsFromFile %-.0f.mov -All:All '-Track*Date<QuickTime:CreateDate' '-Media*Date<QuickTime:CreateDate' '-FileCreateDate<QuickTime:CreateDate' '-FileModifyDate<QuickTime:CreateDate' *.mp4
...but does not work on an iPad. Usually Mac's Lightroom quite well preserves metadata in its output (there is a setting for that).